AZ-400 ยท Security and compliance scanning
Container scanning and CodeQL in containers
Scanning images in registries and in pipelines (Defender for Containers, Trivy-style actions), CodeQL action configuration, build modes and running CodeQL inside a container, SARIF upload.
Key points
- Images can be scanned in the pipeline (a scanner such as Trivy run against the built image) and in the registry (Defender for Containers assesses ACR and other registries).
- CodeQL runs through github/codeql-action: init sets languages and queries, an optional build step follows for compiled code, and analyze produces and uploads results.
- Third-party tools publish results with upload-sarif, which needs the security-events: write permission.
Practice questions
Which Defender for Cloud plan assesses vulnerabilities in images stored in Azure Container Registry?
- Defender for Containers
- Defender for Storage
- Defender for App Service
- Defender for DNS
Show answer
Answer: A. Defender for Containers
Defender for Containers provides registry vulnerability assessment using Microsoft Defender Vulnerability Management. The other plans target different resources.
Which steps belong in a basic GitHub Actions workflow that runs CodeQL analysis?
- actions/checkout to get the source
- github/codeql-action/init with the languages input
- github/codeql-action/analyze to run and upload results
- An Azure CLI login step
- A Dependabot version update step
Show answer
Answer: A. actions/checkout to get the source, B. github/codeql-action/init with the languages input, C. github/codeql-action/analyze to run and upload results
A CodeQL workflow checks out the code, initializes CodeQL with the languages, and runs analyze. Azure login and Dependabot steps are unrelated to code scanning.
True or false: uploading a second SARIF file for the same tool and category adds its results next to the earlier ones.
Show answer
Answer: False
False. A new upload with the same tool and category overwrites the previous results. Use distinct categories to keep separate analyses of the same commit.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
