Bitzu

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.

Source: https://learn.microsoft.com/en-us/azure/defender-for-cloud/agentless-container-registry-vulnerability-assessment

Practice questions

Single choice

Which Defender for Cloud plan assesses vulnerabilities in images stored in Azure Container Registry?

  1. Defender for Containers
  2. Defender for Storage
  3. Defender for App Service
  4. 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.

Select all that apply

Which steps belong in a basic GitHub Actions workflow that runs CodeQL analysis?

  1. actions/checkout to get the source
  2. github/codeql-action/init with the languages input
  3. github/codeql-action/analyze to run and upload results
  4. An Azure CLI login step
  5. 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

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.

Download on the App StoreGet it on Google Play

More AZ-400 topics in this module