DEV Community

Cover image for SC-500 practice, week 5: 5 questions (secrets you no longer need)
CD Security Lab
CD Security Lab

Posted on Originally published at gitlab.com

SC-500 practice, week 5: 5 questions (secrets you no longer need)

This week: a pipeline that deploys to Azure without a stored secret, a firewall that can finally see inside HTTPS, policies that block versus fix, staff pasting customer data into public AI chat sites, and which Defender for Servers plan gives you what.

How to use these: read the question, pick your answer before you open Answer, and write it down (or in the comments). Then check the "why not the others" part even if you got it right: that is where the exam traps live. Every scenario, name and number is made up by me; only the question formats follow the real exam.

Table of contents

Q021: The pipeline deploys to Azure, and there is no secret to steal

Identity and access · Build list · standalone page

The GitHub repository contoso/web-orders deploys to the resource group rg-lab-orders from a GitHub Actions workflow. Today it signs in with a client secret of the app registration app-gh-orders, stored as a GitHub secret. The secret expires every 6 months, someone forgets, and deployments break on a Friday. Worse: anyone who reads that secret can deploy from anywhere.

The security team wants this:

  • The workflow signs in to Azure without any stored secret or certificate.
  • Only the main branch of contoso/web-orders can get a token.
  • The identity can deploy to rg-lab-orders and nothing else.

Which four actions should you perform in sequence?

Actions:

  • A. On app-gh-orders, add a federated credential for GitHub Actions: organization contoso, repository web-orders, entity type Branch, value main.
  • B. Assign app-gh-orders the Contributor role on rg-lab-orders.
  • C. Assign app-gh-orders the Contributor role on the subscription.
  • D. In the workflow, add permissions: id-token: write and use azure/login with the client ID, tenant ID and subscription ID only.
  • E. Delete the old client secret from app-gh-orders and from the GitHub secrets.
  • F. Create a new client secret with a 24-month expiry, so it breaks less often.

Answer

A → B → D → E.

  • A: a federated credential tells Microsoft Entra ID to trust tokens that GitHub issues, but only when the token's subject matches exactly: this repository, this branch. A run from a fork or from a feature branch gets nothing.
  • B: the app still needs an Azure role to do anything. Scope it to the resource group the workflow deploys to.
  • D: the workflow must be allowed to request a GitHub OIDC token (id-token: write). azure/login swaps it for an Entra token. No secret in the workflow.
  • E last: once a run succeeds with federation, delete the secret. Until you do, the old door is still open.

Why not the others:

  • C works, but it is not least privilege. One stolen workflow could touch the whole subscription.
  • F makes the problem last longer. A longer-lived secret is a longer-lived target.

Gotcha: the subject must match exactly. A workflow that runs in a GitHub environment (for example production) sends a different subject (environment, not branch), and the sign-in fails with a "no matching federated identity record" error. Add a credential for the environment if you use one. You can also put the federated credential on a user-assigned managed identity instead of an app registration.

Sources: Workload identity federation · Configure an app to trust an external identity provider · Use GitHub Actions to connect to Azure


Q022: The firewall sees HTTPS. It just cannot read it

Networking · Hot area · standalone page

The hub network vnet-lab-hub has an Azure Firewall, afw-lab-01, on the Standard tier. Last month a server in snet-lab-app downloaded a tool from a site on a known malware path. The URL was in the HTTPS request, so the firewall never saw it. The security team wants this:

  1. The firewall can decrypt outbound HTTPS, look at the full URL and the content, and encrypt it again.
  2. It detects and blocks known attack patterns in that traffic using signatures.
  3. Rules can allow partner.example.com/api/* but block the rest of partner.example.com.

Pick the right value for each line:

What Your choice
Firewall tier you need ▢ Basic ▢ Standard ▢ Premium
Feature for goal 2 ▢ Threat intelligence ▢ IDPS ▢ Web categories
Feature for goal 3 ▢ FQDN filtering ▢ URL filtering ▢ DNAT rules
Certificate the firewall uses for TLS inspection ▢ A public certificate for contoso.com ▢ An intermediate CA certificate, stored in Key Vault ▢ No certificate is needed
What the servers in snet-lab-app need ▢ Nothing ▢ To trust the root CA that issued the firewall's certificate

Answer

Premium / IDPS / URL filtering / An intermediate CA certificate, stored in Key Vault / To trust the root CA

  • Premium is the tier with TLS inspection, IDPS and URL filtering. Standard filters by FQDN and uses threat intelligence, but does not decrypt.
  • IDPS (intrusion detection and prevention) matches traffic against signatures and can alert or alert-and-deny. Threat intelligence blocks known bad IPs and domains, not attack patterns inside the traffic.
  • URL filtering looks at the full path, like /api/*. FQDN filtering only sees the host name, so it cannot tell /api from the rest. For HTTPS, URL filtering needs TLS inspection on.
  • TLS inspection uses an intermediate CA certificate that the firewall uses to make certificates on the fly. It lives in Azure Key Vault, and the firewall reads it through a managed identity.
  • The clients must trust the root CA, or every HTTPS call fails with a certificate error. Push the root to servers with Group Policy, Intune or your image.

Gotcha: some traffic should not be decrypted (banking, health, and anything that pins certificates). Use the TLS inspection bypass list for those, and check your privacy rules before you decrypt staff traffic.

Sources: Azure Firewall Premium features · Azure Firewall Premium certificates


Q023: Block it, flag it, or fix it: picking the policy effect

Identity, access and governance · Hot area · standalone page

The management group mg-lab-prod has 40 subscriptions. The security team has four wishes, and you want one Azure Policy assignment for each:

  1. Nobody can create a storage account that allows public blob access. The create must fail.
  2. Show which existing VMs have no backup, but do not change or stop anything.
  3. Every new resource group gets the tag costCenter, copied from the subscription, without blocking the create.
  4. Every new SQL server gets diagnostic settings sending logs to law-lab-sec, created automatically.

Pick the effect for each wish:

Wish Your choice
1. Public blob access ▢ Audit ▢ Deny ▢ Modify
2. VMs without backup ▢ Audit (or AuditIfNotExists) ▢ Deny ▢ DeployIfNotExists
3. costCenter tag ▢ Append ▢ Modify ▢ Deny
4. Diagnostic settings ▢ AuditIfNotExists ▢ Modify ▢ DeployIfNotExists
What the assignment for wish 4 also needs ▢ Nothing ▢ A managed identity with the right roles

Answer

Deny / Audit (or AuditIfNotExists) / Modify / DeployIfNotExists / A managed identity with the right roles

  • Deny stops the create or update request. That is wish 1.
  • Audit and AuditIfNotExists only mark the resource as non-compliant. Nothing is blocked or changed. That is wish 2.
  • Modify adds, changes or removes tags (and a few properties) on create or update. It is the effect built for managing tags, and it can copy a value from the subscription's tags (there is a built-in policy for exactly that). Append can add fields, but it cannot change an existing value.
  • DeployIfNotExists checks for a related resource (here, the diagnostic setting) and deploys a template when it is missing.
  • Modify and DeployIfNotExists change things for you, so the assignment needs a managed identity with roles that allow those changes.

Gotcha: new assignments do not fix existing resources by themselves. For resources that already exist, run a remediation task. And Deny on day one in production can break deployments you did not know about: start with Audit, read the compliance report, then switch.

Sources: Azure Policy definition effect basics · Remediate non-compliant resources


Q024: Staff paste customer data into a public AI chat site

Secure compute (AI) · Single choice · standalone page

At contoso.com, the sales team likes a public AI chat site for writing emails. Last week someone pasted a full customer list, with credit card numbers, to "make it a nice table". Nobody knew until the person bragged about how nice the table looked.

The security team wants this:

  • See when people share sensitive information with third-party AI sites in the browser.
  • Block credit card numbers from being pasted or uploaded there, but allow normal use.

Devices are Windows 11, onboarded to Microsoft Purview, and use Microsoft Edge. What should you do?

  • A. Block the AI site's domain in the company web proxy.
  • B. In Microsoft Purview DSPM for AI, use the one-click policies to detect sensitive info added to AI sites, and create an Endpoint DLP policy that blocks credit card numbers being shared with generative AI sites.
  • C. Turn on Defender for Cloud threat protection for AI services.
  • D. Apply a sensitivity label to the CRM app.

Answer

B. DSPM for AI is the Purview hub for AI risk. Its one-click policies give you visibility into sensitive data shared with third-party AI sites (the "credit card pasted into a chatbot" case is Microsoft's own example), and Endpoint DLP can warn or block users when they share sensitive information with those sites, on onboarded devices.

Why not the others:

  • A blocks the site completely, which breaks goal 2 ("allow normal use"). People also find another site by lunch.
  • C protects your own AI apps running in Azure (prompts to your model deployments). The public chat site is not your app.
  • D labels protect files and email. A list copied from a screen and pasted into a browser is just text in a clipboard.

Gotcha: in Edge it works through the built-in Purview integration (with an Edge configuration policy); Chrome and Firefox need the Purview browser extension. Start the DLP policy in simulation (test) mode, read who would be blocked, then turn it on. The list of supported AI sites changes, so check it.

Sources: Considerations for DSPM for AI · Use Purview to manage data security for other AI apps · Learn about Endpoint DLP


Q025: Plan 1 or Plan 2: what each Defender for Servers plan gives you

Defender for Cloud and Sentinel · Hot area · standalone page

The subscription sub-lab-prod has 80 Windows and Linux VMs. The budget owner asks: "Can we save money with Defender for Servers Plan 1?" The security team needs these features:

  1. EDR with Microsoft Defender for Endpoint on the servers.
  2. File integrity monitoring on C:\Windows\System32 and /etc.
  3. Just-in-time VM access for RDP and SSH.
  4. Agentless scanning of the VM disks for vulnerabilities and secrets.

For each feature, pick the lowest plan that includes it:

Feature Your choice
1. EDR with Defender for Endpoint ▢ Plan 1 ▢ Plan 2 only
2. File integrity monitoring ▢ Plan 1 ▢ Plan 2 only
3. Just-in-time VM access ▢ Plan 1 ▢ Plan 2 only
4. Agentless disk scanning ▢ Plan 1 ▢ Plan 2 only
So, for all four features you need ▢ Plan 1 ▢ Plan 2

Answer

Plan 1 / Plan 2 only / Plan 2 only / Plan 2 only / Plan 2

  • Defender for Endpoint integration (EDR) is in Plan 1 already. Plan 1 is the "endpoint protection for servers" plan, with Defender Vulnerability Management basics.
  • File integrity monitoring, just-in-time VM access and agentless scanning (vulnerabilities, secrets, malware) are Plan 2 features. Plan 2 also brings things like a daily free data allowance for some security data in Log Analytics.
  • So the answer to the budget owner is: Plan 1 is enough if you only want EDR. This team wants more, so it needs Plan 2.

Gotcha: you can mix. Plan choice is per subscription, and you can turn the plan off for specific resources. A dev subscription can run Plan 1 while production runs Plan 2. Check current prices on the Defender for Cloud pricing page before you promise a number.

Sources: Defender for Servers plans · Plan your Defender for Servers deployment


Cheat sheet

The same five ideas in plain words, for the manager who asks "so what?". Share it with them.

Cheat sheet titled 5 secrets you no longer need, one row per idea: the deploy pipeline signs in without a stored secret, the firewall opens and checks web traffic, rules can block or fix a bad setup, card numbers cannot be pasted into public AI chat sites, and Defender for Servers Plan 1 gives EDR while Plan 2 adds the extras.

Coming next

Next Thursday brings more SC-500 questions, with AI security in every week. The skill areas are in the SC-500 study guide. All questions live in the practice folder.

Got one wrong? Good. That is one fewer surprise in the exam room. Drop your answers in the comments.


Thanks for reading! I'm Cuong, and on CD Security Lab I rebuild real Microsoft security cases in a safe lab and explain them simply. Follow along:

Got a question about your own tenant? Drop it in the comments.

Top comments (0)