Add OWASP Top 10 for LLM assessment coverage#53
Open
agasthik wants to merge 3 commits into
Open
Conversation
agasthik
added a commit
to agasthik/sample-aiml-security-assessment
that referenced
this pull request
Jul 19, 2026
CI's ruff (0.15.20) collapses a few multi-line literals in tests/test_sagemaker_checks.py that this branch left unformatted, so python-lint failed on PR aws-samples#53. Reformat to match ruff's default style.
agasthik
force-pushed
the
feat-owasp-top-llm
branch
from
July 19, 2026 01:47
a8f9b81 to
17c0cb0
Compare
Regenerate the sample HTML and dashboard screenshots so the checked-in sample reflects the OWASP Top 10 for LLM section added on this branch.
agasthik
force-pushed
the
feat-owasp-top-llm
branch
from
July 19, 2026 02:36
fa64711 to
24160ce
Compare
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.
Closes #52
Summary
OW-01…OW-12and renders them in the HTML report under a new "By Compliance Standard" section.OWASP_CHECK_MAPPINGSin the OWASP Lambda; OW-11 and OW-12 are native LLM07 checks (Lambda env-var inspection for embedded system prompts, Bedrock Guardrail DENY-topic inspection for system-prompt disclosure).EnableFinServAssessment=false; in that case FS-* rows are consumed silently and hidden from the report UI.EnableOWASPAssessmentCFN parameter ontemplate.yaml,template-multi-account.yaml, anddeployment/aiml-security-single-account.yaml/deployment/2-aiml-security-codebuild.yaml, threaded throughbuildspec.yml→ Step Functions execution input → OWASP Choice branch instatemachine/assessments.asl.json.COMPLIANCE_STANDARDSregistry inreport_template.pyso future compliance standards (NIST AI RMF, EU AI Act) can be added as data-only changes.Design references
Full OW-## → LLM-## mapping and per-check derivation are documented in
docs/SECURITY_CHECKS_OWASP.md.Test plan
.venv/bin/python -m pytest tests/ -v --tb=short— core + report tests (includes newtest_owasp_checks.py,test_report_template_owasp.py, andtest_consolidate_finserv.py::test_fs_rows_hidden_when_enable_finserv_false)..venv/bin/python -m pytest aiml-security-assessment/functions/security/finserv_tests/ -v --tb=short— FinServ suite unaffected.(cd aiml-security-assessment/functions/security/generate_consolidated_report && ../../../../.venv/bin/python -m pytest test_generate_report.py -v --tb=short)— report pipeline..venv/bin/ruff check aiml-security-assessment/functions/security/and.venv/bin/ruff format --check aiml-security-assessment/functions/security/clean..venv/bin/cfn-lint deployment/*.yaml aiml-security-assessment/template.yaml aiml-security-assessment/template-multi-account.yamlclean.sam validate --template aiml-security-assessment/template.yaml --lintclean.EnableOWASPAssessment=true,EnableFinServAssessment=true: verify HTML report shows the "By Compliance Standard → OWASP Top 10 LLM" section with OW-01…OW-12 rows.EnableOWASPAssessment=true,EnableFinServAssessment=false: verify OW-* rows render, nofinservsection in the UI, and FinServ CSV still lands in S3.false: verify no OW-* rows and no OWASP section.