FIX: eliminate KV public-access window for policy compliance#2049
Draft
hannahwestra25 wants to merge 1 commit into
Draft
FIX: eliminate KV public-access window for policy compliance#2049hannahwestra25 wants to merge 1 commit into
hannahwestra25 wants to merge 1 commit into
Conversation
Create Key Vault with defaultAction=Deny and only the deployer's IP allowlisted (instead of unrestricted public access). After the secret is written, remove the IP rule and disable publicNetworkAccess entirely. This eliminates the temporary violating state where the KV had publicNetworkAccess=Enabled, avoiding blocks from Azure policy enforcement that rejects resources created in a non-compliant state. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Another way to consider dealing with this is by deploying a Network Security Perimeter and associating the AKV to it. That means, even with publicaccess=True on the AKV, it is still bound by the rules in the NSP and satisfies net isolation requirements. that also has the benefit of letting us associate it to other resources too (I think the ACR, ACA, etc. all need some sort of net-iso policy? all of those should be satisfied with a NSP) (and I don't think we're doing that for the persistent copyrit deployments, and instead using a general NSP used on all our stuff ... maybe we should do this for copyrit nonprod+prod too?) |
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.
Problem
The deploy script creates Key Vault with
publicNetworkAccess=Enabled, writes a secret, then locks it down. This creates a temporary violating state that will be blocked once Azure policy enforcement rolls out (per the recent IcM alert).Fix
Create the KV with
defaultAction=Denyand only the deployer's public IP allowlisted from the start. After the secret is written:publicNetworkAccessentirelyThe KV is never in an unrestricted public access state, so the policy will not block it.
Changes
infra/deploy_instance.py: Detect deployer IP via ipinfo.io, create KV locked down with IP allowlist, remove IP rule after secret writeinfra/README.md: Updated docs to reflect new approach