module templates incorrectly assume external_reference will follow S-Code and G-Code conventions and case
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- html
- Domain
- frontend
Research direction
Start with modules/groups/templates/group-index.html around line 47, where the groups table builds links from row.id. Compare the href with the displayed label and verify generation using an external ID such as MyCustomNotUpperCaseCode; done means the generated card links to the matching case-sensitive directory while the label remains appropriate.
Written by the indexing model from the issue text.
Description
BLUF:
please drop the use the "|upper" in creation of the href in a table's card element.
When customizing STIX objects for use by the attack-website generation on our internal site, we discovered that the pelican templates for groups (specifically, but elsewhere as well) are inconsistent when creating the cards for groups and other tables.
For the display name, upper case by default may be appropriate for table uniformity of appearance. Unfortunately, forcing the href to use a specific case or perhaps use a different URL can result in an invalid URL.
For example from the enterprise ATTACK:
...
"external_references": [
{
"source_name": "mitre-attack",
"external_id": "G0001",
"url": "https://attack.mitre.org/groups/G0001"
},
....
"name": "Axiom",
....
The site generation code will create a directory /groups/G0001.
And the ID field for the card in the group table will look like:
<td>
<a href="/groups/G0001"> G0001 </a>
</td>
That comes from the group-index.html template in modules/groups/templates, specifically starting at line 47:
<tbody>
{% for row in parsed.groups_table %}
<tr>
<td>
<a href="/groups/{{row.id|upper}}"> {{row.id|upper}} </a>
</td>
<td>
<a href="/groups/{{row.id|upper}}"> {{row.name}} </a>
</td>
Note the "|upper" directive
The problem comes, when the ID case may not natively be upper
for example an intrusion set named "SomeFineGroupName" has an external reference appears as:
{
"source_name": "mitre-attack",
"url": "https://my-attack-website.myorg.com/groups/MyCustomNotUpperCaseCode"
"external_id": "MyCustomNotUpperCaseCode"
}
The resulting directory entry will be generated as /group/MyCustomNotUpperCaseCode, matching the ID in the stix object.
The resulting card for the groups table however, will result in an ref such as:
<td>
<a href="/groups/MYCUSTOMNOTUPPERCASECODE"> MYCUSTOMNOTUPPERCASECODE </a>
</td>
The solution is to drop the "|upper" directive in the href, while keeping the label as is if desired.
- Dominant language
- HTML
- Stars
- 590
- Forks
- 175
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 3
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mitre-attack/attack-website
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mitre-attack/attack-website#628 · 1 comment ·
Maintainers usually reply within 3 days
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
mitre-attack/attack-website#626 ·
Maintainers usually reply within 3 days
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
mitre-attack/attack-website#596 ·
Maintainers usually reply within 3 days
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
mitre-attack/attack-website#571 · 2 comments · 1 reaction ·
Maintainers usually reply within 3 days
-
[Accessibility] Navbar logo missing alt text causing WCAG violationMay be free again @jondricek claimed this 236 days ago, and no pull request is open. Open
mitre-attack/attack-website#563 · 1 assignee ·
Maintainers usually reply within 3 days
All issues in mitre-attack/attack-website
Similar issues
-
bug: directory index route root priority is overwritten when wildcard is falsePossibly taken @TalhaHunter101 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
fastify/fastify-static#617 ·
-
Hardware attribute name "app Connection Support" has inconsistent casingPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
walletbeat/walletbeat#1628 ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
facioquo/stock-indicators-dotnet#2316 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vercel-labs/skills#2460 ·
Maintainers usually reply within 1 day