Skip to content

Commit 7c5b037

Browse files
author
Cody Martin
committed
v1.2 - MITRE ATT&CK v10, bug fixes, some new features implemented.
1 parent 39d1214 commit 7c5b037

File tree

10 files changed

+1258
-1075
lines changed

10 files changed

+1258
-1075
lines changed

Controllers/HomeController.cs

Lines changed: 31 additions & 937 deletions
Large diffs are not rendered by default.

FactorModels/Techniques.cs

Lines changed: 1048 additions & 72 deletions
Large diffs are not rendered by default.

FactorModels/ThreatSources.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public class ThreatSources
2121
{
2222
public List<string> sources { get; set; }
2323
public string nistDescription { get; set; }
24+
public string blsDescription { get; set; }
2425
public ThreatSources()
2526
{
2627
sources = new List<string>();
@@ -43,6 +44,13 @@ exploit the organization’s dependence on cyber
4344
and communications technologies, and the
4445
communications and information-handling capabilities
4546
provided by those technologies)";
47+
48+
blsDescription = @"When selecting your threat source, it is important to model
49+
the associated Capability, Intent, and Targeting characteristics in a way that is consistent
50+
across the entire scenario. Keep in mind that, in most cases, the threat source
51+
is not changing during the scenario. This means that the threat source's modeled characteristics
52+
should remain the same across each event. If you are unsure, refer to some of
53+
the templated threat sources for examples.";
4654
}
4755
}
4856
}

Views/Home/Diagram.cshtml

Lines changed: 69 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<!--<button onclick="window.history.back();">BACK</button>-->
2121
<button onclick="saveSvgAsPng(document.getElementById('theSVG'), '@Model.Name' + '.png');">SAVE <span class="material-icons-outlined">save</span></button>
2222
<button onclick="copyMarkdown()">MARKDOWN <span class="material-icons-outlined">content_paste</span></button>
23+
<button onclick="blackWhite()">BLACK<span class="material-icons-outlined">swap_horizontal_circle</span>WHITE</button>
2324
<style>
2425
2526
.link {
@@ -119,7 +120,8 @@
119120
var link = svg.selectAll(".link"),
120121
text = svg.selectAll(".text"),
121122
tspan = svg.selectAll(".tspan"),
122-
node = svg.selectAll(".node");
123+
node = svg.selectAll(".node"),
124+
rect = svg.selectAll(".rect");
123125
124126
d3.json("/graphs/graph.json", function (error, graph) {
125127
if (error) throw error;
@@ -155,6 +157,17 @@
155157
.on("dblclick", dblclick)
156158
.call(drag);
157159
160+
// Adding for text backgrounds
161+
rect = svg.selectAll(".node-group")
162+
.append("rect")
163+
.data(force.nodes())
164+
.attr("x", function (d) { return d.x; })
165+
.attr("y", function (d) { return d.y; })
166+
.attr("rx", 6)
167+
.attr("ry", 6)
168+
.style("fill", "#d2d2d2")
169+
.style("opacity", "0.9");
170+
// end
158171
159172
text = svg.selectAll(".node-group")
160173
.append("text")
@@ -166,6 +179,22 @@
166179
.attr("class", "node-title")
167180
.call(wrap, 200);
168181
182+
//Adding for text background
183+
svg.selectAll("text")
184+
.each(function (d) { d.bbox = this.getBBox(); });
185+
186+
const xMargin = 4;
187+
const yMargin = 2;
188+
svg.selectAll("rect")
189+
.data(force.nodes())
190+
.attr("width", d => d.bbox.width + 2 * xMargin)
191+
.attr("height", d => d.bbox.height + 2 * yMargin)
192+
.attr("class", "node-rects")
193+
.attr("transform", function (d) {
194+
return `translate(-${xMargin}, -${d.bbox.height * 0.8 + yMargin})`
195+
});
196+
// end
197+
169198
link_text = svg.selectAll(".link-group")
170199
.append("text")
171200
.data(force.links())
@@ -180,6 +209,7 @@
180209
else { return (d.target.y + (d.source.y - d.target.y) / 2); }
181210
}).attr("fill", "Black")
182211
.style("font", "bold 18px Arial")
212+
.attr("class", "link-numbers")
183213
.attr("dy", 20);
184214
});
185215
@@ -200,11 +230,11 @@
200230
.attr("y", function (d) { return d.y - 32; });
201231
202232
text.attr("x", function (d) { return d.x; })
203-
.attr("y", function (d) { return d.y + 50; });
233+
.attr("y", function (d) { return d.y + 55; });
204234
205235
svg.selectAll("tspan")
206236
.attr("x", function (d) { return d.x; })
207-
.attr("y", function (d) { return d.y + 50; });
237+
.attr("y", function (d) { return d.y + 55; });
208238
209239
link_text.attr("x", function (d) {
210240
if (d.target.x > d.source.x) { return (d.source.x + (d.target.x - d.source.x) / 2); }
@@ -214,6 +244,10 @@
214244
if (d.target.y > d.source.y) { return (d.source.y + (d.target.y - d.source.y) / 2); }
215245
else { return (d.target.y + (d.source.y - d.target.y) / 2); }
216246
});
247+
248+
svg.selectAll("rect")
249+
.attr("x", function (d) { return d.x - d.bbox.width/2; })
250+
.attr("y", function (d) { return d.y + 55 });
217251
}
218252
219253
function tick_alpha() {
@@ -311,6 +345,38 @@
311345
var content = table.innerHTML;
312346
navigator.clipboard.writeText(content);
313347
}
348+
349+
function blackWhite() {
350+
var titles = document.getElementsByClassName("node-title");
351+
for (i = 0; i < titles.length; i++) {
352+
if (titles[i].style.fill == "black") { titles[i].style.fill = "white"; }
353+
else if (titles[i].style.fill == "white") { titles[i].style.fill = "black"; }
354+
else { titles[i].style.fill = "white"; }
355+
}
356+
357+
var linkNumbers = document.getElementsByClassName("link-numbers");
358+
for (i = 0; i < linkNumbers.length; i++) {
359+
var color = linkNumbers[i].style.fill;
360+
if (color == "black") { linkNumbers[i].style.fill = "white"; }
361+
else if (color == "white") { linkNumbers[i].style.fill = "black"; }
362+
else { linkNumbers[i].style.fill = "white"; }
363+
}
364+
365+
var body = document.body;
366+
if (body.style.backgroundColor == "white") { body.style.backgroundColor = "black"; }
367+
else if (body.style.backgroundColor == "black") { body.style.backgroundColor = "white"; }
368+
else { body.style.backgroundColor = "black"; }
369+
370+
var rectangles = document.getElementsByClassName("node-rects");
371+
for (i = 0; i < rectangles.length; i++) {
372+
var color = rectangles[i].style.fill;
373+
alert(color);
374+
if (color == "rgb(210, 210, 210)") { rectangles[i].style.fill = "rgb(74, 74, 74)"; }
375+
else if (color == "rgb(74, 74, 74)") { rectangles[i].style.fill = "rgb(210, 210, 210)"; }
376+
else { rectangles[i].style.fill = "rgb(74, 74, 74)"; }
377+
}
378+
379+
}
314380
</script>
315381

316382
<pre id="markdown-table" style="display:none;">

Views/Home/EditEvent.cshtml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,8 @@
5555
}
5656
} }
5757
</select>
58-
</div>
5958

60-
<div class="form-group factor-container">
61-
<label for="capability-range">Attacker's Minimal Capability Required</label>
59+
<label style="padding-top:15px;" for="capability-range">Threat Source's Capability *</label>
6260
<svg data-toggle="modal" data-target="#capabilityInfoModal" width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-info-square" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
6361
<path fill-rule="evenodd" d="M14 1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z" />
6462
<path d="M8.93 6.588l-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588z" />
@@ -78,10 +76,8 @@
7876
<p class="ticks">9</p>
7977
<p class="ticks">VH</p>
8078
</div>
81-
</div>
8279

83-
<div class="form-group factor-container">
84-
<label for="intent-range">Attacker's Minimal Intent Required</label>
80+
<label style="padding-top:15px;" for="intent-range">Threat Source's Intent *</label>
8581
<svg data-toggle="modal" data-target="#intentInfoModal" width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-info-square" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
8682
<path fill-rule="evenodd" d="M14 1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z" />
8783
<path d="M8.93 6.588l-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588z" />
@@ -101,10 +97,8 @@
10197
<p class="ticks">9</p>
10298
<p class="ticks">VH</p>
10399
</div>
104-
</div>
105100

106-
<div class="form-group factor-container">
107-
<label for="targeting-range">Level of Targeting Required</label>
101+
<label style="padding-top:15px;" for="targeting-range">Threat Source's Targeting *</label>
108102
<svg data-toggle="modal" data-target="#targetingInfoModal" width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-info-square" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
109103
<path fill-rule="evenodd" d="M14 1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z" />
110104
<path d="M8.93 6.588l-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588z" />
@@ -124,8 +118,8 @@
124118
<p class="ticks">9</p>
125119
<p class="ticks">VH</p>
126120
</div>
121+
<div style="padding-top:15px;"><span style="font-weight:bold;">* NOTE:</span> These values should be consistent with the other events in this scenario.</div>
127122
</div>
128-
129123
<div class="form-group factor-container">
130124
<label for="relevance-list">Relevance to Findings</label>
131125
<svg data-toggle="modal" data-target="#relevanceInfoModal" width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-info-square" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
@@ -174,10 +168,8 @@
174168
<div class="form-group factor-container">
175169
<label for="vulnerability">Finding Reference</label>
176170
<textarea name="vulnerability" id="vulnerability" rows="2" class="form-control form-control-success text-light bg-dark" oninput="enabler()" placeholder="">@Model.stepList.First().Vulnerability</textarea>
177-
</div>
178-
179-
<div class="form-group factor-container">
180-
<label for="severity-and-pervasiveness-range">Vulnerability Severity</label>
171+
172+
<label style="padding-top:15px;" for="severity-and-pervasiveness-range">Vulnerability Severity</label>
181173
<svg data-toggle="modal" data-target="#severityInfoModal" width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-info-square" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
182174
<path fill-rule="evenodd" d="M14 1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z" />
183175
<path d="M8.93 6.588l-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588z" />
@@ -213,10 +205,8 @@
213205
<div class="form-group factor-container">
214206
<label for="vulnerability">Predisposing Condition</label>
215207
<textarea name="condition" id="condition" rows="2" class="form-control form-control-success text-light bg-dark" oninput="enabler()" placeholder="">@Model.stepList.First().Condition</textarea>
216-
</div>
217-
218-
<div class="form-group factor-container">
219-
<label for="pervasiveness-range">Pervasiveness of Predisposing Conditions</label>
208+
209+
<label style="padding-top:15px;" for="pervasiveness-range">Pervasiveness of Predisposing Conditions</label>
220210
<svg data-toggle="modal" data-target="#pervasivenessInfoModal" width="1em" height="1em" viewBox="0 0 16 16" class="bi bi-info-square" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
221211
<path fill-rule="evenodd" d="M14 1H2a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1zM2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2z" />
222212
<path d="M8.93 6.588l-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588z" />
@@ -718,10 +708,12 @@
718708
<table class="table table-dark table-bordered">
719709
<tr>
720710
<th>NIST 800-30 Description</th>
711+
<th>BLS Description</th>
721712
</tr>
722713
@{
723714
<tr>
724715
<td>@ViewBag.sources.nistDescription</td>
716+
<td>@ViewBag.sources.blsDescription</td>
725717
</tr>
726718
}
727719
</table>

0 commit comments

Comments
 (0)