SAST / SCA in CI catches insecure AI suggestions
Demonstrate that SAST and SCA tools are actively integrated into the CI pipeline with configurations capable of detecting common security vulnerabilities that may be introduced by AI-assisted code generation, and that these tools prevent merging or deployment of code failing security checks.
Description
What this control does
This control requires Static Application Security Testing (SAST) and Software Composition Analysis (SCA) tools to be integrated into the Continuous Integration (CI) pipeline, with rulesets configured to detect insecure code patterns that may originate from AI-assisted coding tools such as GitHub Copilot, ChatGPT, or other LLM-based code generators. The tools automatically scan code commits for vulnerabilities like SQL injection, hardcoded secrets, use of vulnerable dependencies, and other OWASP Top 10 weaknesses before merge or deployment. This control is critical because AI coding assistants can suggest functionally correct but insecure code patterns learned from public repositories, requiring automated safety nets to prevent vulnerable suggestions from reaching production.
Control objective
What auditing this proves
Demonstrate that SAST and SCA tools are actively integrated into the CI pipeline with configurations capable of detecting common security vulnerabilities that may be introduced by AI-assisted code generation, and that these tools prevent merging or deployment of code failing security checks.
Associated risks
Risks this control addresses
- AI coding assistants suggest code containing SQL injection, command injection, or other injection vulnerabilities that developers accept without security review
- LLM-generated code includes hardcoded credentials, API keys, or cryptographic secrets that are committed to version control
- AI tools recommend use of deprecated or vulnerable third-party libraries with known CVEs that are incorporated into the codebase
- Developers bypass manual code review by trusting AI suggestions, allowing insecure deserialization or XML external entity (XXE) vulnerabilities into production
- AI-generated cryptographic implementations use weak algorithms or improper configurations that pass functional testing but create exploitable weaknesses
- Code suggested by AI assistants contains cross-site scripting (XSS) vulnerabilities in user input handling that evade peer review
- Vulnerable code patterns from outdated training data in AI models are replicated across multiple projects without detection
Testing procedure
How an auditor verifies this control
- Inventory all CI/CD pipelines used for application development and identify which have SAST and SCA tooling integrated (e.g., SonarQube, Snyk, Checkmarx, GitLab SAST, GitHub Advanced Security).
- Review CI pipeline configuration files (e.g., .gitlab-ci.yml, .github/workflows/, Jenkinsfile) to verify SAST and SCA scanning stages are mandatory and occur before merge/deployment gates.
- Examine SAST and SCA tool rulesets and policies to confirm they include detection of common AI-suggested vulnerabilities including injection flaws, hardcoded secrets, insecure cryptography, and vulnerable dependencies.
- Select a sample of 10-15 recent pull requests or merge requests and verify that SAST/SCA scan results are documented and that findings were addressed or formally accepted before merge.
- Review pipeline logs and tool dashboards to confirm scans execute automatically on every code commit or pull request without manual triggering.
- Test the enforcement mechanism by attempting to merge a branch containing a known vulnerability (e.g., test SQL injection pattern) to verify the pipeline blocks the merge or triggers mandatory review.
- Examine false-positive triage and suppression processes to ensure legitimate security findings are not routinely waived without documented risk acceptance by security team.
- Review integration between SAST/SCA tools and ticketing systems (e.g., Jira, ServiceNow) to verify that critical and high-severity findings automatically create remediation tasks assigned to development teams.
Where this control is tested