Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update website to 4.1.2 #500

Merged
merged 12 commits into from
Apr 23, 2024
Merged
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v4.1.2 (2024-04-23)
---------------------

* Release [ATT&CK content version 15.0](https://github.com/mitre/cti/releases/tag/ATT%26CK-v15.0).
See the release notes [here](https://attack.mitre.org/resources/updates/updates-april-2024/).

# v4.1.1 (2024-02-05)

## Misc
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions attack-theme/static/style/_layouts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,24 @@ a {
color: color(secondary);
}

// used for data sources filter dropdown
.dropdown {
position: relative;
display: inline-block;
}

.dropdown-content {
display: none;
position: absolute;
background-color: on-color(secondary);
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
}

.dropdown:hover .dropdown-content {
display: block;
}

// placeholder for base style of all navy colored buttons
%button-style {
color: on-color(secondary);
Expand Down Expand Up @@ -1418,6 +1436,11 @@ div#sidebars {
}
}
}
.table-of-contents {
position: static;
float: none;
width: 25%;
}
}

.tip-box {
Expand Down
7 changes: 4 additions & 3 deletions attack-theme/templates/macros/contact_card.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% macro render(title, link, description, fa_icon=None, invert_icon=None, buttons=None, header_background=None, footer_description=None, header_subtitle=None, card_modal=None) %}
{% macro render(title, link, description, fa_icon=None, invert_icon=None, buttons=None, header_background=None, footer_description=None, header_subtitle=None) %}
<div class="contact-card card">
{% if header_background %}
<div class="card-header background">
Expand Down Expand Up @@ -42,8 +42,9 @@ <h6 class="mb-0"><strong>{{title}}</strong></h6>
{% if buttons %}
<div class="card-footer no-background button-group">
{% for button in buttons %}
<a href="{{button.url}}" {% if card_modal %} aria-controls="{{card_modal}}" {% endif %}>
<button type="button" class="slide-button" {% if card_modal %} data-toggle="modal" data-target="#{{card_modal}}" {% endif %}>
{% set isCardModal = "card_modal" in button %}
<a href="{{button.url}}" {% if isCardModal %} aria-controls="{{button.card_modal}}" {% endif %}>
<button type="button" class="slide-button" {% if isCardModal %} data-toggle="modal" data-target="#{{button.card_modal}}" {% endif %}>
<span class="slide-button-text text-nowrap">
{{button.label}}
</span>
Expand Down
8 changes: 4 additions & 4 deletions attack-theme/templates/macros/matrix.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
create a new matrix supporting subtechniques and cell colors.
Params:
Params:
matrices: Matrix[] of matrices to display on the page
has_subtechniques: boolean, true if the matrix has subtechniques in it
tour_technique: the technique to use in the sub-techniques tour
Expand Down Expand Up @@ -41,7 +41,7 @@
<div id="layouts-content">
<div class="matrix-type side">
{% for matrix in matrices %}
{{ matrix_box('side', matrix, matrices | length, tour_technique, isIndex, notes, loop.index) }}
{{ matrix_box('side', matrix, matrices | length, tour_technique, isIndex, notes, loop.index) }}
{% endfor %}
</div>
<div class="matrix-type flat d-none">
Expand All @@ -58,7 +58,7 @@
</div>
{% endmacro %}

<!--
<!--
matrix container helper
creates a matrix container with timestamp, overflow markers, and title
params:
Expand Down Expand Up @@ -121,7 +121,7 @@ <h3 class="text-center matrix-title">{{matrix.name}}</h3>
<tr>
{% for tactic in tactics %}
<td class="tactic">
{% for technique in tactic.techniques %}
{% for technique in tactic.techniques %}
{% if technique.subtechniques | length == 0 %}
{{ technique_cell(technique, False, tactic) }}
{% else %}
Expand Down
17 changes: 13 additions & 4 deletions data/versions.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
{
"current": {
"name": "v14.1",
"date_start": "October 31, 2023",
"changelog": "updates-october-2023",
"cti_url": "https://github.com/mitre/cti/releases/tag/ATT%26CK-v14.1"
"name": "v15.0",
"date_start": "April 23, 2024",
"changelog": "updates-april-2024",
"cti_url": "https://github.com/mitre/cti/releases/tag/ATT%26CK-v15.0"
},
"previous": [
{
"name": "v14.1",
"aliases": [],
"date_start": "October 31, 2023",
"date_end": "April 22, 2024",
"changelog": "updates-october-2023",
"cti_url": "https://github.com/mitre/cti/releases/tag/ATT%26CK-v14.1",
"commit": "3a9331ed1003712bade585c3e698ce76cf39d727"
},
{
"name": "v13.1",
"aliases": [],
Expand Down
12 changes: 6 additions & 6 deletions modules/benefactors/templates/benefactors.html
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,15 @@ <h4>ATT&CK Benefactors</h4>
sponsors: [
{
logo: "/theme/images/benefactors/SOC-prime-logo.png",
url: "https://socprime.com/"
url: "https://socprime.com"
},
{
logo: "/theme/images/benefactors/Tidal-Stacked-Hero.png",
url: "https://www.tidalcyber.com/"
url: "https://www.tidalcyber.com"
},
{
logo: "/theme/images/benefactors/ZIMPERIUM-logo_blackBG.png",
url: "https://www.zimperium.com"
},
],
},
Expand All @@ -125,8 +129,6 @@ <h4>ATT&CK Benefactors</h4>
];

let numRows = sponsorSupport.length;

let supportLevel = document.getElementById("support-level-header");
let rowCounter = 0;

let buttonLeft = document.getElementById("button-left");
Expand All @@ -151,8 +153,6 @@ <h4>ATT&CK Benefactors</h4>
items[colCounter].parentElement.parentElement.style.display = 'none';
}
}
// bold support level
supportLevel.innerHTML = sponsorSupport[rowCounter].support;
}

function incrementCounter() {
Expand Down
3 changes: 0 additions & 3 deletions modules/campaigns/campaigns.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ def generate_markdown_files():
if has_campaign:
data = {}

# Amount of characters per category
group_by = 2

notes = util.relationshipgetters.get_objects_using_notes()
side_menu_data = util.buildhelpers.get_side_menu_data(
"Campaigns", "/campaigns/", campaign_list_no_deprecated_revoked
Expand Down
47 changes: 46 additions & 1 deletion modules/datasources/datasources.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def get_datasources_table_data(datasource_list):
# Now the table on the right, which is made up of datasource data
for datasource in datasource_list:
attack_id = util.buildhelpers.get_attack_id(datasource)
domain_list = util.buildhelpers.get_domain_name(datasource)
domain_list = get_datasources_domain(datasource)

if attack_id:
row = {}
Expand Down Expand Up @@ -322,3 +322,48 @@ def get_datacomponents_data(datasource, reference_list):
datacomponents_data = sorted(datacomponents_data, key=lambda k: k["name"].lower())

return datacomponents_data


def get_domains_of_datacomponent(datacomponent, techniques_detected_by_datacomponent, technique_to_domain):
"""Retrives domains of given data component"""
domains_of_datacomponent = []

# get data components to techniques mapping to find domains
techniques_of_datacomp = techniques_detected_by_datacomponent.get(datacomponent["id"])
if techniques_of_datacomp:
technique_list = {}
for technique_rel in techniques_of_datacomp:
attack_id = util.buildhelpers.get_attack_id(technique_rel["object"])
if attack_id:
domain = technique_to_domain[attack_id].split("-")[0]
if not domain in domains_of_datacomponent:
domains_of_datacomponent.append(domain)

return domains_of_datacomponent

def get_datasources_domain(datasource):
"""Responsible for generating the list of domains for the datasources and datacomponents."""

# Get data components of data source
datacomponent_of = rsg.get_datacomponent_of()
technique_to_domain = rsg.get_technique_to_domain()
techniques_detected_by_datacomponent = rsg.get_techniques_detected_by_datacomponent()

# Loop through data sources
attack_id = util.buildhelpers.get_attack_id(datasource)

if attack_id:
domains_of_datasource = []
if datacomponent_of.get(datasource["id"]):
for datacomponent in datacomponent_of[datasource["id"]]:
if not datacomponent.get("x_mitre_deprecated") and not datacomponent.get("revoked"):
# get data component detections
techniques_of_datacomp = techniques_detected_by_datacomponent.get(datacomponent["id"])
if techniques_of_datacomp:
domains_of_datacomponent = get_domains_of_datacomponent(datacomponent, techniques_detected_by_datacomponent, technique_to_domain)
# Add missing domains to data source
for domain in domains_of_datacomponent:
if not domain in domains_of_datasource:
domains_of_datasource.append(domain)

return domains_of_datasource
37 changes: 21 additions & 16 deletions modules/datasources/templates/datasources-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,27 @@ <h6 class="table-object-count"></h6>
<i id="arrow-down-1" class="fa-solid fa-fw fa-chevron-down"></i>
<i id="arrow-up-1" class="fa-solid fa-fw fa-chevron-up"></i>
</th>
<th scope="col">Domain
<i class="fa-solid fa-sm fa-filter" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></i>
<div id="filterMenu" class="dropdown-menu data-sources-menu" aria-labelledby="domain-options">
<div class="custom-control custom-switch dropdown-item">
<input type="checkbox" checked="checked" id="Enterprise" onchange="showDomain()">
<label for="Enterprise">Enterprise</label>
</div>
<div class="custom-control custom-switch dropdown-item">
<input type="checkbox" checked="checked" id="Mobile" onchange="showDomain()">
<label for="Mobile">Mobile</label>
</div>
<div class="custom-control custom-switch dropdown-item">
<input type="checkbox" checked="checked" id="ICS" onchange="showDomain()">
<label for="ICS">ICS</label>
</div>
</div>
<th scope="col">
<div class="dropdown">
Domain
<i class="fa-solid fa-sm fa-filter"></i>
<div class="dropdown-content">
<div id="filterMenu" class="data-sources-menu">
<div class="custom-control custom-switch">
<input type="checkbox" checked="checked" id="Enterprise" onchange="showDomain()">
<label for="Enterprise">Enterprise</label>
</div>
<div class="custom-control custom-switch">
<input type="checkbox" checked="checked" id="Mobile" onchange="showDomain()">
<label for="Mobile">Mobile</label>
</div>
<div class="custom-control custom-switch">
<input type="checkbox" checked="checked" id="ICS" onchange="showDomain()">
<label for="ICS">ICS</label>
</div>
</div>
</div>
</div>
</th>
<th scope="col">Description</th>
</tr>
Expand Down
Loading