Git Product home page Git Product logo

aactl's Introduction

aactl

Google Artifact Analysis (AA) service data import utility, supports OSS vulnerability scanner reports, SLSA provenance, and sigstore attestations.

AACTL is a tool that allows Google Cloud customers who use Artifact Registry to ingest vulnerabilities detected by supported scanning tools. Once ingested, vulnerabilities will be stored & managed alongside vulnerabilities detected by Artifact Analysis. Vulnerabilities are viewable within Artifact Registry UI, SDS Security Insights, gcloud, and Artifact Analysis API (Container Analysis).

AACTL can also ingest SLSA Build Provenance generated by SLSA GitHub Generator.

Detailed installation instruction are available here.

Usage

aactl supports imports of two data types: vulnerability and attestation.

In addition to CLI, aactl can also be used in your CI/CD pipeline as a Google Cloud Build builder (example) or GitHub Actions action (examples).

Vulnerability

To import vulnerabilities output by either grype, snyk, trivy scanners, start by exporting the report in JSON format:

  • grype

    grype --add-cpes-if-none -s AllLayers -o json --file report.json $image

  • snyk

    snyk container test --app-vulns --json-file-output=report.json $image

  • trivy

    trivy image --format json --output report.json $image

Once you have the vulnerability file, importing that file into AA using aactl:

aactl vulnerability --project $project \
                    --source $image \
                    --file report.json

The $image variable in the above example is the fully qualified URI of the image including its digest (e.g. us-docker.pkg.dev/project/repo/image@sha256:397d453...).

To review the imported vulnerabilities in GCP:

gcloud artifacts docker images list $repo \
  --show-occurrences \
  --format json \
  --occurrence-filter "kind=\"VULNERABILITY\" AND resource_url=\"https://$image\""

You can also navigate to Artifact Registry to view the vulnerabilities there.

Attestation

In addition to vulnerabilities, aactl can also import sigstore attestations:

aactl attestation --project $project --source $image

The $image variable in the above example is the fully qualified URI of the image including its digest (e.g. us-docker.pkg.dev/project/repo/image@sha256:397d453...).

The imported data can be accessed using gcloud:

gcloud artifacts docker images describe $image --show-provenance --format json

The resulting JSON will look something like this:

The data can also be viewed in Software Delivery Shield side panel:

SLSA level is currently not parsed properly, WIP.

Contributing

Entirely new samples are not accepted. Bug fixes are welcome, either as pull requests or as GitHub issues.

See CONTRIBUTING.md for details on how to contribute.

Licensing

Code in this repository is licensed under the Apache 2.0. See LICENSE.

aactl's People

Contributors

dependabot[bot] avatar goreleaserbot avatar mchmarny avatar taechae avatar yeshwanth1993 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aactl's Issues

`aactl vulnerability` appears to succeed with `https://` in the --source param, but nothing is uploaded

If I run:

~/go/bin/aactl vulnerability --project chris-brewer-test \
  --source https://us-central1-docker.pkg.dev/chris-brewer-test/quickstart-docker-repo/quickstart-image@sha256:88b205d7995332e10e836514fbfd59ecaf8976fc15060cd66e85cdcebe7fb356 \
  --file ~/aactl/examples/data/trivy.json --format trivy

I will see:

INF v0.0.1-default (commit: none, built: 2023-04-24 16:20 UTC)
INF found 518 vulnerabilities

Which appears to have succeeded. However, if I go to list vulnerability occurrences for this image none appear.

If I modify the above command and remove the leading https:// from the --source parameter, the output is the same and it actually succeeds in creating the vulnerability occurrences.

I don't know which makes more sense but I think either the first case should report an error or perhaps automatically remove the https:// if that is reasonable in all contexts.

Resolve dep version mismatch

Looks like there is some dep version mismatch

run golangci-lint
  Running [/home/runner/golangci-lint-1.51.2-linux-amd64/golangci-lint run --out-format=github-actions] in [] ...
  Error: could not import github.com/sigstore/cosign/pkg/cosign (-: # github.com/sigstore/cosign/pkg/cosign
  Error: vendor/github.com/sigstore/cosign/pkg/cosign/verify.go:163:24: not enough arguments in call to dssev.Verify
  	have (*"github.com/secure-systems-lab/go-securesystemslib/dsse".Envelope)
  	want (context.Context, *"github.com/secure-systems-lab/go-securesystemslib/dsse".Envelope)) (typecheck)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.