-
Notifications
You must be signed in to change notification settings - Fork 4
fix(infra): ensure correct permissions to key vault from jobs #2324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(infra): ensure correct permissions to key vault from jobs #2324
Conversation
📝 WalkthroughWalkthroughThe changes update Bicep templates to use a user-assigned managed identity for accessing Key Vault secrets instead of a system-assigned identity. Additionally, the type constraint for the Changes
Suggested reviewers
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 30th. To opt out, configure Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.azure/modules/containerAppJob/main.bicep (1)
16-17
: Clarify thesecrets
parameter description.
Consider updating the parameter description to mention thatidentity
should be the resource ID of a user-assigned managed identity:- @description('The secrets to be used in the job') + @description('The secrets to be used in the job, including a name, keyVaultUrl, and the resource ID of the identity to use for accessing Key Vault')
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
.azure/applications/sync-resource-policy-information-job/main.bicep
(1 hunks).azure/applications/sync-subject-resource-mappings-job/main.bicep
(1 hunks).azure/applications/web-api-migration-job/main.bicep
(1 hunks).azure/modules/containerAppJob/main.bicep
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Dry run deploy infrastructure / Deploy to test
- GitHub Check: build / build-and-test
🔇 Additional comments (6)
.azure/modules/containerAppJob/main.bicep (1)
16-17
: Generalizeidentity
parameter type to support user-assigned identities.
The change from a fixed'System'
literal to astring
type correctly enables support for user-assigned managed identities..azure/applications/web-api-migration-job/main.bicep (1)
67-67
: Use user-assigned managed identity for Key Vault access.
Switchingidentity
from the fixed'System'
tomanagedIdentity.id
aligns with the module's generalized identity parameter and enables container app jobs to leverage a user-assigned managed identity..azure/applications/sync-subject-resource-mappings-job/main.bicep (2)
92-92
: Leverage user-assigned managed identity for DB secret access.
Updatingidentity
tomanagedIdentity.id
ensures the job uses the designated user-assigned identity for Key Vault retrieval.
97-97
: Use user-assigned identity for Redis secret retrieval.
Switchingidentity
tomanagedIdentity.id
aligns with the module signature and grants the appropriate identity for accessing the Redis secret..azure/applications/sync-resource-policy-information-job/main.bicep (2)
92-92
: Configure user-assigned identity for DB secret.
Changingidentity
to referencemanagedIdentity.id
enables the job to use the user-assigned identity for Key Vault access.
97-97
: Apply user-assigned managed identity for Redis secret.
Switching from a static'System'
literal tomanagedIdentity.id
ensures the job uses the correct user-assigned identity for secret retrieval.
Description
We create user-assigned identity for the jobs. There is some weird behaviour for the container app jobs now relating to secrets. This might be the underlying issue..
Related Issue(s)
Verification
Documentation
docs
-directory, Altinnpedia or a separate linked PR in altinn-studio-docs., if applicable)