PSrule not using local rules in Azure pipeline #2546
-
I am having an issue with Azure pipeline. It is ignoring rules that I defined in .ps-rule/ folder. My pipeline looks like this:
And my ps-rule.yaml
Sample rule that I have in .ps-rule/LogForAutomation.Rule.yaml
This project was based on https://github.com/Azure/ALZ-Bicep |
Beta Was this translation helpful? Give feedback.
Answered by
BernieWhite
Nov 21, 2023
Replies: 1 comment 4 replies
-
If the issue is suppression is not occurring. For the suppression group, try fully qualify the rule names: # Synopsis: Ignore automation account audit diagnostic logs are enabled as these are covered by DINE policies in ALZ
apiVersion: github.com/microsoft/PSRule/v1
kind: SuppressionGroup
metadata:
name: ALZ.DiagLogForAutomation
spec:
rule:
- PSRule.Rules.Azure\Azure.Automation.AuditLogs
- PSRule.Rules.Azure\Azure.Automation.PlatformLogs
if:
allOf:
- name: '.'
contains: alz-automation-account
- type: '.'
in:
- Microsoft.Automation/automationAccounts |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@bobanda87 The suppression group only applies if you are using an automation account name that contains
alz-automation-account
. Looks like you are using the nameSB-automation-account
instead, which won't match with this condition.You could update the suppression group to ignore all automation accounts: