Skip to content

Conversation

@mrWinston
Copy link
Collaborator

@mrWinston mrWinston commented Sep 22, 2025

Which issue this PR addresses:

Fixes: https://issues.redhat.com/browse/ARO-21136

What this PR does / why we need it:

  • Add Network Security Perimeters to CosmosDBs, Keyvaults and StoageAccounts having public access enabled
  • required by security wave 5
  • NSPs are in "Learning" mode, meaning they don't perform any filtering but enable us to monitor connections to these resources
  • update armnetwork to v7 for some files for the nsp support

Resources affected:

  • aro--gwy
  • aro--por
  • aro--svc
  • aro--cls
  • aro--cosmosdb

Test plan for issue:

  • Deploy and Test in Int
  • [ ] Deploy and Test in Canary Canary deployment will be run together with the associated sdp-pipelines and ARO-Pipelines release.

@mrWinston mrWinston changed the title [ARO-20791] add network security perimeter to some resources [ARO-21136] add network security perimeter to some resources Sep 22, 2025
@github-actions github-actions bot added the needs-rebase branch needs a rebase label Oct 1, 2025
@github-actions
Copy link

github-actions bot commented Oct 1, 2025

Please rebase pull request.

@aasserzo
Copy link
Collaborator

aasserzo commented Oct 8, 2025

LGTM

@mociarain
Copy link
Member

How did you validate these in INT? Do they result in something in the portal we can see?

@mrWinston
Copy link
Collaborator Author

How did you validate these in INT? Do they result in something in the portal we can see?

I validated it by running the RP deployment in int and then checking the int subscription to see if the NSPs were created and if the resources had been assigned correctly. Which they were. Additionally, the compliance dashboard showed the associated alerts as being resolved.

@mociarain
Copy link
Member

I think you can just push an empty commit to make this check run.

git commit --amend --no-edit;
git push --force-with-lease

return &arm.Resource{
Resource: &armnetwork.NspAssociation{
Properties: &armnetwork.NspAssociationProperties{
AccessMode: pointerutils.ToPtr(armnetwork.AssociationAccessModeLearning),
Copy link
Collaborator

@alcasim alcasim Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: if some day we want to move this to enforce or audit... would it be worth to have it as a func parameter? I like how clean looks right now, so it's not a deal breaker.

}
}

// networkSecurityPerimeterProfile creates a new nsp profile with the hardcoded name `default`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reading the code, this func creates a resource with name nspname/default which is not exactly "hardcoded default".

cosmosNSPProfile := g.networkSecurityPerimeterProfile("cosmos-nsp")
cosmosNSPAssociation := g.networkSecurityPerimeterAssociation("cosmos-nsp", "cosmos-nsp-association", "[resourceId('Microsoft.DocumentDB/databaseAccounts', parameters('databaseAccountName'))]")

rs = append(rs, cosmosNSP, cosmosNSPProfile, cosmosNSPAssociation)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to this https://learn.microsoft.com/en-us/azure/private-link/network-security-perimeter-concepts#onboarded-private-link-resources Cosmos DB is not GA, but on "Public Preview"... will it work in all of our regions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants