4 of the 8 questions we have for this objective, shown with the answer and the reasoning.
Automate security and compliance scanning
Blue Yonder Airlines has a Node.js repository on GitHub named byair/booking-api with a package-lock.json file. The team wants to be notified automatically whenever a newly published security advisory affects any of its direct or transitive npm dependencies, without writing or changing any workflow.
What should you enable?
- AThe dependency graph and Dependabot alertsDependabot alerts compare the dependency graph built from the manifest and lock file with the GitHub Advisory Database and raise an alert when a new advisory affects any direct or transitive dependency.
- BDependabot version updates through a dependabot.yml fileVersion updates open pull requests to keep dependencies current on a schedule regardless of vulnerabilities, and they require adding a configuration file.
- CCode scanning with CodeQL default setupCodeQL analyzes the repository's own source code, not known vulnerabilities in third-party packages.
- DSecret scanningSecret scanning detects credentials committed to the repository and has no knowledge of dependency advisories.
Why: Dependabot alerts are GitHub's software composition analysis feature. They rely on the dependency graph, which parses manifests and lock files to find direct and transitive dependencies, and they match those against the GitHub Advisory Database whenever either side changes. No workflow is required, which matches the scenario. Dependabot security updates can be enabled on top to open pull requests that upgrade a vulnerable package to the minimum patched version, while version updates are a separate, schedule-driven feature.
Automate security and compliance scanning
Humongous Insurance builds container images in Azure Pipelines and pushes them to an Azure Container Registry named crhumongousprod. The pipeline must fail before the push if an image has any critical vulnerability. In addition, images already stored in crhumongousprod must be reassessed automatically when new vulnerabilities are disclosed, with findings shown in Microsoft Defender for Cloud.
Which two actions should you perform? Each correct answer presents part of the solution.
- AAdd a step before the push that runs Trivy against the built image with --severity CRITICAL and --exit-code 1Trivy scans the local image in the pipeline, and a non-zero exit code on critical findings fails the job before the image reaches the registry.
- BEnable the Microsoft Defender for Containers plan on the subscription that contains crhumongousprodDefender for Containers uses Microsoft Defender Vulnerability Management to scan registry images on push and reassess them continuously, and its findings appear as Defender for Cloud recommendations.
- CEnable Dependabot version updates for the docker ecosystem on the DockerfileDependabot can propose base image tag updates, but it does not scan built images for vulnerabilities or block a pipeline.
- DEnable content trust on crhumongousprodContent trust signs and verifies image provenance; it does not detect vulnerabilities in image contents.
- EAdd CodeQL analysis tasks to the pipeline for the application source codeCodeQL finds weaknesses in first-party source code; it does not inventory operating system packages or libraries inside the image.
Why: Container scanning needs two complementary controls. A shift-left scan in the pipeline, with a tool such as Trivy or the Microsoft Security DevOps extension, gates the build before an image is published. A registry-side scan with Defender for Containers covers the time after publication, because new CVEs are disclosed against images that were clean when pushed. Signing and Dependabot address provenance and update hygiene, and CodeQL addresses source code, so none of them replaces image vulnerability scanning.
Automate security and compliance scanning
Southridge Video has a GitHub Enterprise Cloud organization named southridge with 60 private repositories and GitHub Secret Protection licensed for all of them. After a storage account key was found in a commit, the security team requires that commits containing supported secret types are blocked at the moment of git push, before they reach any repository, for every current and future repository. Developers must not be able to bypass the control by skipping a local tool.
What should you configure?
- AEnable secret scanning only, so that alerts are raised after each pushSecret scanning alone detects secrets after they are already in the repository history, which is too late for the requirement.
- BDistribute a pre-commit hook that runs a secret detection tool on developer workstationsClient-side hooks are useful but can be skipped or not installed, so they do not enforce the control server-side.
- CApply an organization security configuration that enables secret scanning and push protection to all repositories, and set it as the default for new repositoriesPush protection scans pushes on the server and rejects ones that contain supported secrets before they are written, and a default security configuration applies it to every new repository automatically.
- DAdd the dependency review action as a required status check on mainDependency review evaluates dependency changes in pull requests; it does not look for secrets and acts only at merge time.
Why: Secret scanning finds credentials that are already committed, while push protection stops them from being committed in the first place by rejecting the push on GitHub's side. Applying both through an organization security configuration and making it the default for new repositories satisfies the every-repository requirement without per-repository effort. For private repositories these features require GitHub Secret Protection, which the scenario states is licensed; public repositories get them free. Bypasses can be restricted to designated reviewers so that any exception is recorded and audited.
Automate security and compliance scanning
Woodgrove Industrial has a C++ firmware repository named woodgrove/plc-firmware on GitHub. The code compiles only with a proprietary cross-compiler that is packaged in the container image ghcr.io/woodgrove/firmware-build:2026, and the image includes Git. The team must run CodeQL code scanning on every push to main, have CodeQL observe the real compilation, and upload results to the repository's code scanning alerts.
How should you configure the workflow?
- AEnable CodeQL default setup for the repository and select C/C++Default setup runs on GitHub-hosted runners with its own build detection, so it cannot use the proprietary compiler in the custom image and the build would fail or be incomplete.
- BDefine a job with container: ghcr.io/woodgrove/firmware-build:2026 and permissions security-events: write, then run actions/checkout, github/codeql-action/init with languages: c-cpp, the manual build commands, and github/codeql-action/analyzeRunning the job in the build container lets the CodeQL action trace the real compilation with the proprietary toolchain, and security-events: write allows the analyze step to upload SARIF results to code scanning.
- CRun the build in the container with docker run, then run github/codeql-action/init and analyze on the runner host after the container exitsFor compiled languages CodeQL must observe the build while it runs; initializing CodeQL on the host after the build happened in a separate container gives it nothing to extract.
- DAdd the Microsoft Security DevOps action with the trivy tool against ghcr.io/woodgrove/firmware-build:2026Trivy scans the image for vulnerable packages and misconfigurations; it does not perform CodeQL semantic analysis of the firmware source code.
Why: CodeQL for compiled languages such as C++ builds a database by tracing the compiler, so the analysis must run in the same environment as the build. When the build depends on a custom image, the supported pattern is an advanced setup workflow with a job-level container key, with the init step before the build and the analyze step after it. The container needs Git, and the job needs security-events: write to upload results. Default setup and host-side analysis fail because they never see the real compilation, and image scanners address a different risk than source code analysis.