Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/pip/gitpython-3.1.37
Browse files Browse the repository at this point in the history
  • Loading branch information
jondricek authored Oct 11, 2023
2 parents d812a33 + 07eb6ea commit 810e2ae
Show file tree
Hide file tree
Showing 99 changed files with 1,412 additions and 581 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ output/
reports/

attack-theme/templates/general/base.html
attack-theme/templates/contribute
attack-theme/templates/benefactors
attack-theme/templates/datasources
attack-theme/templates/groups
attack-theme/templates/campaigns
attack-theme/templates/assets
attack-theme/templates/matrices
attack-theme/templates/mitigations
attack-theme/templates/resources
Expand All @@ -28,6 +29,7 @@ attack-theme/templates/techniques
attack-theme/templates/website_build
attack-theme/templates/versions
attack-theme/static/scripts/settings.js
attack-theme/templates/general/sidebar-resources.html
content/
data/pelican_settings.json

Expand Down
1 change: 1 addition & 0 deletions attack-search/src/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const baseURL = ''; // TODO migrate from base_url (generated via Pelican)

const searchFilePaths = [
"campaigns.json",
"assets.json",
"datasources.json",
"groups.json",
"matrices.json",
Expand Down
16 changes: 16 additions & 0 deletions attack-theme/static/scripts/mobileview-datasources.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// This code is for creating a collapsable sidebar for the mobile view
let 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)
19 changes: 1 addition & 18 deletions attack-theme/static/scripts/resizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,4 @@ 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)
}
52 changes: 52 additions & 0 deletions attack-theme/static/scripts/sidebar-load-all.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
let mod_name = window.location.pathname.split("/")
let mod_entry = "/" + mod_name[1] + "/sidebar-" + mod_name[1]
if (mod_name.includes('contact')){
mod_entry = "/" + "resources/sidebar-resources"
}
$("#sidebars").load(mod_entry, function() {
let navElements = document.querySelectorAll('.sidenav-head > a');
let winlocation;
navElements.forEach(function(element){
if(!element.href.includes('changelog.html')){
if(!window.location.href.endsWith("/")){
winlocation = window.location.href + "/";
}
else{
winlocation = window.location.href
}
if(!element.href.endsWith("/")){
element.href = element.href + "/";
}
}
else{
winlocation = window.location.href
}
if(element.href == winlocation){
$(element.parentNode).addClass("active")
}});

//This code is for creating a collapsable sidebar for the mobile view
let 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)
let sidenav = $(".sidenav-list");
let sidenav_active_elements = $(".sidenav .active");
if (sidenav_active_elements.length > 0) setTimeout(() => { //setTimeout gives bootstrap time to execute first
let offsetValue = sidenav_active_elements[0].offsetTop;
if (offsetValue <= 0){
offsetValue = sidenav_active_elements[sidenav_active_elements.length - 1].offsetTop;
}
sidenav[0].scrollTop = offsetValue - 60;
});
});

mediaQuery.addEventListener('change', mobileSidenav)
});
13 changes: 13 additions & 0 deletions attack-theme/static/style/_layouts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,10 @@ a {
}
}

.tables-mobile {
overflow-y: auto;
}

.table-bordered, .blog-post table, .changelog table {
&, & td, & th {
border: 1px solid border-color(body);
Expand Down Expand Up @@ -1051,6 +1055,11 @@ pre {

/******/

// how to display the sidebar
div#sidebars {
display: contents
}

/*Plus/Minus expand icons*/
// used in the expandable list items in the side navigation and in the expandable gray blocks in ATT&CKCON
.expand-icon {
Expand Down Expand Up @@ -1137,6 +1146,10 @@ pre {
}
}

.contact-center {
margin-block-start: 20vh;
}

/*Card Blocks*/
// container of groups of cards
.expand-panel {
Expand Down
6 changes: 2 additions & 4 deletions attack-theme/templates/general/attackcon-overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
{% import 'macros/navigation.html' as navigation %}

{% block innerleft %}
<div id="v-tab" role="tablist" aria-orientation="vertical" class="h-100">
{{navigation.sidenav(RESOURCE_NAV, output_file)}}
</div>
<div id="sidebars"></div>
{% endblock %}

{% block innerright %}
Expand Down Expand Up @@ -117,5 +115,5 @@ <h2>Sponsors</h2>
{% block scripts %}
{{ super() }}
<!--SCRIPTS-->
<script src="/theme/scripts/navigation.js"></script>
<script src="/theme/scripts/sidebar-load-all.js"></script>
{% endblock %}
1 change: 0 additions & 1 deletion attack-theme/templates/general/base-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@
<script src="/theme/scripts/site.js?{{ range(1, 9002) | random }}"></script>
<script src="/theme/scripts/settings.js?{{ range(1, 9002) | random }}"></script>
<script src="/theme/scripts/search_bundle.js"></script>
<script src="/theme/scripts/resizer.js"></script>
{% endblock %}
</body>
</html>
6 changes: 2 additions & 4 deletions attack-theme/templates/general/faq-overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
{% import 'macros/navigation.html' as navigation %}

{% block innerleft %}
<div id="v-tab" role="tablist" aria-orientation="vertical" class="h-100">
{{navigation.sidenav(RESOURCE_NAV, output_file)}}
</div>
<div id="sidebars"></div>
{% endblock %}

{% block innerright %}
Expand Down Expand Up @@ -64,5 +62,5 @@ <h5>
{% block scripts %}
{{ super() }}
<!--SCRIPTS-->
<script src="/theme/scripts/navigation.js"></script>
<script src="/theme/scripts/sidebar-load-all.js"></script>
{% endblock %}
29 changes: 17 additions & 12 deletions attack-theme/templates/general/intro-overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,31 @@
{% import 'macros/navigation.html' as navigation %}

{% block innerleft %}
<div id="v-tab" role="tablist" aria-orientation="vertical" class="h-100">
{{navigation.sidenav(RESOURCE_NAV, output_file)}}
</div>
<div id="sidebars"></div>
{% endblock %}

{% block innerright %}
{{ super () }}
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Home</a></li>
<li class="breadcrumb-item"><a href="/resources/">Resources</a></li>
<li class="breadcrumb-item">{{ page.title }}</li>
</ol>
<div class="blog-post p-3">
<h1 class="blog-post-title mb-4">{{ page.title }}</h1>
<div class="px-3">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/">Home</a></li>
<li class="breadcrumb-item"><a href="/resources/">Resources</a></li>
<li class="breadcrumb-item">{{ page.title }}</li>
</ol>
</div>
<div class="container pb-3 uniform-block">
<div class="card-block">
<div class="clearfix pb-3">
<div class="clearfix pb-3">
<h2>{{ page.title }}</h2>
{{ page.content }}
</div>
</div>
</div>
</div>
{% endblock %}

{% block scripts %}
{{ super () }}
<script src="/theme/scripts/tables.js"></script>
<script src="/theme/scripts/navigation.js"></script>
<script src="/theme/scripts/sidebar-load-all.js"></script>
{% endblock %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{% set RESOURCE_NAV = ${RESOURCE_NAV} -%}
{% import 'macros/navigation.html' as navigation %}
<div id="v-tab" role="tablist" aria-orientation="vertical" class="h-100">
{{navigation.sidenav(RESOURCE_NAV, output_file)}}
</div>
{% block scripts %}
<!--SCRIPTS-->
<script src="/theme/scripts/navigation.js"></script>
{% endblock %}
9 changes: 9 additions & 0 deletions attack-theme/templates/general/sidebar-template.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{% import 'macros/navigation.html' as navigation %}
{% set parsed = page.data | from_json %}
<div id="v-tab" role="tablist" aria-orientation="vertical" class="h-100">
{{ navigation.sidenav(parsed.menu, output_file) }}
</div>
{% block scripts %}
<!--SCRIPTS-->
<script src="/theme/scripts/navigation.js"></script>
{% endblock %}
7 changes: 6 additions & 1 deletion attack-theme/templates/general/two-column.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{% block left %}
{{ super() }}
<div class="sidebar nav sticky-top flex-column pr-0 pt-4 pb-3 pl-3" id="v-tab" role="tablist" aria-orientation="vertical">
<div class="resizer"></div>
<div class="resizer" id="resizer"></div>
{% block innerleft %}
{% endblock %}
</div>
Expand All @@ -22,3 +22,8 @@
{% endblock %}

{% endblock %}
{% block scripts %}
{{ super() }}
<!--SCRIPTS-->
<script src="/theme/scripts/resizer.js"></script>
{% endblock %}
2 changes: 2 additions & 0 deletions attack-theme/templates/macros/datasource_table.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% import 'macros/clean_output.html' as clean_output %}

{% macro datasource_table(datasources, show_descriptions, citations=None) %}
<div class="tables-mobile">
<table class="table datasources-table table-bordered">
<thead>
<tr>
Expand Down Expand Up @@ -50,4 +51,5 @@
{% endfor %}
</tbody>
</table>
</div>
{% endmacro %}
6 changes: 2 additions & 4 deletions attack-theme/templates/macros/navigation.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
-->
{% macro sidenav(root, output_file, filter=False) %}
<div class="sidenav-wrapper">
<div class="heading" data-toggle="collapse" data-target="#sidebar-collapse" id="v-home-tab" aria-selected="false">{{root.name | upper}}
<div class="heading" data-toggle="collapse" data-target="#sidebar-collapse" id="v-home-tab" aria-expanded="true" aria-controls="#sidebar-collapse" 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>
Expand All @@ -41,8 +41,7 @@
</div>
{% endif %}
<br class="br-mobile">
<div class="collapse show" id="sidebar-collapse">
<div class="sidenav-list">
<div class="sidenav-list collapse show" id="sidebar-collapse" aria-labelledby="v-home-tab">
{# "overview" link as first item in list if root.path exists #}
{% if root.path %}
{{ sidenav_helper("0", {"name": "Overview", "id": "0", "path": root.path, "children": []}, output_file) }}
Expand All @@ -52,7 +51,6 @@
{% endfor %}
</div>
</div>
</div>
{% endmacro %}

<!-- recusive helper for sidenav -->
Expand Down
17 changes: 16 additions & 1 deletion attack-theme/templates/macros/navigation_menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<div class="dropdown-menu {% if last %} dropdown-menu-right {% endif %}" aria-labelledby="navbarDropdown">
{% for child in element.children %}
{% if child.children %}
{{has_child(child)}}
{{child_has_child(child)}}
{% elif child.external_link %}
{{external_link(child)}}
{% else %}
Expand All @@ -57,4 +57,19 @@
{% endfor %}
</div>

{% endmacro %}

{% macro child_has_child(element) %}

<div class="dropright dropdown">
<a class="dropdown-item dropdown-toggle" href="{{ element.url }}" id="navbarDropdown" role="button"
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<b>{{ element.display_name }}</b>
</a>
<div class="dropdown-menu {% if last %} dropdown-menu-right {% endif %}" aria-labelledby="navbarDropdown">
{% for child in element.children %}
<a class="dropdown-item" href="{{child.url}}">{{ child.display_name }}</a>
{% endfor %}
</div>
</div>
{% endmacro %}
2 changes: 2 additions & 0 deletions attack-theme/templates/macros/techniques_used.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{% if title %}
<h2 class="pt-3 mb-2" id="techniques">{{title}}</h2>
{% endif %}
<div class="tables-mobile">
<table class="table techniques-used background table-bordered">
<thead>
<tr>
Expand Down Expand Up @@ -133,4 +134,5 @@ <h2 class="pt-3 mb-2" id="techniques">{{title}}</h2>
{% endfor %}
</tbody>
</table>
</div>
{% endmacro %}
6 changes: 3 additions & 3 deletions data/attackcon.json
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,10 @@
{
"title": "What’s New with ATT&CK for Cloud?",
"presenters": [{
"names": ["Jen Burns"],
"names": ["Jack Burns"],
"organization": "MITRE"
}],
"description": "Jen Burns is a Lead Cybersecurity Engineer at MITRE and the Lead for MITRE ATT&CK for Cloud. She’s also a red team developer and lead for ATT&CK Evaluations, using her skills in software engineering and adversary emulation. Previously, she was a tech lead at HubSpot on the Infrastructure Security team where she focused on red teaming and building detections in the cloud environment. This presentation is from the MITRE ATT&Ckcon Power Hour session held on October 9, 2020.",
"description": "Jack Burns is a Lead Cybersecurity Engineer at MITRE and the Lead for MITRE ATT&CK for Cloud. He’s also a red team developer and lead for ATT&CK Evaluations, using his skills in software engineering and adversary emulation. Previously, he was a tech lead at HubSpot on the Infrastructure Security team where he focused on red teaming and building detections in the cloud environment. This presentation is from the MITRE ATT&Ckcon Power Hour session held on October 9, 2020.",
"video": "https://www.youtube.com/watch?v=a-xs5VqlcKI&list=PLkTApXQou_8KKl3fOIPKD_9pNpmSe1TKu&index=24",
"slides": "https://www.slideshare.net/attackcon2018/whats-new-with-attck-for-cloud"
},
Expand Down Expand Up @@ -1139,4 +1139,4 @@
"slides": "https://www.slideshare.net/attackcon2018/mitre-attckcon-2018-the-use-of-game-theory-with-mitre-attck-matt-summers-and-nick-dunn-ncc-group"
}
]
}]
}]
Loading

0 comments on commit 810e2ae

Please sign in to comment.