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

Remediation not working for policy Deploys NSG flow logs and traffic analytics to a storageaccountid with a specfied retention period. #990

Closed
neok-g opened this issue Jun 15, 2022 · 17 comments
Labels
bug Something isn't working policy

Comments

@neok-g
Copy link

neok-g commented Jun 15, 2022

Describe the bug Remediation for the policy 'Deploys NSG flow logs and traffic analytics to a storageaccountid with a specfied retention period.' does not work. The error is: Reason No policy evaluation result was found. The policy assignment's exclusions may have changed or it no longer exists. Please retry the remediation with 'ResourceDiscoveryMode' set to 'ReEvaluateCompliance'.

Steps to reproduce

  1. Deploy the policy definition and create an assignment
  2. Create a NSG without flowlogs configured
  3. NSG becomes non-compliant after a. while
  4. Create a remediation task. The task fails. with the error above and the NSG remains non-compliant.

Screenshots

@neok-g neok-g added the bug Something isn't working label Jun 15, 2022
@ghost ghost added the Needs: Triage 🔍 Needs triaging by the team label Jun 15, 2022
@jtracey93
Copy link
Collaborator

Thanks @neok-g for the issue.

Can you confirm the definition ID of the policy as we have 2 with the same description:

image
https://www.azadvertizer.net/azpolicyadvertizer_all.html#%7B%22col_3%22%3A%7B%22flt%22%3A%22nsg%22%7D%2C%22col_10%22%3A%7B%22flt%22%3A%22ESLZ%22%7D%7D

Thanks

Jack

@neok-g
Copy link
Author

neok-g commented Jun 15, 2022

Hi @jtracey93

Thanks for your response. The policy definition ID of the policy we use is:
/providers/Microsoft.Management/managementGroups/mg-pg-prd/providers/Microsoft.Authorization/policyDefinitions/Deploy-Nsg-FlowLogs

Thanks

@ghost ghost added Needs: Attention 👋 Needs attention from the maintainers and removed Needs: Author Feedback labels Jun 15, 2022
@neok-g
Copy link
Author

neok-g commented Jun 23, 2022

Any update on this one?

@neok-g
Copy link
Author

neok-g commented Jul 12, 2022

@jtracey93 Do you need more input from my side? Are you able to reproduce this one?

@jtracey93
Copy link
Collaborator

Hi @neok-g,

I think we are all good, just some time to investigate amongst some other items that we are working on.

Hopefully will get a chance to look this week 👍

@jtracey93
Copy link
Collaborator

@neok-g, are you able to test this version of the policy please and let us know if it works? https://www.azadvertizer.net/azpolicyadvertizer/Deploy-Nsg-FlowLogs-to-LA.html

@neok-g
Copy link
Author

neok-g commented Jul 13, 2022

@jtracey93 Thanks! I will take a look at it today

@jtracey93 jtracey93 added Needs: Author Feedback and removed Needs: Attention 👋 Needs attention from the maintainers Needs: Triage 🔍 Needs triaging by the team labels Jul 13, 2022
@jtracey93
Copy link
Collaborator

Perfect @neok-g let us know how it goes

@neok-g
Copy link
Author

neok-g commented Jul 13, 2022

@jtracey93 I guess you shared the wrong one. We use the "Deploys NSG flow logs and traffic analytics" instead of "Deploys NSG flow logs and traffic analytics to Log Analytics" since we want provide our own storageaccount.

@ghost ghost added Needs: Attention 👋 Needs attention from the maintainers and removed Needs: Author Feedback labels Jul 13, 2022
@jtracey93
Copy link
Collaborator

Apologies @neok-g, was not aware that was your requirement.

Out of interest, I saw this built-in is now available https://www.azadvertizer.net/azpolicyadvertizer/5e1cd26a-5090-4fdb-9d6a-84a90335e22d.html

And it looks to be a pretty close match to what our custom policy does apart from its assigned to a region, but you can assign multiple times.

Just wondering if you could give this a go whilst i find some time to test our one to see if i can replicate your bug?

@neok-g
Copy link
Author

neok-g commented Jul 13, 2022

@jtracey93 No problem. The thing is we would like to specify retention period in combination with a self-chosen storage account. The only policy that seems to offer both is "Deploys NSG flow logs and traffic analytics". The built-in "Configure network security groups to use specific workspace for traffic analytics" has retention hardcoded 0 days and disabled.

@neok-g
Copy link
Author

neok-g commented Jul 19, 2022

Any update on this one?

@neok-g
Copy link
Author

neok-g commented Aug 30, 2022

Could you please provide an update on this one?

@jtracey93
Copy link
Collaborator

Hey @neok-g,

We are awaiting to review and merge PR #1022 before working on these. We hope to review and merge this PR this week.

@jtracey93
Copy link
Collaborator

Trigger ADO Sync 1

@jtracey93
Copy link
Collaborator

Trigger ADO Sync 2

@jtracey93 jtracey93 removed the Needs: Attention 👋 Needs attention from the maintainers label Apr 25, 2023
@jtracey93 jtracey93 added this to the policy-refresh-fy23-q4 milestone Apr 25, 2023
@jtracey93 jtracey93 removed this from the policy-refresh-fy23-q4 milestone Aug 8, 2023
@jtracey93 jtracey93 added this to the policy-refresh-fy24-q1 milestone Aug 8, 2023
@Springstone
Copy link
Member

@neok-g been a long time since we've provided updates, apologies. Please note, we have deprecated the ALZ custom policies for "Deploy NSG flow logs *" and they have been superseded by the built-in policy https://www.azadvertizer.net/azpolicyadvertizer/e920df7f-9a64-4066-9b58-52684c02a091.html.
This should address your issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working policy
Projects
None yet
Development

No branches or pull requests

3 participants