Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 19, 2025

MASWE pages currently show Tests that reference each weakness. This adds a Best Practices section showing platform-specific mitigation guidance from those tests.

Changes

Cross-reference collection (docs/hooks/add-cross-references.py)

  • Added weakness-to-best-practices mapping that aggregates best-practices from tests referencing each weakness
  • Generates Best Practices section on MASWE pages after Tests section using .mas-best-button styling

Styling (docs/stylesheets/extra.css)

  • Added .mas-best-button class using --tag-color-best (#087a21ff green) to visually distinguish from test buttons (blue)

Example

For MASWE-0001, tests MASTG-TEST-0231 and MASTG-TEST-0203 both reference best-practices: [MASTG-BEST-0002]. The hook now:

  1. Detects these tests have weakness: MASWE-0001
  2. Collects their referenced best-practices
  3. Renders MASTG-BEST-0002 as a green button on MASWE-0001 page

Screenshot

MASWE-0001 with Best Practices section

Tests section (blue) shows test coverage, Best Practices section (green) shows platform-specific mitigation guidance extracted from those tests.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/search/issues
    • Triggering command: /usr/bin/python3 /home/REDACTED/.local/bin/mkdocs build --clean --verbose (http block)
    • Triggering command: /usr/bin/python3 /home/REDACTED/.local/bin/mkdocs serve --dev-addr 0.0.0.0:8000 (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Add Platform-specific best practices to MASWE pages</issue_title>
<issue_description>Currently, MASWE pages show an extra section "Tests" which contains a styled list of MASTG-TEST components that have the specific MASWE listed in their metadata weakness.

We need to add a new "Best Practices" section (right after the "Tests" section) to each MASWE page when the corresponding tests also list best-practices in their metadata.

Example:

---
id: MASTG-TEST-0231
...
weakness: MASWE-0001
best-practices: [MASTG-BEST-0002]
---

...

They should use --tag-color-best from docs/stylesheets/extra.css</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI self-assigned this Nov 19, 2025
@cpholguera cpholguera marked this pull request as ready for review November 19, 2025 07:19
@cpholguera cpholguera changed the title [WIP] Add best practices section to MASWE pages Add best practices section to MASWE pages Nov 19, 2025
Copilot AI changed the title Add best practices section to MASWE pages Add Best Practices section to MASWE pages Nov 19, 2025
Copilot AI requested a review from cpholguera November 19, 2025 07:21
Copilot finished work on behalf of cpholguera November 19, 2025 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Platform-specific best practices to MASWE pages

2 participants