docs: move the Learn page onto the Astro site and generate its statistics - #324
parthrohit22 wants to merge 8 commits into
Conversation
ritiksah141
left a comment
There was a problem hiding this comment.
The updates are internally consistent and the mechanics are clean (docs-only, no leftover stale counts, DCO signed, CI green), but the numbers were computed against a dev snapshot from before #277 and #320 merged. Since your fork sync, #277 added 10 new perimeter rules (az_net_018 through az_net_027) plus 10 playbooks, so every headline number is wrong at the merge target:
| Stat | This PR | Actual at dev tip |
|---|---|---|
| Azure security rules | 96 | 106 |
| Remediation playbooks | 96 | 106 per-rule (107 .sh files including the review playbook) |
| HIGH checks | 58 | 67 |
| MEDIUM checks | 32 | 33 |
| Network category bar | 23 (untouched) | 33 |
Compute 5 is the only value that still matches. Related issues that come with the same root cause:
- The category bar widths are scaled to Network 23 as the max, so they need rescaling to 33 = 100% after the rebase.
- The severity boxes do not sum to the headline: 58 + 32 + 4 = 94 vs a headline of 96, because there is no CRITICAL box. The repo has 2 CRITICAL rules. At dev tip the real split is HIGH 67, MEDIUM 33, LOW 4, CRITICAL 2.
- The "4 Compliance frameworks" metric: compliance/frameworks/ now holds 6 JSON files (CIS, NIST CSF, ISO 27001, SOC 2, ENISA PQC, NCSC PQC). If 4 is deliberate (core mapper frameworks only), fine as-is; otherwise update to 6.
This is timing, not process: your sync landed before those merges. The fix is to rebase onto current dev and regenerate: rules and playbooks to 106, HIGH 67, MEDIUM 33, LOW 4, add a CRITICAL 2 severity box, Network bar to 33 with rescaled widths, and the README feature table plus mermaid diagram to 106. Happy to re-review once that lands.
|
@ritiksah141 Rebased onto current dev and recomputed everything against the real tip: rules/playbooks 106, HIGH 67, MEDIUM 33, added the missing CRITICAL box (2), Network bar rescaled to 33. On the "4 vs 6" compliance frameworks question — good catch flagging it rather than guessing. Turns out 4 is deliberate: CI's green on the current head. |
ritiksah141
left a comment
There was a problem hiding this comment.
All good from my side. approving it
There was a problem hiding this comment.
Docs-only change, clean diff, DCO signed, CI green. The internal consistency of the PR is good: the category bars sum to 106, bar widths are correctly scaled to Network=33 as 100%, and the severity boxes (CRITICAL 2 + HIGH 67 + MEDIUM 33 + LOW 4) sum exactly to 106. The addition of the CRITICAL severity box and the rescaling of bar widths are correct.
However, the headline number is stale. The PR was generated from a fork snapshot that matches dev after #277 (az_net_018..027, 10 new network rules) but before #279 (az_cache_001, az_cosmos_001, az_cosmos_002, az_db_005..007, az_idn_016..025, az_stor_006..009 20 rules across four categories). Current dev tip has 126 rules, not 106. The delta breaks down as:
| Category | This PR | dev tip | Delta |
|---|---|---|---|
| Network | 33 | 35 | +2 |
| Identity | 15 | 25 | +10 (AZ-IDN-016..025) |
| Database | 4 | 8 | +4 (cosmos_001, db_005..007) |
| Storage | 5 | 9 | +4 (stor_006..009) |
| Total | 106 | 126 | +20 |
Severity at dev tip: CRITICAL 3, HIGH 82, MEDIUM 37, LOW 4 (total 126). The PR's severity split is correct for its 106-rule snapshot but wrong relative to the actual merge target.
What needs updating before merge:
- README and
docs/learn/index.htmlheadline rule/playbook count: 106 → 126 - Category bars: Network 33→35, Identity 15→25, Database 4→8, Storage 5→9, with bar widths rescaled to Network=35 as 100%
- Severity boxes: CRITICAL 3, HIGH 82, MEDIUM 37, LOW 4
HIGH-severity checksmetric card: 67 → 82
The "4 Compliance frameworks" metric is fine as a deliberate choice (CIS, NIST CSF, ISO 27001, SOC 2 the two PQC-specific frameworks are not part of the general compliance mapper narrative).
Happy to re-review once rebased to current dev tip and statistics regenerated.
Signed-off-by: parthrohit22 <parthrohit60@gmail.com>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: parthrohit22 <parthrohit60@gmail.com>
|
@TFT444 rebased onto current Verified against the repo at dev tip:
Net diff vs |
|
@TFT444 re-review please. All four items from your Sep 4 review are on The branch is 0 commits behind Ground truth, via the repo's own What's rendered, item by item:
Internal consistency, checked rather than assumed — I parsed the rendered bars back out of Severity boxes sum to 3 + 82 + 37 + 4 = 126, and the category bars sum to 126 independently. Every bar width equals The Net diff against |
Signed-off-by: parthrohit22 <parthrohit60@gmail.com>
Signed-off-by: parthrohit22 <parthrohit60@gmail.com>
Signed-off-by: parthrohit22 <parthrohit60@gmail.com>
The statistics in this PR were computed from an older dev snapshot. Ran .github/scripts/update_learn_page.py against the current merge target: 143 rules and 143 matching playbooks, CRITICAL 5 / HIGH 94 / MEDIUM 40 / LOW 4 (sums to 143), and the category chart rescaled to Network 35 as 100% with Kubernetes and Compute moved into their correct positions. The script itself failed on the two README feature rows first: their prose had been reworded upstream (the category list gained 'Kubernetes workloads', the playbook row became 'review-gated remediation script'), and the patterns pinned the whole sentence. Both now anchor on the row label and the unit that follows the number instead, so an unrelated reword no longer blocks a count refresh while the counts go stale - losing the row or the count shape still fails loudly. Two tests cover both directions. Signed-off-by: parthrohit22 <parthrohit60@gmail.com>
|
@TFT444 @ritiksah141 statistics regenerated against the current Rather than hand-editing them again, I ran
The category chart rescaled and re-sorted itself — Kubernetes moved to 21 and Compute to 7, so both jumped several rows. README feature table and both Mermaid nodes updated to 143. Worth flagging, since it is the root cause of this PR going stale twice: the script failed before it could update anything. The two README feature rows had been reworded upstream (the category list gained "Kubernetes workloads", the playbook row became "review-gated remediation script"), and the patterns pinned the entire sentence, so both matched zero times and the script exited 1 by design. That is the failure mode where a count silently goes stale while the automation looks healthy. Both patterns are now anchored on the row label and the unit that follows the number instead of the surrounding prose — losing the row itself, or the Verification: the script is idempotent (second run produces no diff, so CI commits only on a real change); On the "4 Compliance frameworks" metric — keeping it at 4 as you both agreed: CIS, NIST CSF, ISO 27001, SOC 2, with the two PQC framework files deliberately outside that narrative. The PR description was still describing the old 96-rule docs-only change, so it has been rewritten to match what this diff actually is. Re-requesting review. |
Summary
Moves the Learn page onto the Astro site as a generated route and refreshes the repository-derived statistics in it and in the README.
Why this PR exists
The hosted Learn page was connected to my fork rather than the upstream repository, so changes merged into
OWASP/openshielddid not appear on that deployment. The page also carried hand-maintained counts that went stale every time a rule landed — which is exactly what the two earlier review rounds on this PR caught.Changes
docs/learn/index.html(the hand-maintained page) is removed; the Learn route now lives atwebsite/src/pages/learn.astroand deploys with the rest of the site..github/scripts/update_learn_page.pyrecomputes every count fromscanner/rules/andplaybooks/cli/and rewrites both the Learn route and the README in place, so the numbers cannot drift again. It fails loudly when a pattern matches zero times rather than silently leaving a file unchanged.Runs N Azure security rules/(N playbooks)shape, still fails loudly.website/scripts/verify-site.mjscovers the generated route.Current statistics, regenerated against the merge target
The "4 Compliance frameworks" metric stays at 4 deliberately — CIS, NIST CSF, ISO 27001 and SOC 2, the general compliance mapper narrative. The two PQC-specific framework files are not part of it.
Validation
python .github/scripts/update_learn_page.py— regenerates cleanly, and a second run produces no diff (idempotent, so CI commits only on a real change).pytest tests/test_update_learn_page.py— 4 passed, including two new tests covering that a reworded README row still updates and that a removed row still fails.ruff check/ruff format --checkon the script and its tests — clean.npm run checkinwebsite/— build, configure-cms and verify pass for 15 HTML pages.