More controls for suppression
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 474
- Forks
- 65
- Avg merge
- 22h 25m
- Merged PRs (30d)
- 26
Description
Currently PSRule supports suppression by name within options or by using a suppression group. These suppression options are typically set within the repository where the infrastructure as code lives.
For sensitive pipelines having more control over what can be suppressed and how that suppression should occur is helpful.
While we could provide a global disable suppression switch, many pipelines may need some level of suppression so more granular options are required.
Choice of how rules are suppressed
Suppression in ps-rule.yaml is quick and works for common cases, a YAML comment as the reason for suppression can be added also is not checked or enforced in anyway. Making this enforced might be challenging.
Suppression groups provide a powerful alternative way to suppress by a condition, and also provide an optional synopsis which can be used to describe the reason for the suppression. This synopsis is output during a PSRule run by default as a justification / reason why the suppression exists.
Because both of these methods are not equal the choice to one, both or the other would provide some additional controls.
For example:
execution:
suppressionByName: false # Ignore suppression set by name
suppressionByGroup: true # Process suppression with suppression groups
These control by themselves only minimally harden the pipeline.
execution:
suppressionReason: Error # Generate an error if a reason for the suppression is not set (applies to suppression groups)
suppressionExpiry: Error # Generate an error if a suppression group does not have an expiry.
Unsuppressable rules
Consider also allowing rules to not be suppressed.
For example:
execution:
ignoreSuppression:
- 'Azure.Defender.*'
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. Start by locating the execution configuration and suppression handling, then establish the supported controls and expected behavior for suppression methods, reasons, expiry, and unsuppressable rules; done should include documented behavior and tests for the agreed design.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, powershell
- Domain
- security, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100