AZ-400 Develop a security and compliance plan Practice Question
Your team uses GitHub and wants to automatically detect exposed credentials in code. Which GitHub feature should you enable?
⚠ Common exam trap
Watch out — candidates often confuse Code scanning (which finds code vulnerabilities) with Secret scanning (which finds credentials), but Azure and GitHub treat them as separate features with distinct purposes and detection mechanisms.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Secret scanning
Secret scanning is the correct answer because it is the GitHub feature specifically designed to automatically detect exposed credentials, such as API keys, tokens, and passwords, in code repositories. It scans for known patterns of secrets and can alert both the repository owner and the partner service (e.g., AWS, Azure) to revoke the compromised credential. This directly addresses the requirement to automatically detect exposed credentials in code.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Dependabot alerts
Why it's wrong here
Dependabot alerts monitor dependency manifests and lock files for known CVEs, and can automatically open pull requests to update insecure packages. They do not scan committed secrets, so they cannot detect an Expo token or API key accidentally committed to a repository.
- ✗
GitHub Copilot
Why it's wrong here
GitHub Copilot is an AI pair programmer that suggests code completions and functions based on natural-language prompts and existing code context, but it performs no security scanning or secret detection. It cannot identify exposed credentials or secrets in the codebase.
- ✗
Code scanning
Why it's wrong here
GitHub code scanning (CodeQL) analyzes source code to find security vulnerabilities such as SQL injection, cross-site scripting, or buffer overflows, but it is not designed to detect hardcoded secrets like Expo access tokens or API keys. Secret scanning is the dedicated feature for finding such credentials.
- ✓
Secret scanning
Why this is correct
Secret scanning automatically scans repositories for known patterns of secrets such as Expo access tokens, GitHub tokens, AWS keys, and connection strings, and alerts owners when a secret is detected. It can also block pushes containing secrets, making it the correct feature for detecting Expo secrets.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Feature
A feature is a distinct unit of functionality that delivers value to the user, often managed and tracked throughout the software development lifecycle.
Key term
GitHub
GitHub is a cloud-based platform for storing, tracking, and collaborating on code using Git version control.
About these practice questions
This AZ-400 question is part of Courseiva's 823-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This AZ-400 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-400 exam.