Skip to content

Commit

Permalink
chore(plugin): Rename plugin (#181)
Browse files Browse the repository at this point in the history
* chore(plugin): Rename plugin

* fix make target

* update usage
  • Loading branch information
simar7 authored Jun 20, 2024
1 parent e13d47a commit 894f270
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 22 deletions.
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@); \
Expand All @@ -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
@go mod tidy

.PHONY: clean
clean:
rm -rf trivy-aws*
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 6 additions & 6 deletions pkg/commands/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
14 changes: 7 additions & 7 deletions plugin.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

0 comments on commit 894f270

Please sign in to comment.