-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(plugin): trivy-aws as a plugin for Trivy (#153)
* feat(plugin): trivy-aws as a plugin for Trivy * add new workflow and make cmds * update gitignore * match ci config to trivy * update golangci-lint to 1.54.2 * fix lint * update review comments * remove un-needed params * update docs * refactor code from trivy pkgs * fix linter issues * consolidate pkg/cloud
- Loading branch information
Showing
30 changed files
with
5,903 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Build | ||
run: make build | ||
- name: Bundle | ||
run: make bundle | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
trivy-aws.tar.gz | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,5 @@ vendor/ | |
*.iml | ||
.vscode/ | ||
.DS_Store | ||
|
||
trivy-aws* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
# Architecture | ||
|
||
This document aims to answer the question *Where is the code that does X?* | ||
This document aims to answer the question of *Where is the code that does X?* | ||
|
||
## Project Layout | ||
|
||
The directory structure is broken down as follows: | ||
|
||
- `cmd` - Contains the setup to bootstrap as a Trivy plugin | ||
- `internal/adapters` - Adapters take input - such as a Terraform file or an AWS account - and _adapt_ it to a common format that can be used by the rules engine. This is where the bulk of the code is for supporting new cloud providers. | ||
- `pkg/scanners` - Scanners for various inputs. For example, the `terraform` scanner will scan a Terraform directory and return a list of resources. | ||
- `pkg/state` - The overall state object for Cloud providers is defined here. You should add to the `State` struct if you want to add a new cloud provider. | ||
- `pkg/terraform` - Data structures for describing Terraform resources and modules. | ||
- `pkg/types` - Useful types. Our types wrap a simple data type (e.g. `bool`) and add various metadata to it, such as file name and line number where it was defined. | ||
- `pkg/concurrency` - Data structures used to concurrently adapt resources | ||
- `pkg/cloud` - Helper libraries for AWS cloud scanning | ||
- `test` - Integration tests and other high-level tests that require a full build of the project. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/aquasecurity/trivy-aws/pkg/commands" | ||
"github.com/aquasecurity/trivy/pkg/log" | ||
) | ||
|
||
func main() { | ||
if err := run(); err != nil { | ||
log.Fatal(err.Error()) | ||
} | ||
} | ||
|
||
func run() error { | ||
cmd := commands.NewCmd() | ||
return cmd.Execute() | ||
} |
Oops, something went wrong.