active_stix 0.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +28 -0
- data/Rakefile +32 -0
- data/app/assets/config/active_stix_manifest.js +2 -0
- data/app/assets/javascripts/active_stix/application.js +15 -0
- data/app/assets/javascripts/active_stix/artifacts.js +2 -0
- data/app/assets/javascripts/active_stix/attack_patterns.js +2 -0
- data/app/assets/javascripts/active_stix/bcc_refs.js +2 -0
- data/app/assets/javascripts/active_stix/bundled_objects.js +2 -0
- data/app/assets/javascripts/active_stix/bundles.js +2 -0
- data/app/assets/javascripts/active_stix/campaigns.js +2 -0
- data/app/assets/javascripts/active_stix/course_of_actions.js +2 -0
- data/app/assets/javascripts/active_stix/cyber_observables.js +2 -0
- data/app/assets/javascripts/active_stix/email_messages.js +2 -0
- data/app/assets/javascripts/active_stix/external_references.js +2 -0
- data/app/assets/javascripts/active_stix/files.js +2 -0
- data/app/assets/javascripts/active_stix/identities.js +2 -0
- data/app/assets/javascripts/active_stix/indicator_labels.js +2 -0
- data/app/assets/javascripts/active_stix/indicators.js +2 -0
- data/app/assets/javascripts/active_stix/intrusion_sets.js +2 -0
- data/app/assets/javascripts/active_stix/kill_chain_phases.js +2 -0
- data/app/assets/javascripts/active_stix/kill_chains.js +2 -0
- data/app/assets/javascripts/active_stix/malwares.js +2 -0
- data/app/assets/javascripts/active_stix/marking_definitions.js +2 -0
- data/app/assets/javascripts/active_stix/observed_data.js +2 -0
- data/app/assets/javascripts/active_stix/open_vocabularies.js +2 -0
- data/app/assets/javascripts/active_stix/phases.js +2 -0
- data/app/assets/javascripts/active_stix/recipients.js +2 -0
- data/app/assets/javascripts/active_stix/relationships.js +2 -0
- data/app/assets/javascripts/active_stix/reports.js +2 -0
- data/app/assets/javascripts/active_stix/threat_actors.js +2 -0
- data/app/assets/javascripts/active_stix/tools.js +2 -0
- data/app/assets/javascripts/active_stix/urls.js +2 -0
- data/app/assets/javascripts/active_stix/users.js +2 -0
- data/app/assets/stylesheets/active_stix/application.css +15 -0
- data/app/assets/stylesheets/active_stix/artifacts.css +4 -0
- data/app/assets/stylesheets/active_stix/attack_patterns.css +4 -0
- data/app/assets/stylesheets/active_stix/bcc_refs.css +4 -0
- data/app/assets/stylesheets/active_stix/bundled_objects.css +4 -0
- data/app/assets/stylesheets/active_stix/bundles.css +4 -0
- data/app/assets/stylesheets/active_stix/campaigns.css +4 -0
- data/app/assets/stylesheets/active_stix/course_of_actions.css +4 -0
- data/app/assets/stylesheets/active_stix/cyber_observables.css +4 -0
- data/app/assets/stylesheets/active_stix/email_messages.css +4 -0
- data/app/assets/stylesheets/active_stix/external_references.css +4 -0
- data/app/assets/stylesheets/active_stix/files.css +4 -0
- data/app/assets/stylesheets/active_stix/identities.css +4 -0
- data/app/assets/stylesheets/active_stix/indicator_labels.css +4 -0
- data/app/assets/stylesheets/active_stix/indicators.css +4 -0
- data/app/assets/stylesheets/active_stix/intrusion_sets.css +4 -0
- data/app/assets/stylesheets/active_stix/kill_chain_phases.css +4 -0
- data/app/assets/stylesheets/active_stix/kill_chains.css +4 -0
- data/app/assets/stylesheets/active_stix/malwares.css +4 -0
- data/app/assets/stylesheets/active_stix/marking_definitions.css +4 -0
- data/app/assets/stylesheets/active_stix/observed_data.css +4 -0
- data/app/assets/stylesheets/active_stix/open_vocabularies.css +4 -0
- data/app/assets/stylesheets/active_stix/phases.css +4 -0
- data/app/assets/stylesheets/active_stix/recipients.css +4 -0
- data/app/assets/stylesheets/active_stix/relationships.css +4 -0
- data/app/assets/stylesheets/active_stix/reports.css +4 -0
- data/app/assets/stylesheets/active_stix/threat_actors.css +4 -0
- data/app/assets/stylesheets/active_stix/tools.css +4 -0
- data/app/assets/stylesheets/active_stix/urls.css +4 -0
- data/app/assets/stylesheets/active_stix/users.css +4 -0
- data/app/assets/stylesheets/scaffold.css +80 -0
- data/app/controllers/active_stix/application_controller.rb +5 -0
- data/app/controllers/active_stix/artifacts_controller.rb +62 -0
- data/app/controllers/active_stix/attack_patterns_controller.rb +27 -0
- data/app/controllers/active_stix/bcc_refs_controller.rb +62 -0
- data/app/controllers/active_stix/bundled_objects_controller.rb +62 -0
- data/app/controllers/active_stix/bundles_controller.rb +11 -0
- data/app/controllers/active_stix/campaigns_controller.rb +74 -0
- data/app/controllers/active_stix/course_of_actions_controller.rb +62 -0
- data/app/controllers/active_stix/cyber_observables_controller.rb +62 -0
- data/app/controllers/active_stix/email_addresses_controller.rb +74 -0
- data/app/controllers/active_stix/email_messages_controller.rb +26 -0
- data/app/controllers/active_stix/external_references_controller.rb +62 -0
- data/app/controllers/active_stix/files_controller.rb +74 -0
- data/app/controllers/active_stix/identities_controller.rb +128 -0
- data/app/controllers/active_stix/indicator_labels_controller.rb +62 -0
- data/app/controllers/active_stix/indicators_controller.rb +62 -0
- data/app/controllers/active_stix/intrusion_sets_controller.rb +62 -0
- data/app/controllers/active_stix/kill_chain_phases_controller.rb +62 -0
- data/app/controllers/active_stix/kill_chains_controller.rb +62 -0
- data/app/controllers/active_stix/malwares_controller.rb +62 -0
- data/app/controllers/active_stix/marking_definitions_controller.rb +62 -0
- data/app/controllers/active_stix/observed_data_controller.rb +62 -0
- data/app/controllers/active_stix/open_vocabularies_controller.rb +62 -0
- data/app/controllers/active_stix/phases_controller.rb +62 -0
- data/app/controllers/active_stix/recipients_controller.rb +62 -0
- data/app/controllers/active_stix/relationships_controller.rb +62 -0
- data/app/controllers/active_stix/reports_controller.rb +62 -0
- data/app/controllers/active_stix/threat_actors_controller.rb +75 -0
- data/app/controllers/active_stix/tools_controller.rb +62 -0
- data/app/controllers/active_stix/urls_controller.rb +62 -0
- data/app/controllers/active_stix/user_accounts_controller.rb +74 -0
- data/app/controllers/active_stix/users_controller.rb +62 -0
- data/app/helpers/active_stix/application_helper.rb +4 -0
- data/app/helpers/active_stix/artifacts_helper.rb +4 -0
- data/app/helpers/active_stix/attack_patterns_helper.rb +4 -0
- data/app/helpers/active_stix/bcc_refs_helper.rb +4 -0
- data/app/helpers/active_stix/bundled_objects_helper.rb +4 -0
- data/app/helpers/active_stix/bundles_helper.rb +4 -0
- data/app/helpers/active_stix/campaigns_helper.rb +4 -0
- data/app/helpers/active_stix/course_of_actions_helper.rb +4 -0
- data/app/helpers/active_stix/cyber_observables_helper.rb +4 -0
- data/app/helpers/active_stix/email_messages_helper.rb +4 -0
- data/app/helpers/active_stix/external_references_helper.rb +4 -0
- data/app/helpers/active_stix/files_helper.rb +4 -0
- data/app/helpers/active_stix/identities_helper.rb +4 -0
- data/app/helpers/active_stix/indicator_labels_helper.rb +4 -0
- data/app/helpers/active_stix/indicators_helper.rb +4 -0
- data/app/helpers/active_stix/intrusion_sets_helper.rb +4 -0
- data/app/helpers/active_stix/kill_chain_phases_helper.rb +4 -0
- data/app/helpers/active_stix/kill_chains_helper.rb +4 -0
- data/app/helpers/active_stix/malwares_helper.rb +4 -0
- data/app/helpers/active_stix/marking_definitions_helper.rb +4 -0
- data/app/helpers/active_stix/observed_data_helper.rb +4 -0
- data/app/helpers/active_stix/open_vocabularies_helper.rb +4 -0
- data/app/helpers/active_stix/phases_helper.rb +4 -0
- data/app/helpers/active_stix/recipients_helper.rb +4 -0
- data/app/helpers/active_stix/relationships_helper.rb +4 -0
- data/app/helpers/active_stix/reports_helper.rb +4 -0
- data/app/helpers/active_stix/threat_actors_helper.rb +4 -0
- data/app/helpers/active_stix/tools_helper.rb +4 -0
- data/app/helpers/active_stix/urls_helper.rb +4 -0
- data/app/helpers/active_stix/users_helper.rb +4 -0
- data/app/jobs/active_stix/application_job.rb +4 -0
- data/app/mailers/active_stix/application_mailer.rb +6 -0
- data/app/models/active_stix/application_record.rb +5 -0
- data/app/models/active_stix/artifact.rb +23 -0
- data/app/models/active_stix/attack_pattern.rb +150 -0
- data/app/models/active_stix/bcc_ref.rb +6 -0
- data/app/models/active_stix/bundle.rb +108 -0
- data/app/models/active_stix/bundled_object.rb +4 -0
- data/app/models/active_stix/campaign.rb +65 -0
- data/app/models/active_stix/cc_ref.rb +6 -0
- data/app/models/active_stix/course_of_action.rb +54 -0
- data/app/models/active_stix/cyber_observable.rb +4 -0
- data/app/models/active_stix/email_address.rb +27 -0
- data/app/models/active_stix/email_message.rb +339 -0
- data/app/models/active_stix/external_reference.rb +48 -0
- data/app/models/active_stix/file.rb +2 -0
- data/app/models/active_stix/identity.rb +141 -0
- data/app/models/active_stix/indicator.rb +58 -0
- data/app/models/active_stix/indicator_label.rb +4 -0
- data/app/models/active_stix/intrusion_set.rb +69 -0
- data/app/models/active_stix/kill_chain.rb +7 -0
- data/app/models/active_stix/kill_chain_phase.rb +6 -0
- data/app/models/active_stix/label.rb +17 -0
- data/app/models/active_stix/label_malware.rb +4 -0
- data/app/models/active_stix/label_report.rb +4 -0
- data/app/models/active_stix/label_tool.rb +4 -0
- data/app/models/active_stix/malware.rb +98 -0
- data/app/models/active_stix/marking_definition.rb +21 -0
- data/app/models/active_stix/markup.rb +6 -0
- data/app/models/active_stix/object_marking.rb +11 -0
- data/app/models/active_stix/observed_datum.rb +67 -0
- data/app/models/active_stix/open_vocabulary.rb +8 -0
- data/app/models/active_stix/phase.rb +41 -0
- data/app/models/active_stix/recipient.rb +4 -0
- data/app/models/active_stix/reference_item.rb +4 -0
- data/app/models/active_stix/relationship.rb +95 -0
- data/app/models/active_stix/report.rb +93 -0
- data/app/models/active_stix/report_object.rb +9 -0
- data/app/models/active_stix/threat_actor.rb +139 -0
- data/app/models/active_stix/to_ref.rb +6 -0
- data/app/models/active_stix/tool.rb +112 -0
- data/app/models/active_stix/url.rb +15 -0
- data/app/models/active_stix/user.rb +4 -0
- data/app/models/active_stix/user_account.rb +3 -0
- data/app/views/active_stix/artifacts/_form.html.erb +57 -0
- data/app/views/active_stix/artifacts/edit.html.erb +6 -0
- data/app/views/active_stix/artifacts/index.html.erb +41 -0
- data/app/views/active_stix/artifacts/new.html.erb +5 -0
- data/app/views/active_stix/artifacts/show.html.erb +44 -0
- data/app/views/active_stix/attack_patterns/_form.html.erb +37 -0
- data/app/views/active_stix/attack_patterns/edit.html.erb +2 -0
- data/app/views/active_stix/attack_patterns/index.html.erb +2 -0
- data/app/views/active_stix/attack_patterns/new.html.erb +2 -0
- data/app/views/active_stix/attack_patterns/show.html.erb +140 -0
- data/app/views/active_stix/bcc_refs/_form.html.erb +27 -0
- data/app/views/active_stix/bcc_refs/edit.html.erb +6 -0
- data/app/views/active_stix/bcc_refs/index.html.erb +29 -0
- data/app/views/active_stix/bcc_refs/new.html.erb +5 -0
- data/app/views/active_stix/bcc_refs/show.html.erb +14 -0
- data/app/views/active_stix/bundles/index.html.erb +1 -0
- data/app/views/active_stix/bundles/show.html.erb +7 -0
- data/app/views/active_stix/campaigns/_form.html.erb +42 -0
- data/app/views/active_stix/campaigns/_stix_campaign.json.jbuilder +2 -0
- data/app/views/active_stix/campaigns/edit.html.erb +6 -0
- data/app/views/active_stix/campaigns/index.html.erb +35 -0
- data/app/views/active_stix/campaigns/index.json.jbuilder +1 -0
- data/app/views/active_stix/campaigns/new.html.erb +5 -0
- data/app/views/active_stix/campaigns/show.html.erb +29 -0
- data/app/views/active_stix/campaigns/show.json.jbuilder +1 -0
- data/app/views/active_stix/email_messages/_form.html.erb +62 -0
- data/app/views/active_stix/email_messages/_stix_email_message.json.jbuilder +2 -0
- data/app/views/active_stix/email_messages/edit.html.erb +6 -0
- data/app/views/active_stix/email_messages/index.html.erb +43 -0
- data/app/views/active_stix/email_messages/index.json.jbuilder +1 -0
- data/app/views/active_stix/email_messages/new.html.erb +5 -0
- data/app/views/active_stix/email_messages/show.html.erb +165 -0
- data/app/views/active_stix/email_messages/show.json.jbuilder +1 -0
- data/app/views/active_stix/files/_form.html.erb +92 -0
- data/app/views/active_stix/files/_stix_file.json.jbuilder +2 -0
- data/app/views/active_stix/files/edit.html.erb +6 -0
- data/app/views/active_stix/files/index.html.erb +55 -0
- data/app/views/active_stix/files/index.json.jbuilder +1 -0
- data/app/views/active_stix/files/new.html.erb +5 -0
- data/app/views/active_stix/files/show.html.erb +79 -0
- data/app/views/active_stix/files/show.json.jbuilder +1 -0
- data/app/views/active_stix/identities/_form.html.erb +27 -0
- data/app/views/active_stix/identities/_individual.html.erb +100 -0
- data/app/views/active_stix/identities/_organization.html.erb +72 -0
- data/app/views/active_stix/identities/_received_email_messages.html.erb +27 -0
- data/app/views/active_stix/identities/_sent_email_messages.html.erb +27 -0
- data/app/views/active_stix/identities/_threat_icons.html.erb +3 -0
- data/app/views/active_stix/identities/edit.html.erb +2 -0
- data/app/views/active_stix/identities/index.html.erb +37 -0
- data/app/views/active_stix/identities/new.html.erb +5 -0
- data/app/views/active_stix/identities/show.html.erb +15 -0
- data/app/views/active_stix/layouts/active_stix/application.html.erb +16 -0
- data/app/views/active_stix/recipients/_form.html.erb +27 -0
- data/app/views/active_stix/recipients/edit.html.erb +6 -0
- data/app/views/active_stix/recipients/index.html.erb +29 -0
- data/app/views/active_stix/recipients/new.html.erb +5 -0
- data/app/views/active_stix/recipients/show.html.erb +14 -0
- data/app/views/active_stix/threat_actors/_form.html.erb +32 -0
- data/app/views/active_stix/threat_actors/_stix_threat_actor.json.jbuilder +2 -0
- data/app/views/active_stix/threat_actors/edit.html.erb +6 -0
- data/app/views/active_stix/threat_actors/flags.html.erb +184 -0
- data/app/views/active_stix/threat_actors/index.html.erb +26 -0
- data/app/views/active_stix/threat_actors/index.json.jbuilder +1 -0
- data/app/views/active_stix/threat_actors/new.html.erb +5 -0
- data/app/views/active_stix/threat_actors/show.html.erb +4 -0
- data/app/views/active_stix/threat_actors/show.json.jbuilder +1 -0
- data/app/views/layouts/active_stix/application.html.erb +16 -0
- data/config/routes.rb +39 -0
- data/db/migrate/20191204200025_create_active_stix_bundled_objects.rb +11 -0
- data/db/migrate/20191204213707_create_active_stix_bundles.rb +10 -0
- data/db/migrate/20191204213802_create_active_stix_campaigns.rb +15 -0
- data/db/migrate/20191204213926_create_active_stix_course_of_actions.rb +12 -0
- data/db/migrate/20191204214020_create_active_stix_cyber_observables.rb +11 -0
- data/db/migrate/20191204214955_create_active_stix_email_messages.rb +20 -0
- data/db/migrate/20191204215029_create_active_stix_external_references.rb +12 -0
- data/db/migrate/20191204215302_create_active_stix_files.rb +23 -0
- data/db/migrate/20191204215419_create_active_stix_identities.rb +13 -0
- data/db/migrate/20191204215542_create_active_stix_indicator_labels.rb +10 -0
- data/db/migrate/20191204215637_create_active_stix_indicators.rb +16 -0
- data/db/migrate/20191204215849_create_active_stix_intrusion_sets.rb +15 -0
- data/db/migrate/20191204215929_create_active_stix_kill_chain_phases.rb +10 -0
- data/db/migrate/20191204215951_create_active_stix_kill_chains.rb +9 -0
- data/db/migrate/20191204220149_create_active_stix_malwares.rb +12 -0
- data/db/migrate/20191204220539_create_active_stix_marking_definitions.rb +12 -0
- data/db/migrate/20191204220853_create_active_stix_observed_data.rb +12 -0
- data/db/migrate/20191204220917_create_active_stix_open_vocabularies.rb +9 -0
- data/db/migrate/20191204220952_create_active_stix_phases.rb +11 -0
- data/db/migrate/20191204221129_create_active_stix_recipients.rb +10 -0
- data/db/migrate/20191204221227_create_active_stix_relationships.rb +16 -0
- data/db/migrate/20191204221323_create_active_stix_report_objects.rb +11 -0
- data/db/migrate/20191204221359_create_active_stix_reports.rb +14 -0
- data/db/migrate/20191204221425_create_active_stix_threat_actors.rb +11 -0
- data/db/migrate/20191204221454_create_active_stix_tools.rb +12 -0
- data/db/migrate/20191204221639_create_active_stix_urls.rb +9 -0
- data/db/migrate/20191204221849_create_active_stix_users.rb +22 -0
- data/db/migrate/20191205182234_create_active_stix_bcc_refs.rb +10 -0
- data/db/migrate/20191205182255_create_active_stix_cc_refs.rb +10 -0
- data/db/migrate/20191205182316_create_active_stix_to_refs.rb +10 -0
- data/db/migrate/20191212203611_add_spec_version_to_bundles.rb +5 -0
- data/db/migrate/20191212215136_create_active_stix_attack_patterns.rb +12 -0
- data/db/migrate/20191212220222_create_active_stix_reference_items.rb +11 -0
- data/db/migrate/20191213135204_create_active_stix_labels.rb +10 -0
- data/db/migrate/20191213140951_create_active_stix_markups.rb +11 -0
- data/db/migrate/20191221210537_fix_observed_data.rb +6 -0
- data/db/migrate/20191221223602_create_active_stix_artifacts.rb +16 -0
- data/db/migrate/20191223075550_change_artifact_ref_to_string.rb +5 -0
- data/db/migrate/20191223154000_add_stix_id_to_email_messages.rb +5 -0
- data/db/migrate/20200114162245_add_labels_to_active_stix_identities.rb +5 -0
- data/db/migrate/20200404223006_add_aliases_to_tools.rb +5 -0
- data/db/migrate/20200404223047_add_aliases_to_attack_patterns.rb +5 -0
- data/db/migrate/20200404223158_add_aliases_to_malwares.rb +5 -0
- data/db/migrate/20200404223210_add_aliases_to_threat_actors.rb +5 -0
- data/lib/active_stix.rb +8 -0
- data/lib/active_stix/engine.rb +13 -0
- data/lib/active_stix/version.rb +3 -0
- data/lib/tasks/active_stix_tasks.rake +4 -0
- metadata +358 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<%= form_with(model: bcc_ref, local: true) do |form| %>
|
|
2
|
+
<% if bcc_ref.errors.any? %>
|
|
3
|
+
<div id="error_explanation">
|
|
4
|
+
<h2><%= pluralize(bcc_ref.errors.count, "error") %> prohibited this bcc_ref from being saved:</h2>
|
|
5
|
+
|
|
6
|
+
<ul>
|
|
7
|
+
<% bcc_ref.errors.full_messages.each do |message| %>
|
|
8
|
+
<li><%= message %></li>
|
|
9
|
+
<% end %>
|
|
10
|
+
</ul>
|
|
11
|
+
</div>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
14
|
+
<div class="field">
|
|
15
|
+
<%= form.label :email_message_id %>
|
|
16
|
+
<%= form.number_field :email_message_id %>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="field">
|
|
20
|
+
<%= form.label :email_address_id %>
|
|
21
|
+
<%= form.number_field :email_address_id %>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class="actions">
|
|
25
|
+
<%= form.submit %>
|
|
26
|
+
</div>
|
|
27
|
+
<% end %>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
|
2
|
+
|
|
3
|
+
<h1>Bcc Refs</h1>
|
|
4
|
+
|
|
5
|
+
<table>
|
|
6
|
+
<thead>
|
|
7
|
+
<tr>
|
|
8
|
+
<th>Email message</th>
|
|
9
|
+
<th>Email address</th>
|
|
10
|
+
<th colspan="3"></th>
|
|
11
|
+
</tr>
|
|
12
|
+
</thead>
|
|
13
|
+
|
|
14
|
+
<tbody>
|
|
15
|
+
<% @bcc_refs.each do |bcc_ref| %>
|
|
16
|
+
<tr>
|
|
17
|
+
<td><%= bcc_ref.email_message_id %></td>
|
|
18
|
+
<td><%= bcc_ref.email_address_id %></td>
|
|
19
|
+
<td><%= link_to 'Show', bcc_ref %></td>
|
|
20
|
+
<td><%= link_to 'Edit', edit_bcc_ref_path(bcc_ref) %></td>
|
|
21
|
+
<td><%= link_to 'Destroy', bcc_ref, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
|
22
|
+
</tr>
|
|
23
|
+
<% end %>
|
|
24
|
+
</tbody>
|
|
25
|
+
</table>
|
|
26
|
+
|
|
27
|
+
<br>
|
|
28
|
+
|
|
29
|
+
<%= link_to 'New Bcc Ref', new_bcc_ref_path %>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
|
2
|
+
|
|
3
|
+
<p>
|
|
4
|
+
<strong>Email message:</strong>
|
|
5
|
+
<%= @bcc_ref.email_message_id %>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p>
|
|
9
|
+
<strong>Email address:</strong>
|
|
10
|
+
<%= @bcc_ref.email_address_id %>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<%= link_to 'Edit', edit_bcc_ref_path(@bcc_ref) %> |
|
|
14
|
+
<%= link_to 'Back', bcc_refs_path %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<%= form_with(model: campaign, local: true) do |form| %>
|
|
2
|
+
<% if campaign.errors.any? %>
|
|
3
|
+
<div id="error_explanation">
|
|
4
|
+
<h2><%= pluralize(campaign.errors.count, "error") %> prohibited this campaign from being saved:</h2>
|
|
5
|
+
|
|
6
|
+
<ul>
|
|
7
|
+
<% campaign.errors.full_messages.each do |message| %>
|
|
8
|
+
<li><%= message %></li>
|
|
9
|
+
<% end %>
|
|
10
|
+
</ul>
|
|
11
|
+
</div>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
14
|
+
<div class="field">
|
|
15
|
+
<%= form.label :name %>
|
|
16
|
+
<%= form.text_field :name %>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="field">
|
|
20
|
+
<%= form.label :description %>
|
|
21
|
+
<%= form.text_field :description %>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class="field">
|
|
25
|
+
<%= form.label :first_seen %>
|
|
26
|
+
<%= form.text_field :first_seen %>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div class="field">
|
|
30
|
+
<%= form.label :last_seen %>
|
|
31
|
+
<%= form.text_field :last_seen %>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="field">
|
|
35
|
+
<%= form.label :objective %>
|
|
36
|
+
<%= form.text_field :objective %>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div class="actions">
|
|
40
|
+
<%= form.submit %>
|
|
41
|
+
</div>
|
|
42
|
+
<% end %>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
|
2
|
+
|
|
3
|
+
<h1>Stix Campaigns</h1>
|
|
4
|
+
|
|
5
|
+
<table>
|
|
6
|
+
<thead>
|
|
7
|
+
<tr>
|
|
8
|
+
<th>Name</th>
|
|
9
|
+
<th>Description</th>
|
|
10
|
+
<th>First seen</th>
|
|
11
|
+
<th>Last seen</th>
|
|
12
|
+
<th>Objective</th>
|
|
13
|
+
<th colspan="3"></th>
|
|
14
|
+
</tr>
|
|
15
|
+
</thead>
|
|
16
|
+
|
|
17
|
+
<tbody>
|
|
18
|
+
<% @campaigns.each do |campaign| %>
|
|
19
|
+
<tr>
|
|
20
|
+
<td><%= campaign.name %></td>
|
|
21
|
+
<td><%= campaign.description %></td>
|
|
22
|
+
<td><%= campaign.first_seen %></td>
|
|
23
|
+
<td><%= campaign.last_seen %></td>
|
|
24
|
+
<td><%= campaign.objective %></td>
|
|
25
|
+
<td><%= link_to 'Show', campaign %></td>
|
|
26
|
+
<td><%= link_to 'Edit', edit_campaign_path(campaign) %></td>
|
|
27
|
+
<td><%= link_to 'Destroy', campaign, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
|
28
|
+
</tr>
|
|
29
|
+
<% end %>
|
|
30
|
+
</tbody>
|
|
31
|
+
</table>
|
|
32
|
+
|
|
33
|
+
<br>
|
|
34
|
+
|
|
35
|
+
<%= link_to 'New Stix Campaign', new_campaign_path %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
json.array! @campaigns, partial: "campaigns/campaign", as: :campaign
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
|
2
|
+
|
|
3
|
+
<p>
|
|
4
|
+
<strong>Name:</strong>
|
|
5
|
+
<%= @campaign.name %>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p>
|
|
9
|
+
<strong>Description:</strong>
|
|
10
|
+
<%= @campaign.description %>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p>
|
|
14
|
+
<strong>First seen:</strong>
|
|
15
|
+
<%= @campaign.first_seen %>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p>
|
|
19
|
+
<strong>Last seen:</strong>
|
|
20
|
+
<%= @campaign.last_seen %>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
<p>
|
|
24
|
+
<strong>Objective:</strong>
|
|
25
|
+
<%= @campaign.objective %>
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
<%= link_to 'Edit', edit_campaign_path(@campaign) %> |
|
|
29
|
+
<%= link_to 'Back', campaigns_path %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
json.partial! "campaigns/campaign", campaign: @campaign
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<%= form_with(model: email_message, local: true) do |form| %>
|
|
2
|
+
<% if email_message.errors.any? %>
|
|
3
|
+
<div id="error_explanation">
|
|
4
|
+
<h2><%= pluralize(email_message.errors.count, "error") %> prohibited this email_message from being saved:</h2>
|
|
5
|
+
|
|
6
|
+
<ul>
|
|
7
|
+
<% email_message.errors.full_messages.each do |message| %>
|
|
8
|
+
<li><%= message %></li>
|
|
9
|
+
<% end %>
|
|
10
|
+
</ul>
|
|
11
|
+
</div>
|
|
12
|
+
<% end %>
|
|
13
|
+
|
|
14
|
+
<div class="field">
|
|
15
|
+
<%= form.label :type %>
|
|
16
|
+
<%= form.text_field :type %>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="field">
|
|
20
|
+
<%= form.label :is_multipart %>
|
|
21
|
+
<%= form.check_box :is_multipart %>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<div class="field">
|
|
25
|
+
<%= form.label :date %>
|
|
26
|
+
<%= form.datetime_select :date %>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div class="field">
|
|
30
|
+
<%= form.label :content_type %>
|
|
31
|
+
<%= form.text_field :content_type %>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="field">
|
|
35
|
+
<%= form.label :from_ref %>
|
|
36
|
+
<%= form.text_field :from_ref %>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div class="field">
|
|
40
|
+
<%= form.label :sender_ref %>
|
|
41
|
+
<%= form.text_field :sender_ref %>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div class="field">
|
|
45
|
+
<%= form.label :subject %>
|
|
46
|
+
<%= form.text_field :subject %>
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
<div class="field">
|
|
50
|
+
<%= form.label :body %>
|
|
51
|
+
<%= form.text_field :body %>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<div class="field">
|
|
55
|
+
<%= form.label :raw_email_ref %>
|
|
56
|
+
<%= form.text_field :raw_email_ref %>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div class="actions">
|
|
60
|
+
<%= form.submit %>
|
|
61
|
+
</div>
|
|
62
|
+
<% end %>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
json.extract! email_message, :id, :type, :is_multipart, :date, :content_type, :from_ref, :sender_ref, :to_refs_link_id, :cc_refs_link_id, :bcc_refs_link_id, :subject, :received_lines_link_id, :body, :body_multipart_link_id, :raw_email_ref, :created_at, :updated_at
|
|
2
|
+
json.url email_message_url(email_message, format: :json)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<p id="notice"><%= notice %></p>
|
|
2
|
+
|
|
3
|
+
<h1>Stix Email Messages</h1>
|
|
4
|
+
|
|
5
|
+
<table>
|
|
6
|
+
<thead>
|
|
7
|
+
<tr>
|
|
8
|
+
<th>Type</th>
|
|
9
|
+
<th>Is multipart</th>
|
|
10
|
+
<th>Date</th>
|
|
11
|
+
<th>Content type</th>
|
|
12
|
+
<th>From ref</th>
|
|
13
|
+
<th>Sender ref</th>
|
|
14
|
+
<th>Subject</th>
|
|
15
|
+
<th>Body</th>
|
|
16
|
+
<th>Raw email ref</th>
|
|
17
|
+
<th colspan="3"></th>
|
|
18
|
+
</tr>
|
|
19
|
+
</thead>
|
|
20
|
+
|
|
21
|
+
<tbody>
|
|
22
|
+
<% @email_messages.each do |email_message| %>
|
|
23
|
+
<tr>
|
|
24
|
+
<td><%= email_message.type %></td>
|
|
25
|
+
<td><%= email_message.is_multipart %></td>
|
|
26
|
+
<td><%= email_message.date %></td>
|
|
27
|
+
<td><%= email_message.content_type %></td>
|
|
28
|
+
<td><%= email_message.from_ref %></td>
|
|
29
|
+
<td><%= email_message.sender_ref %></td>
|
|
30
|
+
<td><%= email_message.subject %></td>
|
|
31
|
+
<td><%= email_message.body %></td>
|
|
32
|
+
<td><%= email_message.raw_email_ref %></td>
|
|
33
|
+
<td><%= link_to 'Show', email_message %></td>
|
|
34
|
+
<td><%= link_to 'Edit', edit_email_message_path(email_message) %></td>
|
|
35
|
+
<td><%= link_to 'Destroy', email_message, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
|
36
|
+
</tr>
|
|
37
|
+
<% end %>
|
|
38
|
+
</tbody>
|
|
39
|
+
</table>
|
|
40
|
+
|
|
41
|
+
<br>
|
|
42
|
+
|
|
43
|
+
<%= link_to 'New Stix Email Message', new_email_message_path %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
json.array! @email_messages, partial: "email_messages/email_message", as: :email_message
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
<div class="container">
|
|
2
|
+
<div class="py-5 text-center">
|
|
3
|
+
<h2>Email Message</h2>
|
|
4
|
+
<p class="lead"><strong>Subject: </strong><%= @email_message.subject %></p>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<div class="row">
|
|
8
|
+
<div class="col-md-4 order-md-2 mb-4">
|
|
9
|
+
<h4 class="d-flex justify-content-between align-items-center mb-3">
|
|
10
|
+
<span class="text-muted">Data Box</span>
|
|
11
|
+
<span class="badge badge-secondary badge-pill">TBD</span>
|
|
12
|
+
</h4>
|
|
13
|
+
<ul class="list-group mb-3">
|
|
14
|
+
<li class="list-group-item d-flex justify-content-between lh-condensed">
|
|
15
|
+
<% if @email_message.eml %>
|
|
16
|
+
<div>
|
|
17
|
+
<% if @email_message %>
|
|
18
|
+
<h6 class="my-0"><%= link_to_if @email_message, "EML", main_app.eml_path(@email_message.eml) %></h6>
|
|
19
|
+
<% end %>
|
|
20
|
+
<small class="text-muted">
|
|
21
|
+
<div>Type: <%= @email_message.eml.mime_type %></div>
|
|
22
|
+
<div>Multipart?: <%= @email_message.is_multipart %></div>
|
|
23
|
+
</small>
|
|
24
|
+
</div>
|
|
25
|
+
<span class="text-muted">Parts: <%= @email_message.eml.parts.count %></span>
|
|
26
|
+
<% end %>
|
|
27
|
+
</li>
|
|
28
|
+
<% if @email_message.eml %>
|
|
29
|
+
<li class="list-group-item d-flex justify-content-between lh-condensed">
|
|
30
|
+
<div>
|
|
31
|
+
<h6 class="my-0">Thread</h6>
|
|
32
|
+
<small class="text-muted">
|
|
33
|
+
<ul>
|
|
34
|
+
<% @email_message.eml.references.each do |related_message| %>
|
|
35
|
+
<li>
|
|
36
|
+
<% if related_message.reference.email_message %>
|
|
37
|
+
<%= link_to_if (related_message.reference.email_message.id != @email_message.id), "#{related_message.reference.email_message.from.value }(#{related_message.reference.email_message.date.strftime('%FT%T')})", related_message.reference.email_message %>
|
|
38
|
+
<% end %>
|
|
39
|
+
</li>
|
|
40
|
+
<% end %>
|
|
41
|
+
<li>
|
|
42
|
+
<% if @email_message and @email_message.from and @email_message.date %>
|
|
43
|
+
<%= "#{@email_message.from.value }(#{@email_message.date.strftime('%FT%T')})" %>
|
|
44
|
+
<% end %>
|
|
45
|
+
</li>
|
|
46
|
+
|
|
47
|
+
<% @email_message.eml.referrers.each do |related_message| %>
|
|
48
|
+
<li>
|
|
49
|
+
<%= link_to_if related_message.referrer.email_message.id != @email_message.id, "#{related_message.referrer.email_message.from.value }(#{related_message.referrer.email_message.date.strftime('%FT%T')})", related_message.referrer.email_message %>
|
|
50
|
+
</li>
|
|
51
|
+
<% end %>
|
|
52
|
+
|
|
53
|
+
</ul>
|
|
54
|
+
</small>
|
|
55
|
+
</div>
|
|
56
|
+
</li>
|
|
57
|
+
<% end %>
|
|
58
|
+
<li class="list-group-item d-flex justify-content-between lh-condensed">
|
|
59
|
+
<div>
|
|
60
|
+
<h6 class="my-0">Date</h6>
|
|
61
|
+
<small class="text-muted"><%= @email_message.date %> </small>
|
|
62
|
+
</div>
|
|
63
|
+
</li>
|
|
64
|
+
<li class="list-group-item d-flex justify-content-between lh-condensed">
|
|
65
|
+
<div>
|
|
66
|
+
<h6 class="my-0">From</h6>
|
|
67
|
+
<small class="text-muted"><%= link_to @email_message.from.value, @email_message.from.identity %></small>
|
|
68
|
+
</div>
|
|
69
|
+
</li>
|
|
70
|
+
<li class="list-group-item d-flex justify-content-between bg-light">
|
|
71
|
+
<div class="my-0">
|
|
72
|
+
<h6 class="my-0">Sender</h6>
|
|
73
|
+
<small><%= @email_message.sender_ref %></small>
|
|
74
|
+
</div>
|
|
75
|
+
</li>
|
|
76
|
+
<li class="list-group-item d-flex justify-content-between bg-light">
|
|
77
|
+
<div class="my-0">
|
|
78
|
+
<h6 class="my-0">To</h6>
|
|
79
|
+
<small>
|
|
80
|
+
<ul>
|
|
81
|
+
<% @email_message.to_refs.each do |to| %>
|
|
82
|
+
<li><%= link_to to.email_address.value, to.email_address.identity %></li>
|
|
83
|
+
<% end %>
|
|
84
|
+
</ul>
|
|
85
|
+
</small>
|
|
86
|
+
</div>
|
|
87
|
+
</li>
|
|
88
|
+
<li class="list-group-item d-flex justify-content-between bg-light">
|
|
89
|
+
<div class="my-0">
|
|
90
|
+
<h6 class="my-0">CC</h6>
|
|
91
|
+
<small>
|
|
92
|
+
<ul>
|
|
93
|
+
<% @email_message.cc_refs.each do |cc| %>
|
|
94
|
+
<li><%= link_to cc.email_address.value, cc.email_address.identity %></li>
|
|
95
|
+
<% end %>
|
|
96
|
+
</ul>
|
|
97
|
+
</small>
|
|
98
|
+
</div>
|
|
99
|
+
</li>
|
|
100
|
+
<% if @email_message.eml %>
|
|
101
|
+
<li class="list-group-item d-flex justify-content-between bg-light">
|
|
102
|
+
<div class="my-0">
|
|
103
|
+
<h6 class="my-0">Parts</h6>
|
|
104
|
+
<small>
|
|
105
|
+
<ul>
|
|
106
|
+
<% @email_message.eml.parts.each do |part| %>
|
|
107
|
+
<li>
|
|
108
|
+
<%= part.mime_type %>
|
|
109
|
+
<tiny>
|
|
110
|
+
<%= part.content_disposition %>
|
|
111
|
+
</tiny>
|
|
112
|
+
</li>
|
|
113
|
+
<% end %>
|
|
114
|
+
</ul>
|
|
115
|
+
</small>
|
|
116
|
+
</div>
|
|
117
|
+
</li>
|
|
118
|
+
<% end %>
|
|
119
|
+
<li class="list-group-item d-flex justify-content-between bg-light">
|
|
120
|
+
<div class="my-0">
|
|
121
|
+
<h6 class="my-0">Legend</h6>
|
|
122
|
+
<span class="badge badge-pill badge-primary">Employee</span>
|
|
123
|
+
<span class="badge badge-pill badge-success">Friend</span>
|
|
124
|
+
<span class="badge badge-pill badge-danger">Foe</span>
|
|
125
|
+
<span class="badge badge-pill badge-secondary">Unknown</span>
|
|
126
|
+
</div>
|
|
127
|
+
</li>
|
|
128
|
+
</ul>
|
|
129
|
+
|
|
130
|
+
</div>
|
|
131
|
+
<div class="col-md-8 order-md-1">
|
|
132
|
+
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
|
133
|
+
<li class="nav-item">
|
|
134
|
+
<a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="true">Readable</a>
|
|
135
|
+
</li>
|
|
136
|
+
<li class="nav-item">
|
|
137
|
+
<a class="nav-link" id="profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile" aria-selected="false">Text</a>
|
|
138
|
+
</li>
|
|
139
|
+
<li class="nav-item">
|
|
140
|
+
<a class="nav-link" id="contact-tab" data-toggle="tab" href="#contact" role="tab" aria-controls="contact" aria-selected="false">HTML</a>
|
|
141
|
+
</li>
|
|
142
|
+
</ul>
|
|
143
|
+
<% if @email_message.eml %>
|
|
144
|
+
<div class="tab-content" id="myTabContent">
|
|
145
|
+
<div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">
|
|
146
|
+
<%= @email_message.eml.readable %>
|
|
147
|
+
</div>
|
|
148
|
+
<div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">
|
|
149
|
+
<%= Mail.new(@email_message.eml.raw_source).text_part.decoded if Mail.new(@email_message.eml.raw_source).text_part %>
|
|
150
|
+
</div>
|
|
151
|
+
<div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">
|
|
152
|
+
<% if Mail.new(@email_message.eml.raw_source).html_part == nil %>
|
|
153
|
+
<p style="margin-left:2%">No HTML content</p>
|
|
154
|
+
<% elsif @email_message.eml.html_safe == true %>
|
|
155
|
+
<%= Mail.new(@email_message.eml.raw_source).html_part.body.decoded.force_encoding('UTF-8').html_safe %>
|
|
156
|
+
<% else %>
|
|
157
|
+
<p style="margin-left:2%">Unsafe to render HTML</p>
|
|
158
|
+
<% end %>
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
<% end %>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
|