Skip to content

Commit

Permalink
Merge pull request #457 from mitre-attack/develop
Browse files Browse the repository at this point in the history
Update to version 4.0.5
  • Loading branch information
jondricek authored Sep 1, 2023
2 parents 0dc379c + 11b1e01 commit 4ca6b83
Show file tree
Hide file tree
Showing 36 changed files with 201 additions and 314 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@

<!-- TOWNCRIER -->

# v4.0.5 (2023-09-01)

## Features

* The sidebar is now collapsable and displayed properly in mobile view [#450](https://github.com/mitre-attack/attack-website/issues/450)

## Bugfixes

* Changed the UUID generation logic to use CONTENT_VERSION and WEBSITE_VERSION as seeds for idempotent UUID creation. This prevents the creation of redundant IndexedDB tables. [#455](https://github.com/mitre-attack/attack-website/issues/455)

# v4.0.4 (2023-08-11)

## Features
Expand Down
Binary file added attack-theme/static/images/ATTACKCon-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions attack-theme/static/scripts/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ $(document).ready(function () {
// jumping from one domain to another. E.g. techniques to matrices
let current_modules = window.location.pathname.split("/");

var sidebar = document.querySelector(".sidebar");
var sidebarSize = localStorage.getItem('sidebarWidth');
sidebar.style.width = sidebarSize;

if (document.referrer) {
// Loop through the modules in case page is hosted from different
// directory
Expand Down
27 changes: 23 additions & 4 deletions attack-theme/static/scripts/resizer.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
//This code is for being able to resize the sidebar in the desktop view
var resizer = document.querySelector(".resizer");
var sidebar = document.querySelector(".sidebar");
$(document).ready(function (){
resizeSidebar( resizer, sidebar );
});

if(resizer!=null) {
resizeSidebar( resizer, sidebar );
}

function resizeSidebar( resizer, sidebar ) {
var x = 0;
Expand All @@ -21,6 +22,7 @@ function resizeSidebar_mousemoveHandler( event ) {
var dx = event.clientX - x;
var newsidebarWidth = w + dx;
sidebar.style.width = `${ newsidebarWidth }px`;
localStorage.setItem("sidebarWidth", sidebar.style.width);
}

function resizeSidebar_mouseupHandler() {
Expand All @@ -29,4 +31,21 @@ function resizeSidebar_mouseupHandler() {
}

resizer.addEventListener("mousedown", resizeSidebar_mousedownHandler);
}
}

//This code is for creating a collapsable sidebar for the mobile view
const mediaQuery = window.matchMedia('(max-width: 47.9875rem)')

function mobileSidenav(e) {
if (e.matches) {
$('#sidebar-collapse').collapse('hide')
}
else{
$('#sidebar-collapse').collapse('show')
}
}
$(document).ready(function() {
mobileSidenav(mediaQuery)
});

mediaQuery.addEventListener('change', mobileSidenav)
24 changes: 20 additions & 4 deletions attack-theme/static/style/_layouts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,18 @@ a {
border-top: 1px solid border-color(body);
}
}
.row-main-page {
display: flex;
flex-wrap: wrap;
margin-right: -15px;
margin-left: -15px;
}

@media screen and (max-width: 47.9875rem) {
.row-main-page {
display: inline;
}
}

// p for home page
.p-line {
Expand Down Expand Up @@ -578,17 +590,21 @@ pre {

/*TWITTER*/
// twitter container in the home page
.twitter-card {
width: to-rem(400);
.attack-box {
width: to-rem(384);
max-width: 100%;
height: to-rem(400);
height: to-rem(464);
margin: 0 auto;
border: 3px solid #dfdfdf;
padding: 3px;
display: flex;
flex-direction: column;
iframe {
border: 1px solid border-color(body) !important;
border-radius: .25rem;
}

}

/******/

/*BREADCRUMBS*/
Expand Down
67 changes: 35 additions & 32 deletions attack-theme/static/style/_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,39 @@
font-size: rem(1.3);
color: on-color-deemphasis(body);
letter-spacing: to-rem(3);
pointer-events: none;
@media screen and (max-width: 47.9875rem) {
pointer-events: all;
}
}

.heading.collapsed .fa-chevron-up,
.heading .fa-chevron-down {
display: none;
}

.heading.collapsed .fa-chevron-down,
.heading .fa-chevron-up {
display: inline-block;
}

i.fa {
visibility: hidden;
display: none;
@media screen and (max-width: 47.9875rem) {
visibility: visible;
display: contents;
}
}

.br-mobile {
display: none;
@media screen and (max-width: 47.9875rem) {
display: inline-block;
}
}


// dropdown of the button in the side navigation. This button is in MATRICES, TACTICS, TECHNIQUES, MITIGATIONS, GROUPS, and SOFTWARE
.heading-dropdown {
font-size: rem(0.9);
Expand Down Expand Up @@ -176,33 +207,9 @@
}
}
}

/* Side navigation collapse */
// don't show collapsed side navigation (desktop view)
.side-nav-mobile-view {
display: none;
}

// show side navigation in desktop view
.side-nav-desktop-view {
display: block;
}

// side navigation collapsed view for phones and small tablets
@media screen and (max-width: 47.9875rem) {
// show collapsed side navigation (mobile view)
.side-nav-mobile-view {
display: block;
}

// don't show side navigation in desktop view
.side-nav-desktop-view {
display: none;
}
}
/******/
}
/******/

.resizer {
width: 2px;
top: 0;
Expand All @@ -212,6 +219,7 @@
position: absolute;
background-color: #dfdfdf;
}

.sidebar.nav {
// max-height: 60vh;
overflow-y: auto;
Expand All @@ -222,13 +230,7 @@
// Remove overflow and sticky position for mobile view
@media screen and (max-width: 47.9875rem) {
position: static;
}
.side-nav-mobile-view {
.sidenav-wrapper {
.sidenav-list {
overflow-y: visible;
}
}
min-width: fit-content;
}

.sidenav-wrapper {
Expand All @@ -238,6 +240,7 @@
height: 100%;
display: flex;
flex-direction: column;
padding-right: 5px;
.heading {
border-bottom: 1px solid color-alternate(body);
flex: 0 1 0;
Expand Down
21 changes: 16 additions & 5 deletions attack-theme/templates/general/attack-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@
{{ super() }}
<div class="col jumbotron-fluid">
<div class="container home-banner">
<div class="row pt-5">
<div class="row-main-page pt-5">
{% if parsed.attack_branding %}
<div class="col mb-5 home-left-col">
<p class="text-justify">MITRE ATT&CK<sup>&reg;</sup> is a globally-accessible knowledge base of adversary tactics and techniques based on real-world observations. The ATT&CK knowledge base is used as a foundation for the development of specific threat models and methodologies in the private sector, in government, and in the cybersecurity product and service community.</p>
<p class="text-justify">With the creation of ATT&CK, MITRE is fulfilling its mission to solve problems for a safer world &mdash; by bringing communities together to develop more effective cybersecurity. ATT&CK is open and available to any person or organization for use at no charge.</p>
</div>
<div class="col">
<div class="py-1">
<img src="{{ parsed.logo_landingpage }}" class="rounded mx-auto d-block pb-4 attack-logo-bold">
</div>
Expand Down Expand Up @@ -63,6 +59,21 @@
<a class="twitter-timeline" href="https://twitter.com/MITREattack?ref_src=twsrc%5Etfw" data-theme="light" data-height="388">Tweets by MITREattack</a>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</div> -->
<p class="text-justify">MITRE ATT&CK<sup>&reg;</sup> is a globally-accessible knowledge base of adversary tactics and techniques based on real-world observations. The ATT&CK knowledge base is used as a foundation for the development of specific threat models and methodologies in the private sector, in government, and in the cybersecurity product and service community.</p>
<p class="text-justify">With the creation of ATT&CK, MITRE is fulfilling its mission to solve problems for a safer world &mdash; by bringing communities together to develop more effective cybersecurity. ATT&CK is open and available to any person or organization for use at no charge.</p>
</div>
<div class="col">
<div class="attack-box">
<img width="100%" height="50%" src="/theme/images/ATTACKCon-4.png" alt="ATT&CKcon 4.0">
<center>
<hr>
<h2 class="attack-box-heading">
ATT&amp;CKcon 4.0 will be held on <strong>Oct 24-25</strong> in McLean, VA.
<br>
<a href="https://na.eventscloud.com/attackcon4/">Click here</a> for more details and to register.
</h2>
</center>
</div>
</div>
{% else %}
<p class="text-justify">
Expand Down
8 changes: 7 additions & 1 deletion attack-theme/templates/macros/navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
-->
{% macro sidenav(root, output_file, filter=False) %}
<div class="sidenav-wrapper">
<div class="heading" id="v-home-tab" aria-selected="false">{{root.name | upper}}</div>
<div class="heading" data-toggle="collapse" data-target="#sidebar-collapse" id="v-home-tab" aria-selected="false">{{root.name | upper}}
<i class="fa fa-fw fa-chevron-down"></i>
<i class="fa fa-fw fa-chevron-up"></i>
</div>
{% if filter %}
<div class="checkbox-div" id="v-home-tab" aria-selected="false">
<div class="custom-control custom-switch">
Expand All @@ -37,6 +40,8 @@
</div>
</div>
{% endif %}
<br class="br-mobile">
<div class="collapse show" id="sidebar-collapse">
<div class="sidenav-list">
{# "overview" link as first item in list if root.path exists #}
{% if root.path %}
Expand All @@ -47,6 +52,7 @@
{% endfor %}
</div>
</div>
</div>
{% endmacro %}

<!-- recusive helper for sidenav -->
Expand Down
2 changes: 1 addition & 1 deletion data/faq.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"questions": [
{
"question": "How should I reference the name ATT&CK?",
"answer": "<p>Both MITRE ATT&CK<sup>&reg;</sup> and ATT&CK<sup>&reg;</sup> are registered trademarks of The MITRE Corporation.</p><p>For more information please visit our <a href=\"/resources/brand\">Brand Guide</a></p>"
"answer": "<p>Both MITRE ATT&CK<sup>&reg;</sup> and ATT&CK<sup>&reg;</sup> are registered trademarks of The MITRE Corporation.</p><ul><li>Your first references in writing must include \"MITRE\" preceding \"ATT&CK<sup>&reg;</sup>\" - but subsequently should just reference \"ATT&CK\" (no registered trademark symbol required).<ul><li>Example of a first reference: <i>MITRE ATT&CK<sup>&reg;</sup> is a curated knowledge base and model for cyber adversary behavior...</i></li><li>Example of subsequent reference: <i>ATT&CK is useful for understanding security risk against known adversary behavior...</i></li></ul><li>A headline should <i>always</i> reference \"MITRE ATT&CK\" together (never only \"ATT&CK<sup>&reg;</sup>\").</li><li>Always capitalize \"ATT&CK\" to distinguish it from the surrounding text.</li><li>Do not modify the trademark, such as through hyphenation or abbreviation. For example, \"ATT&CK'd!\", \"Plan-of-ATT&CK\", \"ATTK\".</li><li>You may not display the ATT&CK trademark in any manner that implies an affiliation with, sponsorship, or endorsement by MITRE, or in a manner that can be reasonably interpreted to suggest third party content represents the views and opinions of MITRE or MITRE personnel, unless those third parties receive express permission from MITRE.</li><li>You may not use ATT&CK in your product names, service names, trademarks, logos, or company names.</li></ul> For more information please visit our <a href=\"/resources/brand\"> Brand Guide </a>"
},
{
"question": "Where can I download the MITRE ATT&CK logo?",
Expand Down
8 changes: 4 additions & 4 deletions data/resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Automation: The Wonderful Wizard of CTI (Or Is IT?)",
"date": "January 2020",
"url": "https://www.sans.org/presentations/automation-the-wonderful-wizard-of-cti-or-is-it/",
"url": "https://www.slideshare.net/MITREATTACK/automation-the-wonderful-wizard-of-cti-or-is-it",
"description": "This presentation from the SANS CTI Summit explores how automation can be applied to cyber threat intelligence using the Threat Report ATT&CK Mapper (TRAM)."
},
{
Expand All @@ -22,7 +22,7 @@
"name": "Turning Intelligence Into Action with MITRE ATT&CK",
"date": "October 2019",
"url": "https://www.anomali.com/resources/webcasts/turning-intelligence-into-action-with-mitre-attck-detect-19-presentation-series",
"description": "This presentation from Anomali Detect discusses how you can use ATT&CK for threat intelligence, including a process for mapping intelligence to ATT&CK as well as biases to watch out for as you do this. <a href='https://www.slideshare.net/AdamPennington4/anomali-detect-19-nickels-pennington-turning-intelligence-into-action-with-mitre-attck-177846813'>Slides are also available</a>."
"description": "This presentation from Anomali Detect discusses how you can use ATT&CK for threat intelligence, including a process for mapping intelligence to ATT&CK as well as biases to watch out for as you do this. <a href='https://www.mitre.org/sites/default/files/2021-10/first-cti-turning-intelligence-into-action-mitre-attack-2019.pdf'>Slides are also available</a>."
},
{
"name": "Leveraging MITRE ATT&CK for Detection, Analysis & Defense",
Expand Down Expand Up @@ -57,7 +57,7 @@
{
"name": "Do-It-Yourself ATT&CK Evaluations to Improve Your Security Posture",
"date": "June 2019",
"url": "https://www.sans.org/cyber-security-summit/archives/file/summit_archive_1559672321.pdf",
"url": " https://www.sans.org/presentations/do-it-yourself-att-ck-evaluations-to-improve-your-security-posture/",
"description": "This presentation from the SANS Enterprise Defense Summit explains how defenders can improve their security posture through the use of adversary emulation by performing their very own ATT&CK Evaluations."
},
{
Expand Down Expand Up @@ -123,7 +123,7 @@
{
"name": "ATT&CKing the Status Quo: Threat-Based Adversary Emulation with MITRE ATT&CK",
"date": "September 2018",
"url": "https://www.sans.org/cyber-security-summit/archives/file/summit-archive-1536260992.pdf",
"url": "https://www.slideshare.net/KatieNickels/threatbased-adversary-emulation-with-mitre-attck",
"description": "This presentation from the SANS Threat Hunting Summit shows how you can use ATT&CK to apply threat intelligence to adversary emulation."
},
{
Expand Down
11 changes: 2 additions & 9 deletions modules/campaigns/campaigns.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,6 @@ def generate_markdown_files():
"Campaigns", "/campaigns/", campaign_list_no_deprecated_revoked
)
data["side_menu_data"] = side_menu_data

side_menu_mobile_view_data = util.buildhelpers.get_side_menu_mobile_view_data(
"campaigns", "/campaigns/", campaign_list_no_deprecated_revoked, group_by
)
data["side_menu_mobile_view_data"] = side_menu_mobile_view_data

data["campaigns_table"] = get_campaigns_table_data(campaign_list_no_deprecated_revoked)
data["campaigns_list_len"] = str(len(campaign_list_no_deprecated_revoked))

Expand All @@ -81,12 +75,12 @@ def generate_markdown_files():

# Create the markdown for the enterprise campaigns in the STIX
for campaign in campaign_list:
generate_campaign_md(campaign, side_menu_data, side_menu_mobile_view_data, notes)
generate_campaign_md(campaign, side_menu_data, notes)

return has_campaign


def generate_campaign_md(campaign, side_menu_data, side_menu_mobile_view_data, notes):
def generate_campaign_md(campaign, side_menu_data, notes):
"""Responsible for generating markdown of all campaigns."""

attack_id = util.buildhelpers.get_attack_id(campaign)
Expand All @@ -97,7 +91,6 @@ def generate_campaign_md(campaign, side_menu_data, side_menu_mobile_view_data, n
data["attack_id"] = attack_id

data["side_menu_data"] = side_menu_data
data["side_menu_mobile_view_data"] = side_menu_mobile_view_data
data["notes"] = notes.get(campaign["id"])

# External references
Expand Down
5 changes: 1 addition & 4 deletions modules/campaigns/templates/campaign.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,9 @@

{% block innerleft %}
<!--stop-indexing-for-search-->
<div class="side-nav-desktop-view h-100">
<div id="v-tab" role="tablist" aria-orientation="vertical" class="h-100">
{{ navigation.sidenav(parsed.side_menu_data, output_file) }}
</div>
<div class="side-nav-mobile-view">
{{ navigation.sidenav(parsed.side_menu_mobile_view_data, output_file) }}
</div>
<!--start-indexing-for-search-->
{% endblock %}

Expand Down
Loading

0 comments on commit 4ca6b83

Please sign in to comment.