Closed tmprender closed 18 hours ago
@tmprender What about the following command:
checkov --list --framework ansible | awk -F'|' 'NR > 1 {print $3}' | sort | uniq
It would be much easier than changing/supporting a new format. The purpose of the –list
option is to output both the policy and the validations made against the resources for that policy.
Other than that, we would be glad to receive a contribution for a new option. Thanks 🙂
Ah, this can be attributed to user error then :) this works.
FYI - it does not seem that NR > 1
is needed but I did learn something new...
Thanks for solution and reply.
Describe the issue When calling the
--list
option to output policies, this output cannot be easily parsed using awk (and does not support outputting to json).Additional context Expecting the header and values in each column to be aligned and not to have to write custom parsing on separators.
Example: $ checkov --list --framework ansible | awk '{print $3}' | head -n 5 Id
CKV_ANSIBLE_1 CKV_ANSIBLE_1 CKV_ANSIBLE_1