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

Accept reports on the stdin #11

Open
Nr18 opened this issue Nov 1, 2021 · 0 comments
Open

Accept reports on the stdin #11

Nr18 opened this issue Nov 1, 2021 · 0 comments
Labels
feature New feature or request

Comments

@Nr18
Copy link
Owner

Nr18 commented Nov 1, 2021

When you want to scan let say a CDK application using cfn-guard. You first need to find each template and then scan it:

cdk synth
find ./cdk.out -name "*.template.json" \
  -exec cfn-guard validate \
  --rules my-rules.guard \
  --data {} \
  --output-format json \
  --show-summary none > reports/cfn-guard.json \;
report2junit --source-type cfn-guard reports/cfn-guard.json

This would result in a single JSON file that contains 2 reports. The problem with this is that it is not valid JSON as each report is just appended on the next line.

Therefore, it would be easier to accept the report from the stdin. For example:

cdk synth
find ./cdk.out -name "*.template.json" \
  -exec cfn-guard validate \
  --rules my-rules.guard \
  --data {} \
  --output-format json \
  --show-summary none | report2junit ./report/cfn-guard.xml \;

It should just append the report to the ./report/cfn-guard.xml file. This feature will depend on #7 and #8.

@Nr18 Nr18 added the feature New feature or request label Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant