-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(misconf): Add compliance check support #3130
Conversation
00fd5d1
to
daea72b
Compare
@simar7 you are not using the |
pkg/flag/report_flags.go
Outdated
@@ -89,7 +89,7 @@ var ( | |||
Name: "compliance", | |||
ConfigName: "scan.compliance", | |||
Value: "", | |||
Usage: "compliance report to generate (nsa)", | |||
Usage: "compliance report to generate (nsa, cis)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wonder if there is a way to override it so it will not show cis
for trivy k8s
and nsa
for trivy aws
sub command as it is not supported and throw an error if used by users
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could leave the specs out of the help text to make it more generic.
Usage: "compliance report to generate (nsa, cis)", | |
Usage: "compliance report to generate", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can override usage like 10ad755, but should the value cis
? I thought it should be awscis1.2
and awscis1.4
. Please correct me if I'm missing something.
BTW, even though we can override the accepted values, do we still need the aws
prefix? I mean cis1.2
vs awscis1.2
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@simar7 Please review my change. Also, do we support CIS 1.4 too? Don't we mention that in the doc? Looks like the current doc mentions CIS 1.2 only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your change looks good, thanks I learnt something new!
I updated the docs to include 1.4 as well.
As for the prefixes, I think we should include them. CIS publishes many benchmarks and we should be clear that its the AWS version of the CIS benchmarks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for the prefixes, I think we should include them. CIS publishes many benchmarks and we should be clear that its the AWS version of the CIS benchmarks.
Got it 👍
That’s right. As we discussed last time, it uses options.ScannerwithSpec in defsec to load only the checks that need to be loaded for a particular spec. |
6619acf
to
5050795
Compare
|
Good point - I didn't think of that. I added it here https://github.com/aquasecurity/trivy/pull/3130/files#diff-fe969e5428e7e462874a674a3116c74787735b8a6d25f113cd3c06653433eb38 along with some tests. PTAL. |
lgtm |
Addresses: #2919 Requires: aquasecurity/defsec#1045 Signed-off-by: Simar <simar@linux.com>
Signed-off-by: Simar <simar@linux.com>
Signed-off-by: Simar <simar@linux.com>
Signed-off-by: Simar <simar@linux.com>
Signed-off-by: Simar <simar@linux.com>
Signed-off-by: Simar <simar@linux.com>
5adfb90
to
d9d268e
Compare
Signed-off-by: Simar <simar@linux.com>
d9d268e
to
1b350a6
Compare
Signed-off-by: Simar <simar@linux.com>
1b350a6
to
ef36a6a
Compare
Signed-off-by: Simar <simar@linux.com>
I believe you just forgot to remove the png, so I've removed it in 3c15cd0. Please let me know if I'm missing something. |
Signed-off-by: Simar simar@linux.com
Description
This adds the
--compliance
check flag to the misconfiguration scanning. It works as follows:You can also pass in custom reports such as:
Related issues
Checklist