Repository navigation
feat(ingest): serve AISVS so AI system controls are citable instead of adapted from ASVS - #89
Merged
Merged
Conversation
…f adapted from ASVS Add an `aisvs` checklist pack pinned to tag v1.01, folder 1.01/en/: 213 requirements in 12 chapters, C-prefixed ids (C10.2.2), cumulative levels. Link chapters to cheat sheets from AISVS's own references, from cheat sheets that link AISVS, and from a reviewed curated map whose edges carry their own source. Share the checklist row clearing between ASVS, MASVS and AISVS, and ship the AISVS licence text. Closes #87
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
The corpus had no requirement set for AI systems.
owasp_checklistserved ASVS 5.0.0 for web and MASVS 2.1.0 for mobile only. Neither covers prompt injection screening, agent action approval, vector-store tenant isolation, MCP token validation, or training-data provenance. A finding about an MCP server cited an ASVS requirement by analogy, or cited nothing. A reviewer who checked that id found a requirement that did not cover the control.The Cheat Sheet Series already shipped the AI guidance (
AI_Agent_Security,MCP_Security,RAG_Security,LLM_Prompt_Injection_Prevention, and others), but those sheets had no requirement to link to.What changed
ingest/packs/aisvs.pyparses the 12 frozen chapter files of AISVS 1.01 into 213 requirements with chapter, section, and level. Ids keep the upstreamCprefix (C10.2.2), and a search hit citesaisvs 1.01 C10.2.2. Chapter objectives and section prose are retrievable chunks with no requirement row. The ingest skips the10.2.6"Requirement removed." tombstone and raises on any other unlevelled row, on a row outside its section, and on a chapter with no rows.sources.lock.ymlpinsOWASP/AISVSatv1.01and fetches the chapters asextra_paths, because the release's only asset is a PDF.build.EXPECTED_REQUIREMENTS["aisvs"] = 213, sorun_checksfails a build that comes up short.ingest_aisvs_guidance_links(ingest/links.py) writes chapter-levelaisvs_sectionguidance edges from three sources, in order of authority. First come AISVS's own chapter references, then cheat sheets that link an AISVS chapter, then the reviewed map iningest/aisvs_guidance.py. Each edge'ssourcenames which one it came from.checklistrow clearing that ASVS and MASVS each copied moves toingest/packs/checklist_rows.py, so AISVS does not add a third copy.TOOL_TRIGGER_TOPICS, licence texts (LICENSE-OWASP-AISVS,NOTICE, Dockerfile, smoke test), the image tag prefix, and the docs cover the new pack.docs/kb-packs.md"The AISVS pack" records each decision.Start reading at
src/owasp_kb/ingest/packs/aisvs.py. New tests:tests/ingest/test_aisvs.pyandtests/ingest/test_aisvs_links.py, with fixtures undertests/fixtures/aisvs/. The build, lock, and packaging tests are extended.Why this way
1.01/en/, not1.0/en/. The issue measured1.0/en/(191 requirements). Tagv1.01also ships1.01/, which1.0/LOCKED.mdnames "the latest stable release" and1.01/LOCKED.mdfreezes. So the acceptance figures become 57 / 167 / 213 rather than 51 / 146 / 191. This was decided on the issue before implementation.Cprefix is load-bearing.linksids carry no pack, so a bare10.2.2would sit beside ASVS'sV10.2.2.AI_Agent_Security,Secure_AI_Model_Ops, andSecure_Coding_with_AIlink to no requirement. To keep it honest, every entry names the cheat sheet sections that justify it, and every curated edge carries the sourceowasp-kb curated AISVS map. A curated chapter the release lacks also fails the build. Please review the map entry by entry. C5 (Access Control & Identity) has no edge, because no AI cheat sheet gives it a section of its own.LOCKED.mdlets automation change it.Evidence
Full suite, with
data/fetched at the pinned sources and both indexes built:The real build passes integrity:
The tools against that index:
The retrieval quality gate (
tests/test_retrieval_quality.py) passes 25 of 25 against both indexes, andowasp_roster(pack="aisvs", level="1")returns a complete 57-row roster. I mutation-checked the tombstone guard (15 tests fail without it) and the curated-chapter guard (1 test fails without it).What is left
Searching AISVS by control name through Appendix B is a separate issue.
Closes #87