Skip to content

Commit

Permalink
sonar cloud fixes and contribute page
Browse files Browse the repository at this point in the history
  • Loading branch information
adpare committed Jan 21, 2024
1 parent 4e34ca6 commit 1cf1216
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 142 deletions.
2 changes: 0 additions & 2 deletions attack-theme/static/style/_layouts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,6 @@ a.partial-underline {
}

.example-container {
// background-color: color-alternate(body);
padding: to-rem(15);

.examples-div {
Expand Down Expand Up @@ -916,7 +915,6 @@ a.partial-underline {
h5 {
@include font("Roboto-Regular");
}
@include collapsible("after");
}

// style of card titles in Related Projects
Expand Down
6 changes: 3 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) %}
{% 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) %}
<div class="contact-card card">
{% if header_background %}
<div class="card-header background">
Expand Down Expand Up @@ -42,8 +42,8 @@ <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}}">
<button type="button" class="slide-button">
<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 %}>
<span class="slide-button-text text-nowrap">
{{button.label}}
</span>
Expand Down
19 changes: 0 additions & 19 deletions modules/resources/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,22 +306,6 @@ def generate_contribute_page():
ms = util.relationshipgetters.get_ms()
contributors = util.stixhelpers.get_contributors(ms)

page_count = 3
column_count = 3

# # Creates a list of pages broken down into A-E, F-N, O-Z(and misc)
# # pages = divide_list(contributors, page_count)
# pages = []
# for i in contributors:
# match i[0]:
# case "A" | "B" | "C" | "D" | "E":
# pages[0].append(i)
# case "F"|"G"|"H"|"I"|"J"|"K"|"L"|"M"|"N":
# pages[1].append(i)
# case _: # the rest of the letters and misc characters
# pages[2].append(i)


data = {}

data["contributors"] = []
Expand All @@ -330,9 +314,6 @@ def generate_contribute_page():
contributors_second_col = []
contributors_third_col = []

# half = math.ceil((len(contributors)) / 2)
# list_size = len(contributors)

third = math.ceil(len(contributors) / 3)

for index in range(0, third):
Expand Down
178 changes: 60 additions & 118 deletions modules/resources/templates/contribute.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{% set title = "Contribute | MITRE ATT&CK&reg;" -%}
{% set parsed = page.data | from_json %}
{% import 'macros/navigation.html' as navigation %}
{% import 'macros/contact_card.html' as contact_card %}

{% block innerleft %}
<div id="sidebars"></div>
Expand Down Expand Up @@ -46,99 +47,38 @@ <h1>Contribute</h1>
</button>
</a>
</p>
<h2>What we're looking for</h2>
<div class="my-5">
<h2>What we're looking for</h2>
<!-- START USA CARD CONTENT-->
<ul class="usa-card-group flex-wrap">
<li class="usa-card grid-col-4">
<div class="usa-card__container">
<div class="usa-card__header">
<h3 class="usa-card__heading contribution-headers">Sub-Techniques and Techniques</h3>
</div>
<div class="usa-card__body">
<p>
Let us know what new variations of behaviors real adversaries are using in the wild! Please share
a brief description of the behavior, any references or knowledge about how it works and was used,
and how this behavior is not already captured in ATT&amp;CK.
</p>
</div>
<div class="usa-card__footer">
<div class="margin-y-3">
<div class="slide-button-container">
<a
href="#techniques-modal"
aria-controls="techniques-modal"
>
<button type="button" data-toggle="modal" class="slide-button" data-target="#techniques-modal">
<span class="slide-button-text">
See an example
</span>
</button>
</a>
</div>
</div>
</div>
</div>
</li>
<li class="usa-card grid-col-4">
<div class="usa-card__container">
<div class="usa-card__header">
<h3 class="usa-card__heading contribution-headers">Threat Intelligence</h3>
</div>
<div class="usa-card__body">
<p>
We map Group and Software examples on our site, and appreciate your help with referenced information about
how Groups and Software samples use ATT&CK techniques. Please share the sub-technique or technique name,
group or associated group name, a brief description of how the technique is implemented, and the publicly-available reference.
</p>
</div>
<div class="usa-card__footer">
<div class="margin-y-3">
<div class="slide-button-container">
<a
href="#threat-intel-modal"
aria-controls="threat-intel-modal"
>
<button type="button" data-toggle="modal" class="slide-button" data-target="#threat-intel-modal">
<span class="slide-button-text">
See an example
</span>
</button>
</a>
</div>
</div>
</div>
</li>
<li class="usa-card grid-col-4">
<div class="usa-card__container">
<div class="usa-card__header">
<h3 class="usa-card__heading contribution-headers">Website Content Errors</h3>
</div>
<div class="usa-card__body">
<p>
If you find errors or typos on the site related to content, please let us know by
submitting the url where you found the error and a short description. Examples include
typos and syntax errors, improperly formatted web pages, and 404 errors when links are clicked.
</p>
</div>
<div class="usa-card__footer">
<div class="margin-y-3">
<div class="slide-button-container">
<a
href="#errors-modal"
aria-controls="errors-modal"
>
<button type="button" data-toggle="modal" class="slide-button" data-target="#errors-modal">
<span class="slide-button-text">
See an example
</span>
</button>
</a>
</div>
</div>
</div>
</div>
</li>
</ul>
<div class="card-deck mt-4">
{{contact_card.render("Sub-Techniques and Techniques", "",
"Let us know what new variations of behaviors real adversaries are using in the wild! Please share
a brief description of the behavior, any references or knowledge about how it works and was used,
and how this behavior is not already captured in ATT&amp;CK.",
buttons=[
{"label": "See an example", "url": "#techniques-modal"}
],
fa_icon=None, invert_icon=True, header_background=True, footer_description=None, header_subtitle=None, card_modal="techniques-modal")}}

{{contact_card.render("Threat Intelligence", "",
"We map Group and Software examples on our site, and appreciate your help with referenced information about
how Groups and Software samples use ATT&CK techniques. Please share the sub-technique or technique name,
group or associated group name, a brief description of how the technique is implemented, and the publicly-available reference.",
buttons=[
{"label": "See an example", "url": "#threat-intel-modal"}
],
fa_icon=None, invert_icon=True, header_background=True, footer_description=None, header_subtitle=None, card_modal="threat-intel-modal")}}

{{contact_card.render("Website Content Errors", "",
"If you find errors or typos on the site related to content, please let us know by
submitting the url where you found the error and a short description. Examples include
typos and syntax errors, improperly formatted web pages, and 404 errors when links are clicked.",
buttons=[
{"label": "See an example", "url": "#errors-modal"}
],
fa_icon=None, invert_icon=True, header_background=True, footer_description=None, header_subtitle=None, card_modal="errors-modal")}}
</div>
</div>
<!-- Begin Modals -->
<!-- Start Techniques Modal -->
<div class="modal fade" id="techniques-modal" tabindex="-1" role="dialog" aria-labelledby="techniques-modal" aria-hidden="true">
Expand Down Expand Up @@ -338,32 +278,34 @@ <h5 class="modal-title" id="errors-modal-label">Website Content Error</h5>
<!-- END USA CARD CONTENT -->

<!-- Begin Contributor List -->
<h2>Contributors</h2>
<p>
The following individuals or organizations have contributed information
regarding the existence of a technique, details on how to detect and/or mitigate
use of a technique, or threat intelligence on adversary use:
</p>
<div>
<div class="scrollable-box">
<div class="row">
{% for col in parsed.contributors %}
<div class="col">
<ul>
{% for row in col %}
<li>
{{row}}
</li>
{% endfor %}
</ul>
</div>
{% endfor %}
</div>
</div>
</div>
<p>
Thanks to those who have contributed to ATT&amp;CK!
</p>
<div class="my-5">
<h2>Contributors</h2>
<p>
The following individuals or organizations have contributed information
regarding the existence of a technique, details on how to detect and/or mitigate
use of a technique, or threat intelligence on adversary use:
</p>
<div>
<div class="scrollable-box">
<div class="row">
{% for col in parsed.contributors %}
<div class="col">
<ul>
{% for row in col %}
<li>
{{row}}
</li>
{% endfor %}
</ul>
</div>
{% endfor %}
</div>
</div>
</div>
<p>
Thanks to those who have contributed to ATT&amp;CK!
</p>
</div>
<!-- End Contributor List -->
</div>
</div>
Expand Down

0 comments on commit 1cf1216

Please sign in to comment.