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

refactor(misconf): Remove unused options #7849

Open
simar7 opened this issue Nov 1, 2024 · 2 comments · May be fixed by #7896
Open

refactor(misconf): Remove unused options #7849

simar7 opened this issue Nov 1, 2024 · 2 comments · May be fixed by #7896
Assignees
Labels
scan/misconfiguration Issues relating to misconfiguration scanning
Milestone

Comments

@simar7
Copy link
Member

simar7 commented Nov 1, 2024

We have a few options within the misconfiguration scanner that aren't used they are as below:

  1. combined
    Combined bool
  2. rego warnings https://github.com/aquasecurity/trivy/blob/main/pkg/iac/scan/result.go#L198
@simar7 simar7 added the scan/misconfiguration Issues relating to misconfiguration scanning label Nov 1, 2024
@simar7 simar7 added this to the v0.58.0 milestone Nov 1, 2024
@simar7 simar7 self-assigned this Nov 1, 2024
@nikpivkin
Copy link
Contributor

Warnings are used in trivy-operator tests:

grep -rn "warn"
./go.mod:360:	gopkg.in/warnings.v0 v0.1.2 // indirect
./go.sum:1799:gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
./go.sum:1800:gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
./docs/docs/design/design_compliance_report.md:483:                "status": "warn"
./docs/docs/compliance/compliance.md:3:!!! warning "EXPERIMENTAL"
./docs/getting-started/installation/upgrade.md:8:!!! warning
./docs/tutorials/writing-custom-configuration-audit-policies.md:36:Once we've got our metadata defined, we need to create the logic of the policy, which is done in the `deny` or `warn`
./pkg/policy/policy_test.go:305:			name: "Should eval warn rule with invalid resource as failed check",
./pkg/policy/policy_test.go:342:		warn[res] {
./pkg/policy/policy_test.go:373:			name: "Should eval warn rule with valid resource as successful check",
./pkg/policy/policy_test.go:413:		warn[res] {
./pkg/policy/policy_test.go:555:			name:          "Should eval warn rule with any resource and multiple messages",
./pkg/policy/policy_test.go:623:			name: "Should eval warn role rule with built in policies",
./pkg/policy/policy_test.go:933:	// varMessage is the name of Rego variable used to bind deny or warn
./pkg/policy/policy_test.go:939:// `warn` rules.
./pkg/policy/policy_test.go:947:	// Messages deny or warning messages

@simar7 simar7 linked a pull request Nov 9, 2024 that will close this issue
6 tasks
@simar7
Copy link
Member Author

simar7 commented Nov 9, 2024

Warnings are used in trivy-operator tests:

grep -rn "warn"
./go.mod:360:	gopkg.in/warnings.v0 v0.1.2 // indirect
./go.sum:1799:gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME=
./go.sum:1800:gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI=
./docs/docs/design/design_compliance_report.md:483:                "status": "warn"
./docs/docs/compliance/compliance.md:3:!!! warning "EXPERIMENTAL"
./docs/getting-started/installation/upgrade.md:8:!!! warning
./docs/tutorials/writing-custom-configuration-audit-policies.md:36:Once we've got our metadata defined, we need to create the logic of the policy, which is done in the `deny` or `warn`
./pkg/policy/policy_test.go:305:			name: "Should eval warn rule with invalid resource as failed check",
./pkg/policy/policy_test.go:342:		warn[res] {
./pkg/policy/policy_test.go:373:			name: "Should eval warn rule with valid resource as successful check",
./pkg/policy/policy_test.go:413:		warn[res] {
./pkg/policy/policy_test.go:555:			name:          "Should eval warn rule with any resource and multiple messages",
./pkg/policy/policy_test.go:623:			name: "Should eval warn role rule with built in policies",
./pkg/policy/policy_test.go:933:	// varMessage is the name of Rego variable used to bind deny or warn
./pkg/policy/policy_test.go:939:// `warn` rules.
./pkg/policy/policy_test.go:947:	// Messages deny or warning messages

Thanks for the heads up. I think we should remove these tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scan/misconfiguration Issues relating to misconfiguration scanning
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants