-
Notifications
You must be signed in to change notification settings - Fork 53
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 support for JSON based resources #833
Comments
@BernieWhite Let me know what else we should cover in this issue. Happy to add more JSON support for the other resources like Module Configurations, Rules, and Selectors. |
@ArmaanMcleod For this one JSON rule and selector support would be key. This would make it easier to do Azure/PSRule.Rules.Azure#181. Since selectors are a subset of rules enabling both should not be much additional work once rules is done. Once rules can be written in JSON, we can work to export policies from an Azure subscription to JSON based rules. Currently baselines can be formatted/ exported to JSON however they would not currently be read from JSON by the pipeline. For example ps1 and YAML rules are pulled into PSRule via: PSRule/src/PSRule/Host/HostHelper.cs Lines 35 to 41 in c05a7c7
Other resources via: PSRule/src/PSRule/Host/HostHelper.cs Lines 95 to 101 in c05a7c7
Sources discovered by: PSRule/src/PSRule/Pipeline/SourcePipeline.cs Lines 334 to 338 in c05a7c7
|
Thanks @BernieWhite. I think I'll start by creating a What do you think? |
To close this out, just need to ensure module configs work with JSON. I havn't tested this, but adding some tests wouldn't hurt. |
@ArmaanMcleod Yes, should be fine module configs are the only resource not tested. Let's add tests and close. Thanks. |
Currently resources such as Baselines, Module Configurations, Rules, and Selectors can be written in YAML.
This is great and offers a good option humans to write these resources.
For some cases it would be helpful to make it easier code to automatically generate these resources. While YAML can be automated, there is much better support for this with JSON, so added JSON support for storing resource would be a good idea.
The text was updated successfully, but these errors were encountered: