Repository navigation
Upgrade Azure Functions adapter to v2 and Node 26 - #105
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
## Summary Enable the existing Sales Service Delivery Contributor groups to deploy POCs and demos that use managed identities and Key Vault, without granting unrestricted role-assignment administration. - Add conditional **Role Based Access Control Administrator** assignments for `azure-sales-service-delivery-contributor-always-on` and `azure-sales-service-delivery-contributor-jit` in `github-nonprod-sales-services-delivery`. - Restrict **both creation/update and deletion** of role assignments to these role definitions and `ServicePrincipal` targets: - **Storage Blob Data Owner** — `b7e6dc6d-f1e8-4753-8033-0f276bb0955b` - **Key Vault Secrets User** — `4633458b-17de-408a-b874-0445c86b69e6` - Add role-specific, **condition-required** audit exceptions for these two groups. Do not modify the global allowlist or exempt other privileged roles. - Add regression tests using the actual configuration: accept conditioned grants, reject missing/blank conditions, and continue rejecting other privileged roles. - Document scope, purpose, and remaining risk. Existing Contributor assignments, group membership/JIT mechanics, and the automation service principal remain unchanged. ## Business justification Sales Service Delivery builds customer-facing POCs and demos that should demonstrate the security practices we recommend. The motivating Azure Functions deployment uses managed identity for host/deployment storage and Key Vault references for its GitHub App credentials. Its ARM template must assign the two roles above to the newly provisioned workload identity. Existing Contributor permissions cannot create those assignments, so deployment and default what-if authorization checks fail with `Microsoft.Authorization/roleAssignments/write` errors. This reusable delegation avoids repeated manual administrator intervention for each POC while preserving identity-based storage access and centralized secret management. It avoids falling back to storage account keys or storing application secrets directly in Function App settings. Per the requester, this subscription contains POCs/demos, not production workloads or customer data. ## Scope and security review — IAM / Cloud Security approval required This intentionally covers **the entire Sales Service Delivery non-production subscription and all resource groups**, not only the original requester's resource group. No other subscription or management group is changed. This PR proposes narrowly role-scoped audit-policy exceptions and therefore requires a human IAM / Cloud Security decision under the repository's PR-approval runbook. The exceptions require a nonblank condition; reviewers must also verify the condition itself, since the existing audit validator checks presence rather than ABAC semantics. The conditions do not authorize assigning Owner, User Access Administrator, RBAC Administrator, or either permitted data role to users/groups. **Remaining risk:** `ServicePrincipal` includes application service principals as well as managed identities, including principals controlled by group members. Members can therefore delegate the two permitted data roles to such principals anywhere in this subscription, and remove matching existing assignments. Restricting to preapproved identity IDs would require a separate identity-provisioning/approval step for new workloads. Subscription scope and inclusion of the existing always-on group are explicit approval decisions; resource-group-scoped and/or JIT-only delegation are narrower alternatives if required by IAM. No Azure apply/deploy was performed; this is a request for review and the normal controlled deployment path. ## Validation - Focused audit RSpec suite: **17 examples, 0 failures; 100% line coverage of the loaded validator**. - Ruby lint on both changed Ruby files: passed. - Existing role-assignment scope check: passed. - Existing duplicate-role-assignment check: passed, with 11 pre-existing redundant-duplicate warnings elsewhere. - Parsed both new YAML assignments and verified condition version, identical conditions, no ERB, and **878 / 8192 characters per condition**. - `git diff --cached --check`: passed. Local validation used installed Ruby **3.4.5** and available test/lint gems, not the repository-pinned Ruby **3.4.9** / complete locked bundle. Missing coverage gems were installed in isolated session storage. The existing Python ABAC-length checker could not run because PyYAML downloads timed out; the new parsed conditions were measured directly with Ruby using the checker's strip-and-length semantics. CI should validate the pinned environment and full repository checks. ## References - [Constrained role-assignment delegation](https://learn.microsoft.com/azure/role-based-access-control/delegate-role-assignments-overview) - [Role and principal-type condition examples](https://learn.microsoft.com/azure/role-based-access-control/delegate-role-assignments-examples) - [Azure Functions identity-based connections](https://learn.microsoft.com/azure/azure-functions/functions-reference#configure-an-identity-based-connection) - [App Service / Functions Key Vault references](https://learn.microsoft.com/azure/app-service/app-service-key-vault-references) - [Repository PR-approval runbook](https://github.com/github/azure-config/blob/main/docs/runbooks/pr-approval.md)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
npm test(Node 26.13.1)