Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for overriding default configuration #60

Open
BernieWhite opened this issue Feb 4, 2021 · 2 comments
Open

Add documentation for overriding default configuration #60

BernieWhite opened this issue Feb 4, 2021 · 2 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed

Comments

@BernieWhite
Copy link
Member

PSRule for CAF includes a number of configuration options which include the defaults.

Currently no documentation is provided on overriding these configurations with different values.

@BernieWhite BernieWhite added documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed labels Feb 4, 2021
@majorku5anagi
Copy link

Hi @BernieWhite I believe that locally, I can tamper with Baseline.Rule.yaml, CAF.Common.Rule.ps1, CAF.Name.Rule.ps1, CAF.Tag.Rule.ps1, Config.Rule.yaml but in pipeline only thing that I can think of is to subdivide the operations of running PSRule.Rules.CAF into installing the module, overwritting mentioned .ps1 files with my own prepared in repo and then asserting the rule. If there is a better way, please let me know. I'm not sure if the overriding feature is missing or just documentation on how to do it. Maybe something needs to be added to ps-rule.yaml?

@BernieWhite
Copy link
Member Author

@majorku5anagi You can create a custom baseline or override settings in ps-rule.yaml.


Creating baselines is covered in https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Baseline/. You can create a custom baseline in the .ps-rule/ directory and reference it within your pipeline.

PSRule GitHub Action and Azure DevOps assert task allows a named baseline to be specified by the baseline: parameter.


To override in ps-rule.yaml specify one or more configuration options. For example:

configuration:
  CAF_UseLowerNames: false
  CAF_StoragePrefix: [ 'orgst', 'orgstvm', 'orgdls' ]

The list of configuration defaults is available from the built-in baseline: https://github.com/microsoft/PSRule.Rules.CAF/blob/main/src/PSRule.Rules.CAF/rules/Baseline.Rule.yaml

Not all configuration defaults are currently in use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants