Skip to content

Commit 2f08c37

Browse files
committed
Merge branch 'feature/#191-add-versioning-to-tour' into feature/subtechniques-2.1
2 parents 86034fb + 8df94aa commit 2f08c37

36 files changed

+728
-96
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ env
66
__pycache__/
77
modules/__pycache__/*
88

9-
attack-archives/
9+
attack-versions/
1010
output/
1111
reports/
1212

@@ -23,7 +23,7 @@ content/pages/resources/changelog.md
2323
content/pages/resources/contribute.md
2424
content/pages/resources/resources.md
2525
content/pages/resources/attackcon.md
26-
content/pages/resources/previous.md
26+
content/pages/resources/versions.md
2727
content/pages/resources/faq.md
2828
content/pages/resources/training.md
2929
content/pages/resources/training_cti.md

CHANGELOG.md

+23
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333

3434
# Sub-techniques Beta
3535
## ATT&CK Website version 2.1.1
36+
### Improvements
37+
- Improved matrix page header layout with versioning feature. See issue [#190](https://github.com/mitre-attack/attack-website/issues/190).
38+
- Added versioning feature to [tour](https://attack.mitre.org/?tour=true). See issue [#191](https://github.com/mitre-attack/attack-website/issues/191).
3639
### Fixes
3740
- Fixed number of tactics displayed on tactics overview pages. See issue [#183](https://github.com/mitre-attack/attack-website/issues/183).
3841
- Fixed objects without descriptions not showing up on techniques used tables. See issue [#186](https://github.com/mitre-attack/attack-website/issues/186).
@@ -90,6 +93,26 @@
9093

9194
## [ATT&CK Content version 7.0-beta](https://github.com/mitre/cti/tree/4d3f22d81af2424f3885b4390793ee8eb256d10d)
9295
See release notes [here](https://attack.mitre.org/beta/resources/updates/updates-march-2020/index.html).
96+
# 10 June 2020
97+
## ATT&CK Website version 1.3
98+
This update includes a major refactor of the ATT&CK catalog versioning system, previously referred to as "previous versions."
99+
100+
- Versions have been moved from `/previous/monthYear` to `/versions/v#` which should be more predictable and consistent with the way the versions are referred to elsewhere. Redirects have been created so that users who bookmarked the old URLs will get sent to the new ones. See issue [#174](https://github.com/mitre-attack/attack-website/issues/174).
101+
- Added a permalink to the current version of the site. See issue [#175](https://github.com/mitre-attack/attack-website/issues/175).
102+
- Current version is preserved alongside other versions in `/versions/`.
103+
- Object pages on the live website now have a "version permalink" leading to a frozen version of that page.
104+
- Permalink and previous versions now have a "live version" link leading to the most recent version of that page.
105+
- Revised the version list. Find the new version list on the [Versions of ATT&CK page](https://attack.mitre.org/resources/versions), which replaced the "previous versions" page.
106+
- Now formatted as an easy to read table.
107+
- Added links to the data on [MITRE/CTI](https://github.com/mitre/cti) for each version.
108+
- Revised blurb on how versions work to explain our methodology behind the catalog version numbers and versioning system.
109+
- Updated past release notes to mention the version number for each release.
110+
111+
# 31 March 2020
112+
The sub-techniques beta is <a href='https://attack.mitre.org/beta/' target='_blank'>now live</a>! Read the <a target='_blank' href='https://medium.com/mitre-attack/attack-subs-what-you-need-to-know-99bce414ae0b'>release blog post</a> for more details. Check out the [beta changelog](https://attack.mitre.org/beta/resources/changelog.html) for the full list of website changes.
113+
### Changes
114+
- Added sub-techniques release announcement banner.
115+
- Added sub-techniques release docs
93116

94117
# 17 June 2020
95118
## ATT&CK Website version 1.3.1

README.md

-5
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ _See [CONTRIBUTING.md](/CONTRIBUTING.md) for more information on making contribu
4848

4949
The ATT&CK site uses a combination of Python, Pelican and Jinja to convert the STIX content into a set of static HTML files. When `update-attack.py` is run, it generates a set of markdown files in `content` containing the parsed STIX content. Pelican then reads these markdown files and uses them to with the Jinja templates in `attack-theme/templates` to build the site HTML in the output directory.
5050

51-
### ATT&CK Archives
52-
53-
The previous-versions feature, built to `/resources/previous-versions/` and `/previous/`, is used to display older versions of the ATT&CK site. This feature is reliant on the [attack-archives](https://github.com/mitre-attack/attack-archives/issues) repository, which stores the archived versions and also provides the functionality to preserve the current site
54-
in the archive. For more information on how the previous-version system works, please see the [attack-archives repository on github](https://github.com/mitre-attack/attack-archives/issues) or the [archives module](/modules/archives.py).
55-
5651
## Building the site with custom content
5752

5853
The ATT&CK Website is designed support an evolving knowledge base. The content seen on the site is generated from data in STIX2.0 JSON format. The data used on the live site at [attack.mitre.org](https://attack.mitre.org) can be found on our [mitre/cti](https://github.com/mitre/cti) github repo.

attack-theme/static/scripts/tour/tour-relationships.js

+2-14
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,9 @@ if (isSiteTour && tour_steps['relationships']['step3'] != 'undefined') tourSteps
3434
content: "In cases where a sub-technique exists in the table but not the parent technique, the parent technique row is omitted entirely."
3535
})
3636

37-
let lastStepReached = false;
38-
3937
if (isSiteTour) tourSteps.push({
40-
orphan: true,
41-
backdrop: false,
42-
title: "End of tour",
43-
content: "We hope you have enjoyed this tour of the sub-techniques features of the ATT&CK website. If you have any feedback or suggestions, please visit <a href='" + base_url + "contact'>the contact page</a> to get in touch.",
44-
onShow: function() {
45-
lastStepReached = true;
46-
},
47-
onNext: function() {
48-
window.location.href = base_url;
38+
onShow: function() { //go to the next tour module
39+
window.location.href = base_url + "resources/versions/?tour=true"
4940
}
5041
})
5142

@@ -57,9 +48,6 @@ let tour = new Tour({
5748
framework: 'bootstrap4', // set Tourist to use BS4 compatibility
5849
showProgressBar: !isSiteTour,
5950
showProgressText: !isSiteTour,
60-
onEnd: function() {
61-
if (lastStepReached) window.location.href = base_url;
62-
}
6351
})
6452

6553
function start_tour() {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
//is the user doing a tour of the entire site, or just this module?
2+
isSiteTour = window.location.href.includes("?tour=true");
3+
4+
let lastStepReached = false;
5+
6+
let tourSteps = [
7+
{
8+
orphan: true,
9+
backdrop: false,
10+
title: "Versions of ATT&CK",
11+
content: "Versions of the ATT&CK website are preserved on this page."
12+
},
13+
{
14+
element: "#version-column",
15+
placement: "top",
16+
backdrop: false,
17+
title: "Versions of ATT&CK - Version",
18+
content: "You can view the current and past versions of the website by clicking on the links under the \"Version\" column."
19+
},
20+
{
21+
element: "#data-column",
22+
placement: "top",
23+
backdrop: false,
24+
title: "Versions of ATT&CK - Data",
25+
content: "The STIX data for each version is found under the \"Data\" column."
26+
},
27+
{
28+
element: "#release-notes-column",
29+
placement: "top",
30+
backdrop: false,
31+
title: "Versions of ATT&CK - Release Notes",
32+
content: "Each major release is accompanied with release notes that detail the changes."
33+
},
34+
{
35+
orphan: true,
36+
backdrop: false,
37+
title: "Versions of ATT&CK",
38+
content: "All object pages now include a \"Version Permalink\". Future updates to ATT&CK won't affect the permalinked page. To return to the live version of the object, click the \"Live Version\" link."
39+
},
40+
{
41+
orphan: true,
42+
backdrop: false,
43+
title: "End of tour",
44+
content: "We hope you have enjoyed this tour of the sub-techniques features of the ATT&CK website. If you have any feedback or suggestions, please visit <a href='" + base_url + "contact'>the contact page</a> to get in touch.",
45+
onShow: function() {
46+
lastStepReached = true;
47+
},
48+
onNext: function() {
49+
window.location.href = base_url;
50+
}
51+
}
52+
]
53+
54+
let tour = new Tour({
55+
steps: tourSteps,
56+
storage: false, //no resuming tour if the page is reloaded.
57+
framework: 'bootstrap4', // set Tourist to use BS4 compatibility
58+
showProgressBar: !isSiteTour,
59+
showProgressText: !isSiteTour,
60+
onEnd: function() {
61+
if (lastStepReached) window.location.href = base_url;
62+
}
63+
})
64+
65+
function start_tour() {
66+
if (tour.ended()) tour.restart();
67+
else tour.start(true);
68+
}
69+
70+
if (isSiteTour) {
71+
start_tour();
72+
}

attack-theme/static/style/_layouts.scss

+11-5
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,15 @@ a {
179179
/******/
180180

181181
/*Table styling*/
182-
.table {
182+
.table, .blog-post table {
183183
empty-cells: hide;
184184

185185
td {
186186
p:last-child {
187187
margin-bottom: 0;
188188
}
189+
padding: .75rem;
190+
vertical-align: top;
189191
}
190192
th {
191193
padding: rem(0.3);
@@ -198,8 +200,12 @@ a {
198200
}
199201
}
200202

203+
.blog-post table {
204+
margin-bottom: 1.5rem;
205+
}
206+
201207
// background color for tables in TACTICS, TECHNIQUES, MITIGATIONS, GROUPS, and SOFTWARE
202-
.table-alternate {
208+
.table-alternate, .blog-post table {
203209
@extend .bg-alternate;
204210
tbody {
205211
background: color(body);
@@ -284,12 +290,12 @@ a {
284290
// border-color: on-color-deemphasis(body);
285291
// }
286292

287-
.table-bordered {
293+
.table-bordered, .blog-post table {
288294
&, & td, & th {
289-
border-color: border-color(body);
295+
border: 1px solid border-color(body);
290296
}
291297
th {
292-
border-bottom-color: border-color(body) !important;
298+
border-bottom: 2px solid border-color(body) !important;
293299
}
294300
}
295301

attack-theme/static/style/_matrix.scss

+7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
margin-top: to-rem(16);
99
}
1010

11+
.matrix-border {
12+
border-left: 1px solid border-color(body);
13+
padding-left: 0.5rem;
14+
}
15+
1116
.matrix-title {
1217
border-bottom: 1px solid border-color(body);
1318
margin-bottom: 1rem;
@@ -275,6 +280,8 @@ $sizeunit: 14px;
275280

276281

277282
.matrix-controls {
283+
margin: auto;
284+
width: 50%;
278285
padding: 1rem;
279286

280287
button {
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@import "_misc.scss";
2+
3+
.version-button {
4+
// hide the option not in use
5+
&.permalink .live {
6+
display: none;
7+
}
8+
&.live .permalink {
9+
display: none;
10+
}
11+
}
12+
.version-table .table-break-row {
13+
border-right-color: color(body);
14+
border-left-color: color(body);
15+
padding: 1rem 0;
16+
}

attack-theme/static/style/style.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@import "_colors.scss", "_misc.scss", "_nav.scss", "_footer.scss", "_fonts.scss", "_layouts.scss", "_matrix.scss", "_search.scss", "_tour.scss";
1+
@import "_colors.scss", "_matrix.scss", "_misc.scss", "_nav.scss", "_footer.scss", "_fonts.scss", "_layouts.scss", "_search.scss", "_versioning.scss", "_tour.scss";

attack-theme/templates/general/base.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{% set BANNER_MESSAGE = "You are currently viewing the sub-techniques beta. <a href='/?tour=true'>Take a tour</a>, read the <a href='https://medium.com/mitre-attack/attack-subs-what-you-need-to-know-99bce414ae0b'>blog post</a> or <a href='/resources/updates/updates-march-2020'> release notes</a>, or see the <a href='/'>non-beta version of the site</a>." %}
33
{% set NAVIGATION_MENU = [['/matrices/', 'matrices', 'Matrices'], ['/tactics/', 'tactics', 'Tactics'], ['/techniques/', 'techniques', 'Techniques'], ['/mitigations/', 'mitigations', 'Mitigations'], ['/groups/', 'groups', 'Groups'], ['/software/', 'software', 'Software'], ['/resources/', 'resources', 'Resources'], ['https://medium.com/mitre-attack/', 'blog', 'Blog'], ['/resources/contribute', 'contribute', 'Contribute']] -%}
44
{% set DOMAINS = [['PRE-ATT&CK', 'pre'], ['Enterprise', 'enterprise'], ['Mobile', 'mobile']] -%}
5-
{% set CONTENT_VERSION = "7.0-beta" -%}
5+
{% set CONTENT_VERSION = "7.0" -%}
66
{% set WEBSITE_VERSION = "2.1.1" -%}
77
{% set CHANGELOG_LOCATION = "/resources/changelog.html" -%}
88
{% set LOGO_HEADER = "/theme/images/mitre_attack_logo.png" -%}
@@ -71,7 +71,7 @@
7171
<a class="dropdown-item" href="/resources/working-with-attack/">Working with ATT&CK</a>
7272
<a class="dropdown-item" href="/resources/faq/">FAQ</a>
7373
<a class="dropdown-item" href="/resources/updates/">Updates</a>
74-
<a class="dropdown-item" href="/resources/previous-versions/">Previous Versions</a>
74+
<a class="dropdown-item" href="/resources/versions/">Versions of ATT&CK</a>
7575
<a class="dropdown-item" href="/resources/related-projects/">Related Projects</a>
7676
</div>
7777
</li>
@@ -91,8 +91,8 @@
9191
</div>
9292
</nav>
9393
</header>
94-
<!-- don't edit or remove the line below even though it's commented out, it gets parsed and replaced by the previous-versions feature -->
95-
<!-- !previous versions banner! -->
94+
<!-- don't edit or remove the line below even though it's commented out, it gets parsed and replaced by the versioning feature -->
95+
<!-- !versions banner! -->
9696
{% if BANNER_ENABLED == "true" %}
9797
<div class="container-fluid banner-message">
9898
{{ BANNER_MESSAGE }}

attack-theme/templates/groups/group.html

+3
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
{% set title = parsed.name + ", Group " + parsed.attack_id + " | MITRE ATT&CK&reg;" -%}
88
{% endif %}
99
{% set active_page = "groups" -%}
10+
1011
{% import 'macros/navigator.html' as navigator %}
1112
{% import 'macros/references.html' as references %}
1213
{% import 'macros/navigation.html' as navigation %}
1314
{% import 'macros/techniques_used.html' as techniques_used %}
15+
{% import 'macros/versioning.html' as versioning %}
1416

1517
{% block head %}
1618
{{ super () }}
@@ -80,6 +82,7 @@ <h1>
8082
{% endif %}
8183
</div>
8284
</div>
85+
{{ versioning.permalink_button(output_file, parsed.attack_id)}}
8386
</div>
8487
</div>
8588
{% if parsed.alias_descriptions %}

attack-theme/templates/macros/matrix.html

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
tour_technique: the technique to use in the sub-techniques tour
77
isIndex: boolean, true if this matrix is going on the index page
88
-->
9-
109
{% macro matrices(matrices, has_subtechniques, tour_technique, isIndex) %}
1110
<div id="tour-matrix-container">
1211
{% if has_subtechniques %}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!-- version permalink button -->
2+
{% macro permalink_button(output_file, object_name, format=True) %}
3+
<div class="{% if format %}text-center pt-2 {% endif %}version-button live">
4+
<div class="live">
5+
<a data-toggle="tooltip"
6+
data-placement="bottom"
7+
title="permalink to this version of {{object_name}}"
8+
href="{{ output_file | permalink }}">Version Permalink</a>
9+
</div>
10+
<div class="permalink">
11+
<a data-toggle="tooltip"
12+
data-placement="bottom"
13+
title="go to the live version of {{object_name}}"
14+
href="{{ output_file | permalink }}">Live Version</a><!--do not change this line without also changing versions.py-->
15+
</div>
16+
</div>
17+
{% endmacro %}

0 commit comments

Comments
 (0)