Skip to content
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

Creating a complex policy to cross-reference two array fields #1270

Open
mbrijun opened this issue Jan 18, 2024 · 0 comments
Open

Creating a complex policy to cross-reference two array fields #1270

mbrijun opened this issue Jan 18, 2024 · 0 comments

Comments

@mbrijun
Copy link

mbrijun commented Jan 18, 2024

Hi,

I am looking for some advice on creating a complex policy which involves cross-referencing two fields of the same resource, each field being an array. A practical example I have in mind is checking if an Azure App Gateway has any public IP address that is tied to an HTTP Listener. This means we have to compare "properties.frontendIPConfigurations" with "properties.httpListeners" and the bond between the two is "properties.frontendIPConfigurations.id" -> "properties.httpListeners.properties.frontendIPConfiguration.id".

I was able to create a similar policy with Rego in Wiz, which compares two lists of frontendIPConfiguration IDs, one from "properties.frontendIPConfigurations" and the other from "properties.httpListeners". Any overlap between these two sets indicates an exposure on the public internet.

I hope the above makes sense. Thank you.

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

No branches or pull requests

1 participant