# AZ-401: Code Dependency and Secret Scanning Coverage

Configure eligible repository scanning, verify CodeQL and dependency/secret coverage, and carry findings into owned triage without confusing enablement with merge enforcement.

Author: LearningPathX Editorial Team
Content version: 1.0
Published: 2026-12-04T06:03:21.335684+00:00
HTML: https://learningpathx.com/guide/AZ-401/az-401-code-dependency-and-secret-scanning-coverage.html

## AZ-401: Code Dependency and Secret Scanning Coverage

Select scanning by the risk and repository platform, then configure the selected repository and verify what actually ran. Code analysis, vulnerable-dependency detection and secret detection answer different questions. For an eligible GitHub repository, this procedure enables the required repository features, configures supported CodeQL default setup, and traces real analysis evidence into triage. Azure Repos requires its own Azure DevOps Services products and pipeline scanning configuration.

Product enablement, a completed analysis, an actionable finding and a required merge check are separate outcomes. Record each boundary rather than treating an enabled switch or an empty alert list as proof of complete security. This is an unexecuted procedure for an existing authorized nonproduction repository; it reports no feature activation, scan or discovered vulnerability.

## Match the risk to the product and platform

GitHub Code Security covers code vulnerabilities and related dependency capabilities. GitHub Secret Protection covers exposed secrets and push protection. The older umbrella term GitHub Advanced Security remains relevant to the exam and existing installations, but it does not make the two products interchangeable.

Use this coverage map before changing settings:

| Risk | Coverage to establish | Question the evidence must answer |
| --- | --- | --- |
| A flaw in application code | Supported code analysis, such as CodeQL | Was the relevant language and revision actually analyzed? |
| A vulnerable dependency | Dependency identification and vulnerability alerts | Was the relevant manifest or lock file represented? |
| An exposed credential | Applicable secret scanning and push protection | Which detection or prevention boundary was actually enabled? |

GitHub product availability depends on repository visibility and plan. Private or internal paid features require the appropriate eligible organization plan and product entitlement. Public availability does not establish that every desired feature is already configured.

For Azure Repos, GitHub Advanced Security for Azure DevOps applies to Git repositories in Azure DevOps Services. Its Code Security and Secret Protection products also have distinct coverage. Do not transfer a GitHub subscription or settings procedure to that platform by assumption.

## Establish one controlled repository baseline

Have the repository administrator and security owner select the repository, permitted features and any paid enablement. Record its visibility, organization, languages, dependency manifests, current scanner settings and existing analysis configuration. Preserve the original state before editing.

Use these existing series boundaries:

* AZ-401: Pull Request Enforcement for Human and Copilot Changes establishes the separate merge-control and bypass decisions.
* YAML Ain't Markup Language (YAML) execution and event boundaries are developed in AZ-401: YAML Triggers Job Dependencies and Parallel Execution.
* AZ-401: Secrets Keys Certificates and Sensitive Deployment Assets establishes sensitive-input and consumer controls.

Agree on an owner-approved existing finding for the triage exercise if one is available. Otherwise, plan to record that no finding was observed and that a positive triage case remains unverified. Never commit a working credential or introduce a vulnerable dependency merely to manufacture a result.

Confirm who may change settings, inspect alerts, remediate findings and approve exceptions. These responsibilities need not belong to one person. Stop if the repository, license decision, supported language or required authority is unclear.

Review the execution boundary before allowing analysis of repository code. Use trusted inputs and minimum workflow permissions; automatic secret redaction is not guaranteed. A scanner is not permission to run untrusted code with privileged credentials.

## Configure the selected GitHub repository

### Enable features at repository scope

Open the selected repository's Settings, then Advanced Security. Confirm the repository identity before changing a feature. Use the controls beside the intended feature only.

For dependency coverage, enable the dependency graph, then confirm whether Dependabot alerts are enabled. If alerts are disabled and the owner approved the change, enable them through the intended feature control in the selected repository's Settings > Advanced Security. Record the graph's enabled state and the alerts' enabled state separately. The graph uses repository manifests and lock files; alerts depend on that graph. Do not assume dependency graph, Dependabot alerts or push protection is enabled simply because the repository is public.

The quickstart also contains a profile-Settings shortcut for Dependabot. That is not the repository-scoped route for this exercise. Stay in the selected repository's settings and preserve unrelated repositories.

If a required control is unavailable, resolve the actual role, visibility or license condition with its owner. Do not change account-wide settings to work around it.

### Configure CodeQL default setup

For an eligible repository and supported language, use the documented default setup:

1. Enable Code Security or the applicable existing GitHub Advanced Security entitlement if required.
2. Beside CodeQL analysis, choose Set up, then Default.
3. Review the proposed languages, queries and triggering configuration.
4. Choose Enable CodeQL only after the owner accepts that configuration.

Default setup selects analysis configuration for the repository. Inspect its actual proposal; do not invent language support or silently substitute an advanced workflow. An unsupported repository needs a separately supported configuration before it can satisfy this step.

Record the saved configuration and the analysis it produces or schedules. A product entitlement alone is not that configuration.

### Configure secret coverage and alert access

Enable the applicable Secret Protection or existing GitHub Advanced Security coverage. If a Secret scanning option is shown, enable it. Select additional push protection only within the approved change.

Inspect who can view the resulting alerts. Administrators manage repository security settings and applicable additional alert access; confirm actual eligibility before granting it. Give the triage owner only the required access.

Record the enabled features without displaying a secret. Push prevention and detection of already committed material are different observations. A harmless missing-name probe from a secret-storage exercise does not demonstrate that a scanner recognizes a credential.

## Keep Azure Repos configuration platform-specific

For an existing Azure Repos Git repository, open Project settings, Repos, Repositories and select that repository. Choose the owner-approved Secret Protection or Code Security product and confirm Begin billing. Do not use project-wide or organization-wide Enable all.

Code Security is required for dependency and code analysis. Repository Options can enable dependency scanning default setup; check its default-branch and pull-request coverage. CodeQL needs separate supported default or advanced pipeline configuration and actual execution evidence. Do not copy the GitHub setup controls or invent task syntax.

The worked CodeQL route here is GitHub default setup. Azure Repos owners must establish their own pipeline configuration. Secret Protection starts repository scanning; push protection evaluates subsequent pushes. Neither requires planting a real credential.

## Verify settings, execution and coverage separately

Open the selected repository's Security and quality view and inspect the relevant analysis and alert evidence. Use actual records, including pending or failed work.

Maintain a short verification record:

| Evidence | Comparison to make |
| --- | --- |
| Repository and feature state | Selected repository and approved products against the baseline |
| Analysis configuration | Actual language, trigger and scanner settings against the intended coverage |
| Execution | Completed, waiting, skipped or failed analysis, rather than an enabled control |
| Source identity | Actual analyzed revision and branch against the change being assessed |
| Coverage | Relevant code and dependency inputs against what the analysis could inspect |
| Findings | Actual category and details, or an honest record that none was observed |
| Access | Whether the authorized triage owner can inspect the necessary evidence |

An empty list can mean no detected finding, incomplete analysis, missing coverage or insufficient visibility. Diagnose those possibilities before declaring success. Likewise, a successful analysis of an older revision cannot establish that the current change was checked.

For default setup, follow its actual configured execution and results. Do not invent a run button, fabricate output or add an unsupported workflow merely to obtain a green demonstration.

## Triage one bounded finding with an explicit owner

The following is a recommended working method, not a claim that every product has identical controls.

1. Select an actual finding that the owner has approved for this exercise. Record its repository, scanner, category, source revision and nonsensitive location or dependency reference.
2. Read the surrounding context. Explain what the reported condition means for this application, including uncertainty, before assigning a response.
3. Name the remediation owner and the person who may approve an exception. Preserve the finding's actual state and rationale.
4. Make only the agreed corrective change through the existing review process. Run the applicable analysis on that new revision.
5. Compare the new analysis and finding state with the original record. Record unresolved evidence rather than closing work because a patch was submitted.

For a dependency finding, check the actual affected dependency and repository context. For a code finding, inspect the reported path and relevant behavior. A severity label is useful input to prioritization, not a substitute for contextual assessment.

For a suspected exposed secret, keep the value out of notes, screenshots and logs. Notify the responsible credential owner and follow the established containment and replacement process. Deleting an alert or source line does not establish credential revocation.

Handle a proposed false positive or risk acceptance through the authorized decision owner, with evidence. Do not invent a dismissal permission or change shared alert state simply to complete the exercise. If there is no suitable real finding, preserve that limit and leave this triage case incomplete.

## Separate scan ownership from merge enforcement

Assign responsibility for configuration, execution failures, finding response and merge-policy decisions explicitly. A scanner result does not automatically become a required merge condition.

Azure Repos policy editing requires the relevant administrative or Edit policies authority; build validation and status checks have their own prerequisites. GitHub protected-branch availability and administrator or permitted-role bypass also need review. Preserve the established controls rather than adding an ambiguous check name or bypassing them.

Use the existing enforcement design from AZ-401: Pull Request Enforcement for Human and Copilot Changes. Verify which actual result it consumes and whether the expected actor can merge while that result is missing or failing. Do not mistake a scanner's configured state for that separate admission test.

Defender onboarding and broader code-to-cloud context remain separate from repository scanner configuration.

## Restore only the agreed changes and retain evidence

Review the exercise's changes with the repository and security owners. Restore temporary settings only where that restoration was agreed and remains safe for current consumers. Do not disable a paid security product or erase alert history as automatic cleanup.

Retain the repository, approved feature scope, configuration, analysis revision, actual results, finding owner and unresolved conditions. Record any restored settings and any deliberately retained protection. Leave unrelated repositories, shared workflow configuration and organization-wide defaults unchanged.

## Authoritative Sources

* [GitHub repository security quickstart](https://docs.github.com/en/code-security/getting-started/quickstart-for-securing-your-repository)
* [Repository-scoped security settings and alert access](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository)
* [GitHub Code Security and Secret Protection availability](https://docs.github.com/en/get-started/learning-about-github/about-github-advanced-security)
* [Azure Repos security products and configuration](https://learn.microsoft.com/en-us/azure/devops/repos/security/configure-github-advanced-security-features?pivots=standalone-ghazdo&view=azure-devops)
* [Azure Repos branch-policy authority and prerequisites](https://learn.microsoft.com/en-us/azure/devops/repos/git/branch-policies?view=azure-devops)
* [GitHub protected-branch conditions and bypass](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches)
* [GitHub workflow configuration and permissions](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax)
* [GitHub workflow and credential security](https://docs.github.com/en/actions/reference/security/secure-use)

## Related Reading

* [AZ-401: Pull Request Enforcement for Human and Copilot Changes](https://learningpathx.com/guide/az-401/az-401-pull-request-enforcement-for-human-and-copilot-changes.html)
* [AZ-401: YAML Triggers Job Dependencies and Parallel Execution](https://learningpathx.com/guide/az-401/az-401-yaml-triggers-job-dependencies-and-parallel-execution.html)
* [AZ-401: Secrets Keys Certificates and Sensitive Deployment Assets](https://learningpathx.com/guide/az-401/az-401-secrets-keys-certificates-and-sensitive-deployment-assets.html)
* [AZ-401: Defender for Cloud DevOps Connections and Code to Cloud Context](https://learningpathx.com/guide/az-401/az-401-defender-for-cloud-devops-connections-and-code-to-cloud-context.html)
