AZ-400 · Domain 4: Develop a security and compliance plan · 13% of the exam
Task 4.2: Design and implement a strategy for managing sensitive information in automation
Key Vault secrets, keys and certificates, secretless sign-in with workload identity federation, secure files during deployment, and pipeline designs that keep secrets out of logs and artifacts.
Study it
Secrets in automation: Key Vault, workload identity federation and secure files
Try each one before opening the answer. Every option is explained, with the Microsoft documentation page that proves it.
Question 1 · choose 1
A deployment job needs two secrets from a Key Vault that uses the Azure RBAC permission model. The job must fetch only those two secrets at run time through its service connection, and the connection's identity must not be able to change or delete secrets. What should you configure?
AThe AzureKeyVault task with SecretsFilter '*', and Key Vault Secrets Officer for the identity
BA vault access policy granting Get and List to the identity
CKey Vault Administrator on the vault for the pipeline's identity
DThe AzureKeyVault task with SecretsFilter listing the two names, and Key Vault Secrets User for the connection's identity
Show the answer and why
AThe AzureKeyVault task with SecretsFilter '*', and Key Vault Secrets Officer for the identity
Incorrect
'*' downloads every secret, and Secrets Officer can change and delete secrets.
BA vault access policy granting Get and List to the identity
Incorrect
With the Azure RBAC permission model, access policies aren't used.
CKey Vault Administrator on the vault for the pipeline's identity
Incorrect
Administrator grants full data plane control, far beyond reading two secrets.
DThe AzureKeyVault task with SecretsFilter listing the two names, and Key Vault Secrets User for the connection's identity
Correct
The filter downloads only the named secrets, and Secrets User can read secret contents without managing them.
The Azure Key Vault task downloads secrets as pipeline variables; its SecretsFilter takes * or a list of names. Under the Azure RBAC model, Key Vault Secrets User reads secret contents, while Secrets Officer and Administrator can manage them; enabling RBAC invalidates access policies.
A GitHub Actions workflow deploys to Azure from many branches named release/*, always through a job that targets the production environment. No client secret may be stored in GitHub, and only that job should be able to get an Azure token. Which two configurations should you make? (Choose TWO.)
AA federated credential with entity type Branch and the pattern release/*
BA federated credential with entity type Environment and the value production
CThe id-token write permission on the deployment job
DA federated credential with entity type Pull request, so pull requests can deploy
EA client secret stored as a production environment secret
Show the answer and why
AA federated credential with entity type Branch and the pattern release/*
Incorrect
Pattern matching isn't supported for the Branch entity type, and a branch credential would also trust every other job on those branches.
BA federated credential with entity type Environment and the value production
Correct
The subject then matches only jobs that target the production environment.
CThe id-token write permission on the deployment job
Correct
The job needs id-token write to request the OIDC token that azure/login exchanges.
DA federated credential with entity type Pull request, so pull requests can deploy
Incorrect
That trusts pull request runs, not the production job.
EA client secret stored as a production environment secret
Incorrect
That stores the secret the design forbids.
A federated identity credential trusts tokens whose subject matches exactly; for GitHub, the entity type is Environment, Branch, Pull request or Tag, and pattern matching isn't supported for branches and tags. The workflow needs id-token: write to request the token for azure/login.
A pipeline signs mobile app builds with a .p12 certificate and a provisioning profile, both under 1 MB. They're committed to the repository today. They must be stored encrypted outside source control, usable only by the release pipeline, and placed on the agent only for the signing job. What should you use?
ABase64 strings in pipeline variables decoded by a script
BA private Azure Storage container with a SAS token in the YAML file
CSecure files in the pipeline library, authorized for the release pipeline and downloaded with DownloadSecureFile
DA Universal Package in the team's feed
Show the answer and why
ABase64 strings in pipeline variables decoded by a script
Incorrect
Variables aren't meant for files, and decoded content can leak into logs.
BA private Azure Storage container with a SAS token in the YAML file
Incorrect
A SAS token in the YAML file is a secret in source control.
CSecure files in the pipeline library, authorized for the release pipeline and downloaded with DownloadSecureFile
Correct
Secure files are encrypted at rest, are a protected resource with pipeline permissions, and are downloaded only by the task.
DA Universal Package in the team's feed
Incorrect
Feed packages are readable by anyone with feed access, not just the release pipeline.
Secure files store sensitive files such as certificates, keystores and provisioning profiles encrypted on the server. They're protected resources with pipeline permissions, approvals and checks, and the Download Secure File task places them on the agent.
An app has development, test and production environments. How should its secrets be organized in Key Vault?
AOne vault for all environments, with role assignments on each secret
BOne vault for the whole company
CA vault per environment, with roles assigned at vault scope
DSecrets in pipeline variables only
Show the answer and why
AOne vault for all environments, with role assignments on each secret
Incorrect
Per-secret assignments are discouraged except in special cases.
BOne vault for the whole company
Incorrect
A shared vault widens access across apps and environments.
CA vault per environment, with roles assigned at vault scope
Correct
A vault per application per environment is the recommendation.
DSecrets in pipeline variables only
Incorrect
That drops Key Vault's central management.
The recommendation is a vault per application per environment (development, pre-production and production) with roles assigned at the vault scope; assigning roles on individual secrets isn't recommended except in specific cases.