docs(devsecops): add Policy as Code section - #592
Conversation
Sidebar Configuration ReminderThis PR includes added, renamed, or removed documentation files:
Please ensure that:
See Contributing Guide – Sidebar & Navigation for more details. This is an automated reminder. If this PR doesn't need sidebar changes, you can ignore this message. |
213b780 to
89b7610
Compare
frameworks-volunteer
left a comment
There was a problem hiding this comment.
Model: z-ai/glm-5.2 Reasoning: medium Provider: openrouter
Security review: clean. No hardcoded secrets, no injection vectors, no unsafe code patterns. Rego snippets are illustrative and fenced as python (documented workaround for the Shiki grammar gap). All external links are legitimate.
QA review: well-structured, technically sound, and consistent with existing DevSecOps conventions. Internal links resolve, frontmatter is valid, wordlist additions are appropriate, sidebar has dev: true, and the index.mdx for the new folder matches the isolation/ pattern.
One minor nit:
overview.mdxline ~203: "Two things have to come from your organization." is followed by three bullet points. Update the count to "Three" or merge the second and third bullets.
Approving — the nit above can be addressed in a follow-up commit.
|
Thanks for the review. Fixed the count nit in 5ee026e — the third bullet was a restatement, so I folded it into the rule-content bullet and kept "Two things". |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
There was a problem hiding this comment.
I've left a few comments on the content with both one-click apply suggestions and requests for updates on your end.
Also, reviewing the overview page, I think that the basics paragraph is a little bit too verbose and could use a trim, as we don't want to overwhelm readers from the landing page of the subsection.
Feel free to tag me again here as soon as these things get implemented + merge conflicts get solved so I can provide a final review!🙏🏻
Adds docs/pages/devsecops/policy-as-code/ with four pages covering how a policy engine is applied across the CI/CD pipeline, and what NIST SP 800-204D requires of it: - overview: what a policy engine decides, the two evaluation modes (pipeline artifacts versus platform configuration), and the four places the standard names a policy enforcement engine - ci-pipeline: commit, merge, and build gates - release-and-runtime: publishing identity, deployment gates, drift detection - governance: which violations block, who may override, where thresholds come from, and how rules are owned and retired Existing DevSecOps pages document which controls to enable. These cover the decision layer above them, and link out to those pages rather than restating their content. Rego examples are validated against OPA 1.4.2, including the expiring-exception behaviour the governance page relies on. They are fenced as `python` because the site's Shiki bundle has no Rego grammar and an unrecognized language fails the build; the overview page carries a note to that effect. Also: - Registers the section in vocs.config.ts as a nested group with dev: true - Updates the DevSecOps overview contents list - Adds an s1ns3nz0 entry to contributors.json - Adds Rekor to wordlist.txt for the spell check Verified: pnpm run docs:build, cspell, and markdownlint-cli2 all pass. Claude-Session: https://claude.ai/code/session_01CPQ1FcHGiBKWPd8waT7uGx
…standard Applies the standard introduced in security-alliance#561 and the sentence-case heading rule from security-alliance#595: - Renames 'Further Reading & Tools' to 'Further reading' on all four pages - Renames the overview's page map section to 'What this framework covers' - Moves three Rego comments into the surrounding prose The last change is a workaround rather than an improvement. utils/validate-content.cjs extracts headings without stripping fenced code, so a line-start '#' comment inside a Rego block parses as an H1 and any following H3 is reported as heading_level_skip. Noted on the PR. Claude-Session: https://claude.ai/code/session_01CPQ1FcHGiBKWPd8waT7uGx
Address review nit: "Two things have to come from your organization" was followed by three bullets. Merge the trailing bullet into the rule-content item so the count matches. Claude-Session: https://claude.ai/code/session_01CPQ1FcHGiBKWPd8waT7uGx
Address @scode2277's review on security-alliance#592: - Attribute SP 800-204D precisely: it names a policy enforcement engine as one technique and OPA as an example, rather than "officially recommending" either. - Move the python-fence note off the overview, which has no code blocks, and place it once above the first Rego block on each page that does. - Rewrite the tj-actions passage with the reported figures (23,000+ repos, ~218 leaked secrets, mostly short-lived workflow tokens). - Replace the publish-stage paragraph that restated the "two stages hold by convention" section later on the same page. - Apply RFC modality to all four checklists, per the normative modality rules in docs/pages/contribute/style-and-terminology.mdx. - Trim "The basics" on the overview: fold policy-data detail into its definition, collapse the SSDF and 800-204D descriptions, and drop the bulleted restatement of the enforcement-point consequences. Claude-Session: https://claude.ai/code/session_01CPQ1FcHGiBKWPd8waT7uGx
5ee026e to
b59aec2
Compare
|
Thanks for the thorough review @scode2277 — all six comments are addressed in Suggestions applied as written:
Python-fence note: removed from RFC modality: applied. While doing it I found Overview trim: "The basics" went from ~70 lines to ~45. I folded the policy-data explanation into its own definition bullet, collapsed the SSDF and 800-204D sub-bullets into one line each, and dropped the bulleted restatement of the enforcement-point consequences. Kept the PDP/PEP table since it carries the "one engine, many enforcement points" idea that the rest of the section builds on — let me know if you'd rather that moved to a stage page too. Conflicts: rebased onto Verified: Ready for another look whenever you have time. |
scode2277
left a comment
There was a problem hiding this comment.
Thanks for all the work! I've reviewed everything again and I've noted a couple things still:
- The rego notes: I've actually looked better into the errors and it appears that the problem is to be Shiki's (vocs' provider of language support) + vocs' (our docs framework). I will take over this matter and will file issues on both their repos to solve this so we can actually use the correct code fences.
For now, please remove the notes and leave the python blocks as they are. I'll switch them over once the issues are solved. - I've noted there is a fair amount of you/yours across all the pages. We recently updated our style guide and content model to avoid this. We prefer to keep the content as broad as possible, without assuming it will only be read by individuals rather than by organizations or teams too. Could you update those references please?
Thanks for flagging the validator bug, I'll take it over from here, no need for a separate PR on your side.
Again, thanks for this work and let me know when these are sorted so I can approve this!🙏🏻
Second round of review feedback on security-alliance#592: - Drop the three python-fence notes. The fence is a Shiki/vocs grammar gap being tracked upstream by the maintainers, not something readers need explained on the page. - Replace all 24 uses of you/your with concrete subjects, per the "concrete subjects: teams, operators, signers, maintainers, responders, stewards" rule in docs/pages/contribute/style-and-terminology.mdx. Pages should not assume an individual reader rather than an organization. The overview heading "What a policy engine gives you" becomes "What a policy engine provides"; no page links to the old anchor. Claude-Session: https://claude.ai/code/session_01CPQ1FcHGiBKWPd8waT7uGx
|
Both done in Rego notes: removed all three. Thanks for digging into the actual cause — I'd assumed it was a fixed limitation. The Second person: replaced all 24 occurrences of you/your across the four pages. I used the "concrete subjects: teams, operators, signers, maintainers, responders, stewards" line in the style guide as the reference — so Understood on the validator, I'll leave that with you.
|
What does this PR change?
Adds a new
policy-as-codesection under DevSecOps, covering how a policy engine is appliedacross the CI/CD pipeline and what NIST SP 800-204D requires of it.
Four pages under
docs/pages/devsecops/policy-as-code/:platform configuration), and the four places SP 800-204D names a policy enforcement engine
from, and how rules are owned and retired
The existing DevSecOps pages document which controls to enable. These pages cover the decision
layer above them: what the engine evaluates, what evidence each stage produces, and which
decisions a person is allowed to override. Every control referenced here links out to the page
that documents it rather than restating it —
continuous-integration-continuous-deployment,repository-hardening,security-testing,code-signing, and theisolation/pages.Background
This follows a series I recently wrote on NIST SP 800-204D and CI/CD supply chain security:
https://miata.cloud/tags/cicd-security/
The standard's coverage here follows that series. The policy-decision material — rule
classification, threshold derivation, exception handling, and ownership — is new and specific to
this contribution.
On AI assistance
I am not a native English speaker, and I used AI assistance heavily for the English prose. The
structure, scope, and technical decisions are mine, and I verified every claim against its
source:
states that the standard names a policy enforcement engine and names OPA as an example, not
that it mandates either — section 5.1.1 uses "techniques such as," and 5.1.2 uses "(e.g., Open
Policy Agent (OPA))"
the governance page's argument depends on
Flagging this because the contributing guidelines draw a line at content entirely generated by
AI. I do not believe this crosses it, but I would rather say so up front than have it surface in
review.
Notes for reviewers
Rego is fenced as
python. The site's Shiki bundle has no Rego grammar, and an unrecognizedlanguage fails the build. Python is the closest available approximation and highlights Rego
reasonably. There is a note to that effect at the bottom of the overview page. Happy to switch to
an unhighlighted fence if you would prefer accuracy over readability here.
Folder rather than a single page. The material ran past 1,500 lines. Following the structure
of
devsecops/isolation/, it is split into four pages of 257–526 lines each, which is within therange of existing DevSecOps pages.
Normalization standard. Rebased onto
developand applied the standard from #561 and thesentence-case rule from #595:
Further readinginstead ofFurther Reading & Tools, andWhat this framework coversfor the overview's page map.pnpm run validate:content --path docs/pages/devsecops/policy-as-codereports 4 passed, 0 failed.One validator issue worth flagging.
utils/validate-content.cjsextracts headings withoutstripping fenced code blocks, so a line-start
#comment inside a code block parses as an H1.Any
###that follows is then reported asheading_level_skip. This fired on two of thesepages because Rego uses
#for comments. I worked around it by moving the comments into thesurrounding prose, but the same thing will hit any page with Python, Ruby, shell, or YAML
comments at line start. The fix is a one-line change: run
stripCode(body)beforeheadings().Happy to open a separate PR for that if useful.
Verification
pnpm run docs:buildpassespnpm run validate:content --path docs/pages/devsecops/policy-as-code: 4 passed, 0 failedcspellclean (addedRekortowordlist.txt)markdownlint-cli2reports 0 issues across all four pagesType of change
If applicable
vocs.config.tswith thedev: trueparameter