active_stix 0.1.21 → 0.1.22
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 +4 -4
- data/app/assets/javascripts/active_stix/application.js +1 -0
- data/app/assets/stylesheets/active_stix/application.scss +3 -0
- data/app/controllers/active_stix/attack_patterns_controller.rb +2 -1
- data/app/controllers/active_stix/campaigns_controller.rb +7 -1
- data/app/helpers/active_stix/attack_patterns_helper.rb +17 -0
- data/app/models/active_stix/threat_actor.rb +8 -0
- data/app/views/active_stix/attack_patterns/show.html.erb +105 -122
- data/app/views/active_stix/campaigns/_form.html.erb +39 -19
- data/app/views/active_stix/campaigns/edit.html.erb +1 -4
- data/app/views/active_stix/campaigns/new.html.erb +1 -2
- data/app/views/active_stix/campaigns/show.html.erb +0 -3
- data/app/views/active_stix/email_messages/show.html.erb +2 -2
- data/app/views/active_stix/threat_actors/show.html.erb +49 -4
- data/app/views/layouts/active_stix/application.html.erb +0 -2
- data/config/routes.rb +3 -2
- data/lib/active_stix/engine.rb +2 -0
- data/lib/active_stix/version.rb +1 -1
- metadata +17 -33
- data/app/assets/stylesheets/active_stix/application.css +0 -15
- data/app/assets/stylesheets/active_stix/artifacts.css +0 -4
- data/app/assets/stylesheets/active_stix/attack_patterns.css +0 -4
- data/app/assets/stylesheets/active_stix/bcc_refs.css +0 -4
- data/app/assets/stylesheets/active_stix/bundled_objects.css +0 -4
- data/app/assets/stylesheets/active_stix/bundles.css +0 -4
- data/app/assets/stylesheets/active_stix/campaigns.css +0 -4
- data/app/assets/stylesheets/active_stix/course_of_actions.css +0 -4
- data/app/assets/stylesheets/active_stix/cyber_observables.css +0 -4
- data/app/assets/stylesheets/active_stix/email_messages.css +0 -4
- data/app/assets/stylesheets/active_stix/external_references.css +0 -4
- data/app/assets/stylesheets/active_stix/files.css +0 -4
- data/app/assets/stylesheets/active_stix/identities.css +0 -4
- data/app/assets/stylesheets/active_stix/indicator_labels.css +0 -4
- data/app/assets/stylesheets/active_stix/indicators.css +0 -4
- data/app/assets/stylesheets/active_stix/intrusion_sets.css +0 -4
- data/app/assets/stylesheets/active_stix/kill_chain_phases.css +0 -4
- data/app/assets/stylesheets/active_stix/kill_chains.css +0 -4
- data/app/assets/stylesheets/active_stix/malwares.css +0 -4
- data/app/assets/stylesheets/active_stix/marking_definitions.css +0 -4
- data/app/assets/stylesheets/active_stix/observed_data.css +0 -4
- data/app/assets/stylesheets/active_stix/open_vocabularies.css +0 -4
- data/app/assets/stylesheets/active_stix/phases.css +0 -4
- data/app/assets/stylesheets/active_stix/recipients.css +0 -4
- data/app/assets/stylesheets/active_stix/relationships.css +0 -4
- data/app/assets/stylesheets/active_stix/reports.css +0 -4
- data/app/assets/stylesheets/active_stix/threat_actors.css +0 -4
- data/app/assets/stylesheets/active_stix/tools.css +0 -4
- data/app/assets/stylesheets/active_stix/urls.css +0 -4
- data/app/assets/stylesheets/active_stix/users.css +0 -4
- data/app/assets/stylesheets/scaffold.css +0 -80
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1afeaea40eb5ee5e0ef0106e50c42a85e839b0cea193317fcc95ef55b0626f57
|
|
4
|
+
data.tar.gz: 1dd3682d8dad6ee976fb984cc1e59a652dba0902a4fa2c34ca44b0b21d5f0307
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d8ab3c50687d87fd208a81dd7451fbde39f8d731d3adb763177697f7ba4a3587481130f5280c3c0efa19fe108f021c4f2b7dc0b8d4e882fda69f55b6eb6824c1
|
|
7
|
+
data.tar.gz: 91f7d641b997b5bfdd4e97b204f97fd84b12f7706ef8b35a6d2fa54bc0ff37c946b10dc2de65939bfacad2a2b1e1c4777f0c6b7a8f1786c390ce6840d34e69a7
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
class ActiveStix::AttackPatternsController < ApplicationController
|
|
2
2
|
before_action :set_attack_pattern, only: [:show, :edit, :update, :destroy, :data]
|
|
3
|
+
|
|
3
4
|
def index
|
|
4
5
|
end
|
|
5
6
|
|
|
@@ -10,10 +11,10 @@ class ActiveStix::AttackPatternsController < ApplicationController
|
|
|
10
11
|
end
|
|
11
12
|
|
|
12
13
|
def show
|
|
13
|
-
#@attack_pattern = ActiveStix::AttackPattern.find(params[:id])
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
private
|
|
17
|
+
|
|
17
18
|
# Use callbacks to share common setup or constraints between actions.
|
|
18
19
|
def set_attack_pattern
|
|
19
20
|
@attack_pattern = ActiveStix::AttackPattern.find(params[:id])
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
class ActiveStix::CampaignsController < ApplicationController
|
|
2
2
|
before_action :set_stix_campaign, only: [:show, :edit, :update, :destroy]
|
|
3
|
+
before_action :set_threat_actor
|
|
3
4
|
|
|
4
5
|
# GET /stix/campaigns
|
|
5
6
|
# GET /stix/campaigns.json
|
|
@@ -28,7 +29,8 @@ class ActiveStix::CampaignsController < ApplicationController
|
|
|
28
29
|
|
|
29
30
|
respond_to do |format|
|
|
30
31
|
if @campaign.save
|
|
31
|
-
|
|
32
|
+
ActiveStix::Relationship.relate(@campaign, @threat_actor, "attributed-to")
|
|
33
|
+
format.html { redirect_to [@threat_actor, @campaign], notice: 'Campaign was successfully created.' }
|
|
32
34
|
format.json { render :show, status: :created, location: @campaign }
|
|
33
35
|
else
|
|
34
36
|
format.html { render :new }
|
|
@@ -67,6 +69,10 @@ class ActiveStix::CampaignsController < ApplicationController
|
|
|
67
69
|
@campaign = ActiveStix::Campaign.find(params[:id])
|
|
68
70
|
end
|
|
69
71
|
|
|
72
|
+
def set_threat_actor
|
|
73
|
+
@threat_actor = ActiveStix::ThreatActor.find(params[:threat_actor_id])
|
|
74
|
+
end
|
|
75
|
+
|
|
70
76
|
# Never trust parameters from the scary internet, only allow the white list through.
|
|
71
77
|
def stix_campaign_params
|
|
72
78
|
params.require(:campaign).permit(:name, :description, :first_seen, :last_seen, :objective)
|
|
@@ -1,4 +1,21 @@
|
|
|
1
1
|
module ActiveStix
|
|
2
2
|
module AttackPatternsHelper
|
|
3
|
+
|
|
4
|
+
def mitigation_description
|
|
5
|
+
mitigation = @attack_pattern.target_relationships.where("relationship_type='mitigates'").first
|
|
6
|
+
return unless mitigation
|
|
7
|
+
source = mitigation.source
|
|
8
|
+
return unless source
|
|
9
|
+
description = source.description
|
|
10
|
+
markdown.render(description).html_safe if description
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def detection_description
|
|
14
|
+
# detection = @attack_pattern.detections.first.description
|
|
15
|
+
# return unless detection
|
|
16
|
+
# description = detection.description || ""
|
|
17
|
+
# markdown.render(description).html_safe
|
|
18
|
+
""
|
|
19
|
+
end
|
|
3
20
|
end
|
|
4
21
|
end
|
|
@@ -28,6 +28,14 @@ class ActiveStix::ThreatActor < ApplicationRecord
|
|
|
28
28
|
intrusion_sets
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
+
def malwares
|
|
32
|
+
m = []
|
|
33
|
+
ActiveStix::Relationship.where(target: self, relationship_type: "attributed-to", source_type: "ActiveStix::Malware").each do |rel|
|
|
34
|
+
intrusion_sets << rel.source
|
|
35
|
+
end
|
|
36
|
+
intrusion_sets
|
|
37
|
+
end
|
|
38
|
+
|
|
31
39
|
def self.find_or_create_attribution(organization)
|
|
32
40
|
threat_actor = organization.threat_groups.first
|
|
33
41
|
if threat_actor.nil?
|
|
@@ -1,140 +1,123 @@
|
|
|
1
|
-
<
|
|
1
|
+
<div class="container-fluid">
|
|
2
|
+
<% markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, fenced_code_blocks: true) %>
|
|
2
3
|
|
|
3
|
-
<%
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
<br>
|
|
16
|
-
<br>
|
|
17
|
-
|
|
18
|
-
<strong style="color:black">Examples</strong>
|
|
19
|
-
<br>
|
|
20
|
-
<table style="margin-left:1%;border:1px solid black;color:black">
|
|
21
|
-
<tr bgcolor="#F0F0F0">
|
|
22
|
-
<th style="border:1px solid black">Name</th>
|
|
23
|
-
<th style="border:1px solid black">Description</th>
|
|
24
|
-
</tr>
|
|
4
|
+
<% if @attack_pattern.external_references.collect {|x| x.source_name}.include?("mitre-attack") %>
|
|
5
|
+
<div>
|
|
6
|
+
<div>
|
|
7
|
+
<h2><%= @attack_pattern.name %></h2>
|
|
8
|
+
<br>
|
|
9
|
+
<strong>Description:</strong>
|
|
10
|
+
<br>
|
|
11
|
+
<div>
|
|
12
|
+
<%= markdown.render(@attack_pattern.description).html_safe %>
|
|
13
|
+
</div>
|
|
14
|
+
<br>
|
|
15
|
+
<br>
|
|
25
16
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
<strong>Examples</strong>
|
|
18
|
+
<br>
|
|
19
|
+
<table>
|
|
29
20
|
<tr>
|
|
30
|
-
<
|
|
31
|
-
<
|
|
21
|
+
<th>Name</th>
|
|
22
|
+
<th>Description</th>
|
|
32
23
|
</tr>
|
|
33
|
-
<% end %>
|
|
34
|
-
</table>
|
|
35
|
-
<br>
|
|
36
|
-
<br>
|
|
37
|
-
|
|
38
|
-
<strong style="color:black">Mitigation:</strong>
|
|
39
|
-
<br>
|
|
40
|
-
<div style="margin-left:1%;color:black">
|
|
41
|
-
<%= markdown.render(@attack_pattern.target_relationships.where("relationship_type='mitigates'").first.source.description).html_safe %>
|
|
42
|
-
</div>
|
|
43
|
-
<br>
|
|
44
|
-
<br>
|
|
45
24
|
|
|
25
|
+
<% @attack_pattern.target_relationships.where("relationship_type = 'uses'").each do |rel| %>
|
|
26
|
+
<!-- make sure stix tools objects aren't included in the list -->
|
|
27
|
+
<% next if rel.source.name.include?("--") %>
|
|
28
|
+
<tr>
|
|
29
|
+
<td> <%= rel.source.name %> </td>
|
|
30
|
+
<td> <%= markdown.render(rel.description).html_safe if rel.description %></td>
|
|
31
|
+
</tr>
|
|
32
|
+
<% end %>
|
|
33
|
+
</table>
|
|
34
|
+
<br>
|
|
35
|
+
<br>
|
|
46
36
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
37
|
+
<strong>Mitigation:</strong>
|
|
38
|
+
<br>
|
|
39
|
+
<div>
|
|
40
|
+
<%= mitigation_description %>
|
|
41
|
+
</div>
|
|
42
|
+
<br>
|
|
43
|
+
<br>
|
|
54
44
|
|
|
55
|
-
<div style="position:absolute;top:150px;right:100px;width:300px;height:400px;border:1px solid black;padding:10px;color:black">
|
|
56
|
-
<strong>ID:</strong>
|
|
57
|
-
<%= @attack_pattern.external_references.find_by("source_name = 'mitre-attack'").external_id %>
|
|
58
|
-
<br>
|
|
59
|
-
<Strong>Tactic:</Strong>
|
|
60
|
-
<%= @attack_pattern.phases.first.name %>
|
|
61
|
-
<br>
|
|
62
|
-
<Strong>Platform:</Strong>
|
|
63
|
-
<% platform_array = [] %>
|
|
64
|
-
<% @attack_pattern.platforms.each do | plat | %>
|
|
65
|
-
<% platform_array << plat.platform %>
|
|
66
|
-
<% end %>
|
|
67
|
-
<%= platform_array.join(", ") %>
|
|
68
45
|
|
|
46
|
+
<strong>Detection:</strong>
|
|
47
|
+
<br>
|
|
48
|
+
<div>
|
|
49
|
+
<%= detection_description %>
|
|
50
|
+
</div>
|
|
51
|
+
<br>
|
|
69
52
|
<br>
|
|
70
|
-
<Strong>Permissions Required:</Strong>
|
|
71
|
-
<% perm_array = [] %>
|
|
72
|
-
<% @attack_pattern.permissions_requireds.each do | perm | %>
|
|
73
|
-
<% perm_array << perm.permission %>
|
|
74
|
-
<% end %>
|
|
75
|
-
<%= perm_array.join(", ") %>
|
|
76
|
-
<br>
|
|
77
|
-
<Strong>Data Sources:</Strong>
|
|
78
|
-
<% src_array = [] %>
|
|
79
|
-
<% platform_array = [] %>
|
|
80
|
-
<% @attack_pattern.data_sources.each do | src | %>
|
|
81
|
-
<% src_array << src.source %>
|
|
82
|
-
<% end %>
|
|
83
|
-
<%= src_array.join(", ") %>
|
|
84
|
-
<br>
|
|
85
|
-
<Strong>Version:</Strong>
|
|
86
|
-
<%= @attack_pattern.versions.first.version %>
|
|
87
53
|
|
|
54
|
+
<div>
|
|
55
|
+
<strong>ID:</strong>
|
|
56
|
+
<%= @attack_pattern.external_references.find_by("source_name = 'mitre-attack'").external_id %>
|
|
57
|
+
<br>
|
|
58
|
+
<Strong>Tactic:</Strong>
|
|
59
|
+
<%= @attack_pattern.phases.first.name %>
|
|
60
|
+
<br>
|
|
61
|
+
<Strong>Platform:</Strong>
|
|
62
|
+
|
|
63
|
+
<br>
|
|
64
|
+
<Strong>Permissions Required:</Strong>
|
|
65
|
+
<br>
|
|
66
|
+
<Strong>Data Sources:</Strong>
|
|
67
|
+
|
|
68
|
+
</div>
|
|
88
69
|
</div>
|
|
89
70
|
</div>
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
<br>
|
|
109
|
-
<div style="margin-left:1%">
|
|
110
|
-
<strong>Explanation:</strong> <%= @attack_pattern.detectable_by_common_defenses_explanations.first.explanation %>
|
|
111
|
-
</div>
|
|
112
|
-
|
|
113
|
-
<br>
|
|
114
|
-
<strong>Difficulty for the Adversary:</strong>
|
|
115
|
-
<div style="margin-left:1%;">
|
|
116
|
-
<strong>Easy for the Adversary (Yes/No):</strong> <%= @attack_pattern.difficulty_for_adversaries.first.difficulty %>
|
|
117
|
-
</div>
|
|
118
|
-
|
|
119
|
-
<br>
|
|
120
|
-
<div style="margin-left:1%">
|
|
121
|
-
<strong>Explanation:</strong> <%= @attack_pattern.difficulty_for_adversary_explanations.first.explanation %>
|
|
122
|
-
</div>
|
|
71
|
+
<% elsif @attack_pattern.external_references.collect {|x| x.source_name}.include?("mitre-pre-attack") %>
|
|
72
|
+
<div>
|
|
73
|
+
<div>
|
|
74
|
+
<h2><%= @attack_pattern.name %></h2>
|
|
75
|
+
<br>
|
|
76
|
+
<strong>Description:</strong>
|
|
77
|
+
<br>
|
|
78
|
+
<div>
|
|
79
|
+
<%= markdown.render(@attack_pattern.description).html_safe %>
|
|
80
|
+
</div>
|
|
81
|
+
<br>
|
|
82
|
+
<strong>Detection:</strong>
|
|
83
|
+
<br>
|
|
84
|
+
<div>
|
|
85
|
+
<strong>Detectable by Common Defenses
|
|
86
|
+
(Yes/No/Partial):</strong> <%= @attack_pattern.detectable_by_common_defenses.first.detectable %>
|
|
87
|
+
</div>
|
|
123
88
|
|
|
124
|
-
<div style="position:absolute;top:150px;right:100px;width:300px;height:300px;border:1px solid black;padding:10px;color:black">
|
|
125
|
-
<strong>ID:</strong>
|
|
126
|
-
<%= @attack_pattern.external_references.find_by("source_name = 'mitre-pre-attack'").external_id %>
|
|
127
89
|
<br>
|
|
128
|
-
<
|
|
129
|
-
|
|
90
|
+
<div>
|
|
91
|
+
<strong>Explanation:</strong> <%= @attack_pattern.detectable_by_common_defenses_explanations.first.explanation %>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
130
94
|
<br>
|
|
131
|
-
<
|
|
132
|
-
|
|
95
|
+
<strong>Difficulty for the Adversary:</strong>
|
|
96
|
+
<div>
|
|
97
|
+
<strong>Easy for the Adversary
|
|
98
|
+
(Yes/No):</strong> <%= @attack_pattern.difficulty_for_adversaries.first.difficulty %>
|
|
99
|
+
</div>
|
|
133
100
|
|
|
101
|
+
<br>
|
|
102
|
+
<div>
|
|
103
|
+
<strong>Explanation:</strong> <%= @attack_pattern.difficulty_for_adversary_explanations.first.explanation %>
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<div>
|
|
107
|
+
<strong>ID:</strong>
|
|
108
|
+
<%= @attack_pattern.external_references.find_by("source_name = 'mitre-pre-attack'").external_id %>
|
|
109
|
+
<br>
|
|
110
|
+
<Strong>Tactic:</Strong>
|
|
111
|
+
<%= @attack_pattern.phases.first.name %>
|
|
112
|
+
<br>
|
|
113
|
+
<Strong>Version:</Strong>
|
|
114
|
+
<%= @attack_pattern.versions.first.version %>
|
|
115
|
+
|
|
116
|
+
</div>
|
|
134
117
|
</div>
|
|
135
|
-
</div>
|
|
136
118
|
|
|
137
|
-
|
|
138
|
-
<% else %>
|
|
139
|
-
|
|
140
|
-
<% end %>
|
|
119
|
+
</div>
|
|
120
|
+
<% else %>
|
|
121
|
+
<%= "Error" %>
|
|
122
|
+
<% end %>
|
|
123
|
+
</div>
|
|
@@ -1,39 +1,59 @@
|
|
|
1
|
-
<%= form_with(model: campaign, local: true) do |form| %>
|
|
1
|
+
<%= form_with(model: campaign, url: stix.threat_actor_campaigns_path(threat_actor, campaign), local: true) do |form| %>
|
|
2
2
|
<% if campaign.errors.any? %>
|
|
3
3
|
<div id="error_explanation">
|
|
4
4
|
<h2><%= pluralize(campaign.errors.count, "error") %> prohibited this campaign from being saved:</h2>
|
|
5
5
|
|
|
6
6
|
<ul>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
<% campaign.errors.full_messages.each do |message| %>
|
|
8
|
+
<li><%= message %></li>
|
|
9
|
+
<% end %>
|
|
10
10
|
</ul>
|
|
11
11
|
</div>
|
|
12
12
|
<% end %>
|
|
13
13
|
|
|
14
|
-
<div class="
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
<div class="form-group row">
|
|
15
|
+
<div class="field">
|
|
16
|
+
<%= form.label :name, class: "col-sm-2 col-form-label" %>
|
|
17
|
+
<div class="col-sm-10">
|
|
18
|
+
<%= form.text_field :name, class: "form-control" %>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
17
21
|
</div>
|
|
18
22
|
|
|
19
|
-
<div class="
|
|
20
|
-
|
|
21
|
-
|
|
23
|
+
<div class="form-group row">
|
|
24
|
+
<div class="field">
|
|
25
|
+
<%= form.label :description, class: "col-sm-2 col-form-label" %>
|
|
26
|
+
<div class="col-sm-10">
|
|
27
|
+
<%= form.text_field :description, class: "form-control" %>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
22
30
|
</div>
|
|
23
31
|
|
|
24
|
-
<div class="
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
<div class="form-group row">
|
|
33
|
+
<div class="field">
|
|
34
|
+
<%= form.label :first_seen, class: "col-sm-2 col-form-label" %>
|
|
35
|
+
<div class="col-sm-10">
|
|
36
|
+
<%= form.text_field :first_seen, "data-provide" => 'datepicker' %>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
27
39
|
</div>
|
|
28
40
|
|
|
29
|
-
<div class="
|
|
30
|
-
|
|
31
|
-
|
|
41
|
+
<div class="form-group row">
|
|
42
|
+
<div class="field">
|
|
43
|
+
<%= form.label :last_seen, class: "col-sm-2 col-form-label" %>
|
|
44
|
+
<div class="col-sm-10">
|
|
45
|
+
<%= form.text_field :last_seen, "data-provide" => 'datepicker' %>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
32
48
|
</div>
|
|
33
49
|
|
|
34
|
-
<div class="
|
|
35
|
-
|
|
36
|
-
|
|
50
|
+
<div class="form-group row">
|
|
51
|
+
<div class="field">
|
|
52
|
+
<%= form.label :objective, class: "col-sm-2 col-form-label" %>
|
|
53
|
+
<div class="col-sm-10">
|
|
54
|
+
<%= form.text_field :objective, class: "form-control" %>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
37
57
|
</div>
|
|
38
58
|
|
|
39
59
|
<div class="actions">
|
|
@@ -150,11 +150,11 @@
|
|
|
150
150
|
</div>
|
|
151
151
|
<div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">
|
|
152
152
|
<% if Mail.new(@email_message.eml.raw_source).html_part == nil %>
|
|
153
|
-
<p
|
|
153
|
+
<p>No HTML content</p>
|
|
154
154
|
<% elsif @email_message.eml.html_safe == true %>
|
|
155
155
|
<%= Mail.new(@email_message.eml.raw_source).html_part.body.decoded.force_encoding('UTF-8').html_safe %>
|
|
156
156
|
<% else %>
|
|
157
|
-
<p
|
|
157
|
+
<p>Unsafe to render HTML</p>
|
|
158
158
|
<% end %>
|
|
159
159
|
</div>
|
|
160
160
|
</div>
|
|
@@ -1,4 +1,49 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<div class="page-content page-container" id="page-content">
|
|
2
|
+
<div class="padding">
|
|
3
|
+
<div class="row container d-flex justify-content-center">
|
|
4
|
+
<div class="col-md-12">
|
|
5
|
+
<div class="card">
|
|
6
|
+
<div class="card-body text-center">
|
|
7
|
+
<div>
|
|
8
|
+
<img src="https://img.icons8.com/bubbles/100/000000/administrator-male.png" class="img-lg rounded-circle mb-4" alt="profile image">
|
|
9
|
+
<h4><%= @threat_actor.name %></h4>
|
|
10
|
+
<p class="text-muted mb-0"><%= @threat_actor.description %></p>
|
|
11
|
+
</div>
|
|
12
|
+
<%= link_to "See dossier", active_attack.playbook_path(@threat_actor.id), class: "btn btn-info btn-sm mt-3 mb-4" %>
|
|
13
|
+
<div class="border-top pt-3">
|
|
14
|
+
<div class="row">
|
|
15
|
+
<div class="col-4">
|
|
16
|
+
<h6>
|
|
17
|
+
Campaigns
|
|
18
|
+
<%= link_to stix.new_threat_actor_campaign_path(@threat_actor), class: "d-flex align-items-center text-muted", "aria-label" => "Add a new report" do %>
|
|
19
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus-circle">
|
|
20
|
+
<circle cx="12" cy="12" r="10"></circle>
|
|
21
|
+
<line x1="12" y1="8" x2="12" y2="16"></line>
|
|
22
|
+
<line x1="8" y1="12" x2="16" y2="12"></line>
|
|
23
|
+
</svg>
|
|
24
|
+
<% end %>
|
|
25
|
+
</h6>
|
|
26
|
+
<% @threat_actor.campaigns.each do |campaign| %>
|
|
27
|
+
<%= link_to stix.edit_threat_actor_campaign_path(@threat_actor, campaign) do %>
|
|
28
|
+
<div class="row">
|
|
29
|
+
<%= campaign.name %><%= octicon "pencil" %>
|
|
30
|
+
<% end %>
|
|
31
|
+
</div>
|
|
32
|
+
<% end %>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="col-4">
|
|
35
|
+
<h6><%= @threat_actor.malwares.count %></h6>
|
|
36
|
+
<p>Malwares</p>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="col-4">
|
|
39
|
+
<h6><%= @threat_actor.intrusion_sets.count %></h6>
|
|
40
|
+
<p>Intrusion Sets</p>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
data/config/routes.rb
CHANGED
|
@@ -5,7 +5,9 @@ ActiveStix::Engine.routes.draw do
|
|
|
5
5
|
resources :users
|
|
6
6
|
resources :urls
|
|
7
7
|
resources :tools
|
|
8
|
-
resources :threat_actors
|
|
8
|
+
resources :threat_actors do
|
|
9
|
+
resources :campaigns
|
|
10
|
+
end
|
|
9
11
|
resources :reports
|
|
10
12
|
resources :relationships
|
|
11
13
|
resources :recipients
|
|
@@ -33,7 +35,6 @@ ActiveStix::Engine.routes.draw do
|
|
|
33
35
|
resources :email_messages
|
|
34
36
|
resources :cyber_observables
|
|
35
37
|
resources :course_of_actions
|
|
36
|
-
resources :campaigns
|
|
37
38
|
resources :bundles
|
|
38
39
|
resources :bundled_objects
|
|
39
40
|
end
|
data/lib/active_stix/engine.rb
CHANGED
data/lib/active_stix/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: active_stix
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.22
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adam Dalton
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-04-
|
|
11
|
+
date: 2020-04-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -24,6 +24,20 @@ dependencies:
|
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: 6.0.2
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: redcarpet
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: 3.5.0
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: 3.5.0
|
|
27
41
|
- !ruby/object:Gem::Dependency
|
|
28
42
|
name: pg
|
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -79,37 +93,7 @@ files:
|
|
|
79
93
|
- app/assets/javascripts/active_stix/tools.js
|
|
80
94
|
- app/assets/javascripts/active_stix/urls.js
|
|
81
95
|
- app/assets/javascripts/active_stix/users.js
|
|
82
|
-
- app/assets/stylesheets/active_stix/application.
|
|
83
|
-
- app/assets/stylesheets/active_stix/artifacts.css
|
|
84
|
-
- app/assets/stylesheets/active_stix/attack_patterns.css
|
|
85
|
-
- app/assets/stylesheets/active_stix/bcc_refs.css
|
|
86
|
-
- app/assets/stylesheets/active_stix/bundled_objects.css
|
|
87
|
-
- app/assets/stylesheets/active_stix/bundles.css
|
|
88
|
-
- app/assets/stylesheets/active_stix/campaigns.css
|
|
89
|
-
- app/assets/stylesheets/active_stix/course_of_actions.css
|
|
90
|
-
- app/assets/stylesheets/active_stix/cyber_observables.css
|
|
91
|
-
- app/assets/stylesheets/active_stix/email_messages.css
|
|
92
|
-
- app/assets/stylesheets/active_stix/external_references.css
|
|
93
|
-
- app/assets/stylesheets/active_stix/files.css
|
|
94
|
-
- app/assets/stylesheets/active_stix/identities.css
|
|
95
|
-
- app/assets/stylesheets/active_stix/indicator_labels.css
|
|
96
|
-
- app/assets/stylesheets/active_stix/indicators.css
|
|
97
|
-
- app/assets/stylesheets/active_stix/intrusion_sets.css
|
|
98
|
-
- app/assets/stylesheets/active_stix/kill_chain_phases.css
|
|
99
|
-
- app/assets/stylesheets/active_stix/kill_chains.css
|
|
100
|
-
- app/assets/stylesheets/active_stix/malwares.css
|
|
101
|
-
- app/assets/stylesheets/active_stix/marking_definitions.css
|
|
102
|
-
- app/assets/stylesheets/active_stix/observed_data.css
|
|
103
|
-
- app/assets/stylesheets/active_stix/open_vocabularies.css
|
|
104
|
-
- app/assets/stylesheets/active_stix/phases.css
|
|
105
|
-
- app/assets/stylesheets/active_stix/recipients.css
|
|
106
|
-
- app/assets/stylesheets/active_stix/relationships.css
|
|
107
|
-
- app/assets/stylesheets/active_stix/reports.css
|
|
108
|
-
- app/assets/stylesheets/active_stix/threat_actors.css
|
|
109
|
-
- app/assets/stylesheets/active_stix/tools.css
|
|
110
|
-
- app/assets/stylesheets/active_stix/urls.css
|
|
111
|
-
- app/assets/stylesheets/active_stix/users.css
|
|
112
|
-
- app/assets/stylesheets/scaffold.css
|
|
96
|
+
- app/assets/stylesheets/active_stix/application.scss
|
|
113
97
|
- app/controllers/active_stix/application_controller.rb
|
|
114
98
|
- app/controllers/active_stix/artifacts_controller.rb
|
|
115
99
|
- app/controllers/active_stix/attack_patterns_controller.rb
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
|
3
|
-
* listed below.
|
|
4
|
-
*
|
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
|
6
|
-
* or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
|
|
7
|
-
*
|
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
|
|
10
|
-
* files in this directory. Styles in this file should be added after the last require_* statement.
|
|
11
|
-
* It is generally better to create a new file per style scope.
|
|
12
|
-
*
|
|
13
|
-
*= require_tree .
|
|
14
|
-
*= require_self
|
|
15
|
-
*/
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
body {
|
|
2
|
-
background-color: #fff;
|
|
3
|
-
color: #333;
|
|
4
|
-
margin: 33px;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
body, p, ol, ul, td {
|
|
8
|
-
font-family: verdana, arial, helvetica, sans-serif;
|
|
9
|
-
font-size: 13px;
|
|
10
|
-
line-height: 18px;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
pre {
|
|
14
|
-
background-color: #eee;
|
|
15
|
-
padding: 10px;
|
|
16
|
-
font-size: 11px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
a {
|
|
20
|
-
color: #000;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
a:visited {
|
|
24
|
-
color: #666;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
a:hover {
|
|
28
|
-
color: #fff;
|
|
29
|
-
background-color: #000;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
th {
|
|
33
|
-
padding-bottom: 5px;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
td {
|
|
37
|
-
padding: 0 5px 7px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
div.field,
|
|
41
|
-
div.actions {
|
|
42
|
-
margin-bottom: 10px;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
#notice {
|
|
46
|
-
color: green;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.field_with_errors {
|
|
50
|
-
padding: 2px;
|
|
51
|
-
background-color: red;
|
|
52
|
-
display: table;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
#error_explanation {
|
|
56
|
-
width: 450px;
|
|
57
|
-
border: 2px solid red;
|
|
58
|
-
padding: 7px 7px 0;
|
|
59
|
-
margin-bottom: 20px;
|
|
60
|
-
background-color: #f0f0f0;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
#error_explanation h2 {
|
|
64
|
-
text-align: left;
|
|
65
|
-
font-weight: bold;
|
|
66
|
-
padding: 5px 5px 5px 15px;
|
|
67
|
-
font-size: 12px;
|
|
68
|
-
margin: -7px -7px 0;
|
|
69
|
-
background-color: #c00;
|
|
70
|
-
color: #fff;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
#error_explanation ul li {
|
|
74
|
-
font-size: 12px;
|
|
75
|
-
list-style: square;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
label {
|
|
79
|
-
display: block;
|
|
80
|
-
}
|