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.0.6 #468

Merged
merged 89 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
c4c0bfc
table filter start
adpare Aug 25, 2023
8da0ba2
js for table filter
adpare Aug 25, 2023
74e69fa
got data sources count to display
adpare Aug 25, 2023
c2efc67
filter data sources table
adpare Aug 28, 2023
8c69f88
sorting table done
adpare Aug 28, 2023
919240b
Bump gitpython from 3.1.32 to 3.1.34
dependabot[bot] Sep 6, 2023
dd0f2f2
Merge pull request #458 from mitre-attack/dependabot/pip/gitpython-3.…
jondricek Sep 7, 2023
602e67a
first attempt at loading sidebar
adpare Sep 11, 2023
a1fc544
init assets
clemiller Sep 12, 2023
abe5af7
add asset to random page generator
clemiller Sep 12, 2023
6665167
update working with attack
clemiller Sep 12, 2023
0f76a61
sonarlint
clemiller Sep 12, 2023
b1b6d2a
add sectors to asset info card
clemiller Sep 12, 2023
d7ba198
add asset table to technique pages
clemiller Sep 12, 2023
99fa3d1
related assets table
clemiller Sep 12, 2023
67de6a7
navlayer verbage
clemiller Sep 12, 2023
86899f2
update search file paths
clemiller Sep 12, 2023
764153a
techniques sidebar done
adpare Sep 13, 2023
cb6db14
fn renaming
clemiller Sep 14, 2023
f61a152
progress on active class
adpare Sep 15, 2023
4017dba
code cleanup
adpare Sep 15, 2023
5564a8c
code cleanup part two
adpare Sep 15, 2023
ee4b1d1
Update assets.py
jondricek Sep 15, 2023
dae4c9c
resources page complete
adpare Sep 15, 2023
4ce3fd0
software side bar done
adpare Sep 15, 2023
4a68f70
mitigations done plus mobile fix
adpare Sep 15, 2023
4baa5af
groups done
adpare Sep 15, 2023
0422b9a
sidebar update. make calling function easier
adpare Sep 18, 2023
b0127ad
loading content into view
adpare Sep 19, 2023
5720a0b
matrices sidebar
adpare Sep 19, 2023
47f5796
tactics and campaigns
adpare Sep 19, 2023
80c22c7
update related_asset_sectors
clemiller Sep 20, 2023
1709ab5
update asset/technique tables
clemiller Sep 20, 2023
9d1d3a2
stable working condition
adpare Sep 20, 2023
42240d8
code cleanup 1
adpare Sep 20, 2023
04d4923
code cleanup 2
adpare Sep 20, 2023
b32bf08
Update attackcon.json contributor details
jondricek Sep 20, 2023
759123d
Update contributor information
jondricek Sep 20, 2023
9524425
versions work
adpare Sep 20, 2023
40c920e
added benefactors page and defenses and cti tab
adpare Sep 21, 2023
a694e01
Merge branch 'develop' into feature/ics-assets
clemiller Sep 22, 2023
07dd712
update navbar
clemiller Sep 22, 2023
e471215
campaigns link changed
adpare Sep 22, 2023
e1a9bf8
Merge branch 'develop' into feature/ics-assets
clemiller Sep 22, 2023
c595399
code cleanup
adpare Sep 27, 2023
86bcd4c
code smell
clemiller Sep 27, 2023
ed8941f
Merge pull request #460 from mitre-attack/feature/ics-assets
clemiller Sep 27, 2023
4833c5a
fixed error with mobile view
adpare Sep 27, 2023
fb125a8
deleted file
adpare Sep 27, 2023
f609150
updated navbar
adpare Sep 27, 2023
82ae1a9
remove sidebar from unlinked pages list
adpare Sep 29, 2023
937fa9d
versions module loaded link checker
adpare Sep 29, 2023
a1f0e54
code cleanup
adpare Oct 2, 2023
3d14e30
merge develop
adpare Oct 2, 2023
4b2b261
fix contribute page on mobile view
adpare Oct 2, 2023
85b8dda
Bump urllib3 from 1.26.15 to 1.26.17
dependabot[bot] Oct 3, 2023
5551c69
code smells
adpare Oct 3, 2023
f8150bd
Merge pull request #461 from mitre-attack/reduce-artifact-size
jondricek Oct 3, 2023
19f94ab
Bump gitpython from 3.1.32 to 3.1.35
dependabot[bot] Oct 3, 2023
0052c5a
Merge pull request #462 from mitre-attack/dependabot/pip/urllib3-1.26.17
jondricek Oct 3, 2023
bd29146
Merge branch 'develop' into dependabot/pip/gitpython-3.1.35
jondricek Oct 3, 2023
d6fba0b
Merge pull request #463 from mitre-attack/dependabot/pip/gitpython-3.…
jondricek Oct 3, 2023
d0e0f93
changelog url fix
adpare Oct 4, 2023
276dcb5
changelog and sidebar fix
adpare Oct 4, 2023
efa872d
Merge branch 'develop' into 454-data-sources-table-filter
adpare Oct 10, 2023
d812a33
Bump gitpython from 3.1.32 to 3.1.37
dependabot[bot] Oct 10, 2023
07eb6ea
benefactor page update
adpare Oct 11, 2023
810e2ae
Merge branch 'develop' into dependabot/pip/gitpython-3.1.37
jondricek Oct 11, 2023
0d843be
Merge pull request #464 from mitre-attack/dependabot/pip/gitpython-3.…
jondricek Oct 11, 2023
d3fd540
stable working condition
adpare Oct 11, 2023
fcfa923
domain filtering
adpare Oct 12, 2023
ca9c9f9
complete
adpare Oct 12, 2023
9fa6620
sonarcloud fix1
adpare Oct 13, 2023
a6c4bc8
sonarcloud fix2
adpare Oct 13, 2023
8a45983
assets description
adpare Oct 16, 2023
33d7501
Merge pull request #465 from mitre-attack/454-data-sources-table-filter
jondricek Oct 18, 2023
59e06b4
halloween
adpare Oct 26, 2023
21082e0
Whitespace cleaning
jondricek Oct 27, 2023
8d1b4cc
Update to mitreattack-python 2.1.1 to optimize excel file generation
jondricek Oct 27, 2023
e266f60
Update logging statement
jondricek Oct 27, 2023
d393e8c
Merge remote-tracking branch 'origin/master' into develop
jondricek Oct 27, 2023
190bcf9
Linter fixes and copy STIX files to output directory if from local file
jondricek Oct 27, 2023
2e5b92e
Copy STIX to right spot
jondricek Oct 27, 2023
7553e6c
Remove reference to old function parameter
jondricek Oct 27, 2023
d76adca
newsfragments for changelog
adpare Oct 26, 2023
8f6dde1
faq page updates
adpare Oct 30, 2023
9945aae
benefactor page update
adpare Oct 30, 2023
f29a704
updated attack box
adpare Oct 30, 2023
f364e5f
Update to v4.0.6 of website
jondricek Oct 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10.11
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# v4.0.6 (2023-10-31)

<!-- TOWNCRIER -->
## Features

* Data sources table can now be sorted and filtered based on domains. [#454](https://github.com/mitre-attack/attack-website/issues/454)
* Release [ATT&CK content version 14.0](https://github.com/mitre/cti/releases/tag/ATT%26CK-v14.0).
See the release notes [here](https://attack.mitre.org/resources/updates/updates-october-2023/).

# v4.0.5 (2023-09-01)

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
105 changes: 105 additions & 0 deletions attack-theme/static/scripts/domain_table.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
// this function filters table rows based on the selection
function filter_row(selected) {
let col_index = 3
const rows = document.querySelectorAll("#ds-table tbody tr");
let count = 0;
rows.forEach((row) => {
let row_count = 0
let row_visited = false;
let row_data = row.querySelector("td:nth-child(" + col_index + ")").innerHTML
for(let i = 0; i<selected.length; i++){
let filter_value = selected[i];
let display_row = true;
if (row_data.indexOf(filter_value) == -1 && !row_visited) {
display_row = false;
}
if (display_row) {
row.style.display = "table-row";
row_visited = "true";
row_count = row_count + 1;
} else {
row.style.display = "none"
}
}
if(row_count > 0){
count = count + 1;
}
})
let filter_count = document.querySelector(".table-object-count")
filter_count.innerHTML = `Data Sources: ${count}`
}

$(document).ready(function() {
let arrow_up = document.getElementById("arrow-up-0");
let arrow_down = document.getElementById("arrow-down-0");
arrow_down.style.display = "inline-block";
arrow_up.style.display = "none";
arrow_up = document.getElementById("arrow-up-1");
arrow_down = document.getElementById("arrow-down-1");
arrow_down.style.display = "inline-block";
arrow_up.style.display = "none";
showDomain();
});

// this function determines which domain options were checked
function showDomain() {
let selected = [];
if($("#filterMenu input:checked").length <= 0){
$('#filterMenu input:checkbox').each(function() {
selected.push($(this).attr('id'));
$(this).prop("checked", "true");
});
}
else{
$('#filterMenu input:checked').each(function() {
selected.push($(this).attr('id'));

});
}
filter_row(selected);
}

// this function sorts the table based on either ID or Name
function sortTable(col_no) {
let table = document.getElementById("ds-table");
let direction = "asc";
let table_switching = true;
let asc_direction = false;
let arrow_up = document.getElementById("arrow-up-"+col_no);
let arrow_down = document.getElementById("arrow-down-"+col_no);
arrow_down.style.display = "inline-block";
arrow_up.style.display = "none";
let rows = table.rows;
while (table_switching) {
table_switching = false;
if (direction == "desc"){
for (let i = 1; i <= (rows.length - 1); i++) {
for (let j = 1; j <= (rows.length - i - 1); j++) {
let x = rows[j].getElementsByTagName("TD")[col_no];
let y = rows[j + 1].getElementsByTagName("TD")[col_no];
if(x.innerText.toLowerCase() < y.innerText.toLowerCase()){
rows[j].parentNode.insertBefore(rows[j + 1], rows[j]);
}
}
}
arrow_up.style.display = "inline-block";
arrow_down.style.display = "none";
}
else{
for (let i = 1; i <= (rows.length - 1); i++) {
for (let j = 1; j <= (rows.length - i - 1); j++) {
let x = rows[j].getElementsByTagName("TD")[col_no];
let y = rows[j + 1].getElementsByTagName("TD")[col_no];
if(x.innerText.toLowerCase() > y.innerText.toLowerCase()){
rows[j].parentNode.insertBefore(rows[j + 1], rows[j]);
asc_direction = true;
}
}
}
}
if (direction == "asc" && !asc_direction) {
direction = "desc";
table_switching = true;
}
}
}
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)
});
26 changes: 26 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 @@ -619,6 +623,19 @@ pre {
}
/******/

.nestedlist {
counter-reset: item;
}

.nestedlist-item {
display: block;
}

.nestedlist-item::before {
content: counters(item, ".") ". ";
counter-increment: item;
}

/*CALLOUTS*/
// callouts style in the Contribute page
.bs-callout {
Expand Down Expand Up @@ -1051,6 +1068,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 +1159,10 @@ pre {
}
}

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

/*Card Blocks*/
// container of groups of cards
.expand-panel {
Expand Down
4 changes: 4 additions & 0 deletions attack-theme/static/style/_nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@
background-color: #dfdfdf;
}

.data-sources-menu {
padding-top: 15px;
}

.sidebar.nav {
// max-height: 60vh;
overflow-y: auto;
Expand Down
2 changes: 1 addition & 1 deletion attack-theme/templates/general/attack-index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<center>
<hr>
<h2 class="attack-box-heading">
ATT&amp;CK v14 is coming <strong>October 31st</strong>.
ATT&amp;CK v14 has been released.
<br>
We hope everyone will enjoy our latest treats!
</h2>
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>
Loading