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

feat: support aliases in CLI flag, env and config #3481

Merged
merged 2 commits into from
Jan 25, 2023

Conversation

knqyf263
Copy link
Collaborator

@knqyf263 knqyf263 commented Jan 24, 2023

Description

This PR adds support for aliases in CLI flag, env and config. Currently, CLI flag is only supported, but others are not. Also, it shows deprecation messages for deprecated aliases.

CLI flag

Before

$ trivy image --security-checks vuln alpine:3.17
2023-01-24T11:57:47.570Z        INFO    Vulnerability scanning is enabled

After

$ trivy image --security-checks vuln alpine:3.17
2023-01-24T11:57:47.570Z        WARN    '--security-checks' is deprecated. Use '--scanners' instead.
2023-01-24T11:57:47.570Z        INFO    Vulnerability scanning is enabled

Env

$ TRIVY_SECURITY_CHECKS=vuln trivy image alpine:3.17
2023-01-25T11:30:12.090+0200    WARN    'TRIVY_SECURITY_CHECKS' is deprecated. Use 'TRIVY_SCANNERS' instead.

Config

$ trivy image alpine:3.17
2023-01-25T11:30:46.062+0200    INFO    Loaded trivy.yaml
2023-01-25T11:30:46.064+0200    WARN    'scan.security-checks' in config file is deprecated. Use 'scan.scanners' instead.

Related PRs

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've followed the conventions in the PR title.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

@knqyf263 knqyf263 self-assigned this Jan 24, 2023
@knqyf263 knqyf263 marked this pull request as ready for review January 24, 2023 13:50
@knqyf263 knqyf263 merged commit 1b368be into aquasecurity:main Jan 25, 2023
@knqyf263 knqyf263 deleted the feat/flag_alias branch January 25, 2023 09:33
selzoc added a commit to cloudfoundry/bosh-package-golang-release that referenced this pull request Feb 8, 2024
Fixes:
```
WARN	'--security-checks' is deprecated. Use '--scanners' instead.
```

ref: aquasecurity/trivy#3481
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants