Features#
DevOps#
PSRule allows you to quickly plug-in Infrastructure as Code (IaC) controls into your DevOps pipeline.
- Shift-left — Identify configuration issues and provide fast feedback in PRs.
- Quality gates — Implement quality gates between environments such as dev, test, and prod.
- Monitor continuously — Perform ongoing checks for configuration optimization opportunities.
Run on MacOS, Linux, and Windows or anywhere PowerShell is supported. Native support for popular continuous integration (CI) systems includes:
- GitHub Actions - Trigger tests for GitHub repositories using workflows.
- Azure Pipelines - Use tasks to run tests in Azure DevOps YAML or Classic pipelines and releases.
Extensible#
Import pre-built rules or define your own using YAML, JSON, or PowerShell format. Regardless of the format you choose, any combination of YAML, JSON, or PowerShell rules can be used together.
- YAML — Use a popular, easy to read, and learn IaC format. With YAML, you can quickly build out common rules with minimal effort and no scripting experience.
- JSON — Is ubiquitous used by many tools. While this format is typically harder to read then YAML it is easy to automate. You may prefer to use this format if you are generating rules with automation.
- PowerShell — Is a flexible scripting language. If you or your team already can write a basic PowerShell script, you can already define a rule. PowerShell allows you to tap into a large world-wide community of PowerShell users. Use existing cmdlets to help you build out rules quickly.
Rules can be authored using any text editor, but we provide a native extension for Visual Studio Code. Use the extension to quickly author rules or run tests locally before you commit your IaC.
Reusable#
Typically unit tests in traditional testing frameworks are written for a specific case. This makes it hard invest in tests that are not easily reusable between projects. Several features of PSRule make it easier to reuse and share rules across teams or organizations.
The following built-in features improve portability:
- Modular — Rules can be packages up into a standard PowerShell module then distributed.
- Private — Modules can be published privately on a network share or NuGet feed.
- Public — Distribute rules globally using the PowerShell Gallery.
- Configuration — PSRule and rules can be configured.
- Baselines — An artifact containing rules and configuration for a scenario.
- Suppression — Allows you to handle and keep exceptions auditable in git history.
- Approval — Use code owners and branch policy concepts to control changes.
-
Documentation — Provide guidance on how to resolve detected issues.
- Quick - Use a one liner to quickly add a hint or reference on rules you build.
- Detailed - Support for markdown allows you to provide detailed detailed guidance to resolve issues.