From 894f270cc99ae1d0040539ef412dab0ac299ec8c Mon Sep 17 00:00:00 2001 From: simar7 <1254783+simar7@users.noreply.github.com> Date: Thu, 20 Jun 2024 13:53:36 -0600 Subject: [PATCH] chore(plugin): Rename plugin (#181) * chore(plugin): Rename plugin * fix make target * update usage --- Makefile | 8 ++++++-- README.md | 12 +++++------- pkg/commands/app.go | 12 ++++++------ plugin.yaml | 14 +++++++------- 4 files changed, 24 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index dd994ef..af7278e 100755 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ test: PLATFORMS = linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64 OUTPUTS = $(patsubst %,%/trivy-aws,$(PLATFORMS)) -build: $(OUTPUTS) +build: clean $(OUTPUTS) # os/arch/trivy-aws %/trivy-aws: @mkdir -p $(dir $@); \ @@ -25,4 +25,8 @@ quality: .PHONY: update-aws-deps update-aws-deps: @grep aws-sdk-go-v2 go.mod | grep -v '// indirect' | sed 's/^[ [[:blank:]]]*//g' | sed 's/[[:space:]]v.*//g' | xargs go get - @go mod tidy \ No newline at end of file + @go mod tidy + +.PHONY: clean +clean: + rm -rf trivy-aws* \ No newline at end of file diff --git a/README.md b/README.md index d46c2f0..08b2ee5 100755 --- a/README.md +++ b/README.md @@ -47,24 +47,22 @@ The following services are supported: ```shell Usage: - trivy aws-scan [flags] + trivy aws [flags] Examples: # basic scanning - $ trivy aws-scan --region us-east-1 + $ trivy aws --region us-east-1 # limit scan to a single service: - $ trivy aws-scan --region us-east-1 --service s3 + $ trivy aws --region us-east-1 --service s3 # limit scan to multiple services: - $ trivy aws-scan --region us-east-1 --service s3 --service ec2 + $ trivy aws --region us-east-1 --service s3 --service ec2 # force refresh of cache for fresh results - $ trivy aws-scan --region us-east-1 --update-cache + $ trivy aws --region us-east-1 --update-cache ``` -_trivy-aws_ is the AWS misconfiguration scanning logic for Trivy - Please see [ARCHITECTURE.md](ARCHITECTURE.md) for more information. _trivy-aws_ is an [Aqua Security](https://aquasec.com) open source project. diff --git a/pkg/commands/app.go b/pkg/commands/app.go index 492ade5..8db6949 100644 --- a/pkg/commands/app.go +++ b/pkg/commands/app.go @@ -38,27 +38,27 @@ func NewCmd() *cobra.Command { sort.Strings(services) cmd := &cobra.Command{ - Use: "aws-scan [flags]", + Use: "aws [flags]", Aliases: []string{}, Args: cobra.ExactArgs(0), Short: "[EXPERIMENTAL] Scan AWS account", - Long: fmt.Sprintf(`Scan an AWS account for misconfigurations. Trivy uses the same authentication methods as the AWS CLI. See https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html + Long: fmt.Sprintf(`Scan an AWS account for misconfigurations. It uses the same authentication methods as the AWS CLI. See https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html The following services are supported: - %s `, strings.Join(services, "\n- ")), Example: ` # basic scanning - $ trivy aws-scan --region us-east-1 + $ trivy aws --region us-east-1 # limit scan to a single service: - $ trivy aws-scan --region us-east-1 --service s3 + $ trivy aws --region us-east-1 --service s3 # limit scan to multiple services: - $ trivy aws-scan --region us-east-1 --service s3 --service ec2 + $ trivy aws --region us-east-1 --service s3 --service ec2 # force refresh of cache for fresh results - $ trivy aws-scan --region us-east-1 --update-cache + $ trivy aws --region us-east-1 --update-cache `, PreRunE: func(cmd *cobra.Command, args []string) error { if err := awsFlags.Bind(cmd); err != nil { diff --git a/plugin.yaml b/plugin.yaml index 7aaec5f..09bcd8a 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -1,8 +1,8 @@ -name: aws-scan +name: aws repository: github.com/aquasecurity/trivy-aws maintainer: aquasecurity summary: Trivy AWS Cloud scanning plugin -version: "0.11.0" +version: "0.12.0" usage: AWS Trivy plugin description: |- Trivy AWS plugin for the Trivy security scanner @@ -11,25 +11,25 @@ platforms: - selector: os: darwin arch: amd64 - uri: https://github.com/aquasecurity/trivy-aws/releases/download/v0.11.0/trivy-aws-darwin-amd64.tar.gz + uri: https://github.com/aquasecurity/trivy-aws/releases/download/v0.12.0/trivy-aws-darwin-amd64.tar.gz bin: ./trivy-aws-darwin-amd64 - selector: os: darwin arch: arm64 - uri: https://github.com/aquasecurity/trivy-aws/releases/download/v0.11.0/trivy-aws-darwin-arm64.tar.gz + uri: https://github.com/aquasecurity/trivy-aws/releases/download/v0.12.0/trivy-aws-darwin-arm64.tar.gz bin: ./trivy-aws-darwin-arm64 - selector: os: linux arch: amd64 - uri: https://github.com/aquasecurity/trivy-aws/releases/download/v0.11.0/trivy-aws-linux-amd64.tar.gz + uri: https://github.com/aquasecurity/trivy-aws/releases/download/v0.12.0/trivy-aws-linux-amd64.tar.gz bin: ./trivy-aws-linux-amd64 - selector: os: linux arch: arm64 - uri: https://github.com/aquasecurity/trivy-aws/releases/download/v0.11.0/trivy-aws-linux-arm64.tar.gz + uri: https://github.com/aquasecurity/trivy-aws/releases/download/v0.12.0/trivy-aws-linux-arm64.tar.gz bin: ./trivy-aws-linux-arm64 - selector: os: windows arch: amd64 - uri: https://github.com/aquasecurity/trivy-aws/releases/download/v0.11.0/trivy-aws-windows-amd64.tar.gz + uri: https://github.com/aquasecurity/trivy-aws/releases/download/v0.12.0/trivy-aws-windows-amd64.tar.gz bin: ./trivy-aws-windows-amd64