Skip to content

Add support for overriding rule severity level with baselines #1180

@BernieWhite

Description

@BernieWhite

PSRule v2 introduced a severity level for rules that can be configured as Error, Warning, or Information.

The Level can be defined on each rule or inherits from the default Error level.

It would be helpful for some scenarios to be able to override the severity level for rules with a baseline.


Please 👍 if you have a specific requirement for this issue.


Update 2023-05-07

A baseline can override the severity by specifying the name of the rule and the severity level.

---
# Synopsis: A custom baseline.
apiVersion: github.com/microsoft/PSRule/v1
kind: Baseline
metadata:
  name: Corp.Azure
spec:
  rule:
    tag:
      release: GA
  override:
    level:
      Azure.APIM.APIDescriptors: Information
      Azure.Template.UseLocationParameter: Error

Update 2023-08-28

To support reporting of this we should include ruleConfigurationOverrides in SARIF to identify and rules that have been overridden.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions