Validate infrastructure as code (IaC) and objects using PowerShell rules.
Перейти к файлу
dependabot[bot] bfb8c2e38a
Bump Microsoft.CodeAnalysis.Common from 4.9.2 to 4.10.0 (#1854)
* Bump Microsoft.CodeAnalysis.Common from 4.9.2 to 4.10.0

Bumps [Microsoft.CodeAnalysis.Common](https://github.com/dotnet/roslyn) from 4.9.2 to 4.10.0.
- [Release notes](https://github.com/dotnet/roslyn/releases)
- [Changelog](https://github.com/dotnet/roslyn/blob/main/docs/Breaking%20API%20Changes.md)
- [Commits](https://github.com/dotnet/roslyn/commits)

---
updated-dependencies:
- dependency-name: Microsoft.CodeAnalysis.Common
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump change log

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bernie White <bewhite@microsoft.com>
2024-06-19 12:48:44 +10:00
.devcontainer Bump System.Drawing.Common from 8.0.4 to 8.0.5 (#1817) 2024-05-17 14:38:44 +10:00
.github Fixes CSV output of multiple lines #1627 (#1834) 2024-05-25 01:57:00 +10:00
.ps-rule Added file assertion helpers #534 (#535) 2020-09-03 23:41:36 +10:00
.vscode Bump System.Drawing.Common from 8.0.4 to 8.0.5 (#1817) 2024-05-17 14:38:44 +10:00
docs Bump Microsoft.CodeAnalysis.Common from 4.9.2 to 4.10.0 (#1854) 2024-06-19 12:48:44 +10:00
overrides Add vNext announcement in docs (#1572) 2023-07-17 01:32:00 +10:00
schemas Add break option #1508 (#1851) 2024-06-08 16:21:37 +10:00
scripts Updates to build pipeline (#1454) 2023-02-25 22:46:45 +10:00
src Bump Microsoft.CodeAnalysis.Common from 4.9.2 to 4.10.0 (#1854) 2024-06-19 12:48:44 +10:00
tests Refactoring (#1852) 2024-06-08 17:41:57 +10:00
.editorconfig Code quality updates (#1710) 2023-12-21 15:32:21 +10:00
.gitignore Fixes markdown parsing for Spanish #1286 (#1287) 2022-09-30 00:59:37 +10:00
.markdownlint.json Added CLI commands to list and report status of locked modules #1729 (#1731) 2024-01-15 09:33:57 +10:00
.platyps.yml CI process update (#2) 2018-11-24 11:40:49 +10:00
CHANGELOG.md Bump docs for v3 (#1569) 2023-07-17 00:19:06 +10:00
CODE_OF_CONDUCT.md Update to contributing docs (#361) 2019-12-23 19:12:51 +10:00
CONTRIBUTING.md General repo documentation updates (#989) 2022-02-22 19:23:07 +10:00
GitVersion.yml Bump to v3 in GitVersion (#1633) 2023-10-03 23:20:10 +10:00
LICENSE Add SUPPORT.md (#557) 2020-09-26 21:34:08 +10:00
NuGet.config Add NuGet config (#1212) 2022-08-10 15:22:53 +10:00
PSRule.sln Code quality updates (#1784) 2024-03-30 23:21:41 +10:00
README.md Add break option #1508 (#1851) 2024-06-08 16:21:37 +10:00
SECURITY.md Updates to started repo files (#1668) 2023-11-15 00:08:11 +10:00
SUPPORT.md Updated docs files (#1505) 2023-04-22 16:13:35 +10:00
ThirdPartyNotices.txt Fix synopsis comment capture #214 (#258) 2019-08-01 23:26:38 +10:00
build.ps1 Updates to build pipeline (#1454) 2023-02-25 22:46:45 +10:00
mkdocs.yml Add security guidance (#1844) 2024-05-30 14:41:35 +10:00
modules.json Bump PowerShell dependencies (#1858) 2024-06-19 12:34:21 +10:00
pipeline.build.ps1 Fixes CSV output of multiple lines #1627 (#1834) 2024-05-25 01:57:00 +10:00
ps-project.yaml Update links after repo migration #307 (#312) 2019-10-12 12:48:07 +10:00
ps-rule.lock.json Added CLI commands to list and report status of locked modules #1729 (#1731) 2024-01-15 09:33:57 +10:00
ps-rule.yaml Simplify handling of inputs from files using emitters #1179 (#1830) 2024-05-24 22:32:55 +10:00
requirements-docs.txt Bump mkdocs-material from 9.5.25 to 9.5.26 (#1850) 2024-06-07 23:29:55 +10:00

README.md

PSRule

A cross-platform module to validate infrastructure as code (IaC) and objects using PowerShell rules. PSRule works great and integrates with popular continuous integration (CI) systems.

Open in vscode.dev

Summary

Features of PSRule include

  • DevOps - Built to support DevOps culture and tools.

  • Extensible - Define tests using YAML, JSON, or PowerShell format.

  • Reusable - Reuse and share rules across teams or organizations.

Project objectives

  1. Extensible:
    • Provide an execution environment (tools and language) to validate infrastructure code.
    • Handling of common concerns such as input/ output/ reporting should be handled by the engine.
    • Language must be flexible enough to support a wide range of use cases.
  2. DevOps:
    • Validation should support and enhance DevOps workflows by providing fast feedback in pull requests.
    • Allow quality gates to be implemented between environments such development, test, and production.
  3. Cross-platform:
    • A wide range of platforms can be used to author and deploy infrastructure code. PSRule must support rule validation and authoring on Linux, MacOS, and Windows.
    • Runs in a Linux container. For continuous integration (CI) systems that do not support PowerShell, run in a container.
  4. Reusable:
    • Validation should plug and play, reusable across teams and organizations.
    • Any reusable validation will have exceptions. Rules must be able to be disabled where they are not applicable.

Continue reading the PSRule design specification.

Back to the summary

Support

This project uses GitHub Issues to track bugs and feature requests. Please search the existing issues before filing new issues to avoid duplicates.

  • For new issues, file your bug or feature request as a new issue.
  • For help, discussion, and support questions about using this project, join or start a discussion.

Support for this project/ product is limited to the resources listed above.

Back to the summary

Getting the module

You can download and install the PSRule module from the PowerShell Gallery.

Module Description Downloads / instructions
PSRule Validate infrastructure as code (IaC) and objects using PowerShell rules. latest / instructions

For rule and integration modules see related projects.

Back to the summary

Getting extensions

Companion extensions are available for the following platforms.

Platform Description Downloads / instructions
Azure Pipelines Validate infrastructure as code (IaC) and DevOps repositories using Azure Pipelines. latest / instructions
GitHub Actions Validate infrastructure as code (IaC) and DevOps repositories using GitHub Actions. latest / instructions
Visual Studio Code Visual Studio Code extension for PSRule. latest / instructions

Back to the summary

Getting started

For an quickstart example of using PSRule see Create a standalone rule. For specific use cases see scenarios.

For frequently asked questions, see the FAQ.

Back to the summary

Scenarios

For walk through examples of PSRule usage see:

Back to the summary

Language reference

PSRule extends PowerShell with domain specific language (DSL) keywords, cmdlets and automatic variables.

Keywords

The following language keywords are used by the PSRule module:

  • Rule - A rule definition.
  • Exists - Assert that a field or property must exist.
  • Match - Assert that the field must match any of the regular expressions.
  • AnyOf - Assert that any of the child expressions must be true.
  • AllOf - Assert that all of the child expressions must be true.
  • Within - Assert that the field must match any of the values.
  • TypeOf - Assert that the object must be of a specific type.
  • Reason - Return a reason for why the rule failed.
  • Recommend - Return a recommendation to resolve the issue and pass the rule.

Back to the summary

Commands

The following commands exist in the PSRule module:

Back to the summary

Concepts

The following conceptual topics exist in the PSRule module:

Back to the summary

Schemas

PSRule uses the following schemas:

  • Options - Schema for PSRule YAML options file.
  • Language - Schema for PSRule resources such as baselines.
  • Resources - Schema for PSRule resources documents used with JSON.

Back to the summary

For a list of projects and integrations see Related projects.

Changes and versioning

This repository uses semantic versioning to declare breaking changes. For details please see the changes and versioning.

Contributing

This project welcomes contributions and suggestions. If you are ready to contribute, please visit the contribution guide.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Maintainers

License

This project is licensed under the MIT License.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Back to the summary