Giter VIP home page Giter VIP logo

gke-binary-auth-tools's Introduction

Binary Authorization Tools

Disclaimer: This is not an official Google product.

This project contains a set of tools to help with the implementation of Binary Authorization in Google Cloud.

CVE Checker - cve-checker/main.go

A Go program that parses the JSON output of the vulnerabilities for an image in Google Container Registry (GCR). If any of the vulnerabilities are higher than the CVSS threshold, it exits with an error.

Check Vulnerabilities Script - scripts/check_vulnerabilities.sh

Wait for a vulnerability scan to complete for a particular image in GCR then run the CVE Checker against it to make sure that no vulnerabilites are higher than the threshold.

Options:
  -p <project ID>      Project ID
  -i <image path>      Full image path including sha (gcr.io/my-project/image-name@sha256:....)
  -t <CVSS Threshold>  Maximum CVSS score allowed in discovered CVEs

Create Attestation Script - scripts/create_attestation.sh

Creates an attestation for the given artifact using Cloud KMS.

Global options:
  -p <project>
      ID of the Google Cloud project (e.g. "my-project")
  -i <image>
      Full image including SHA (e.g. "gcr.io/my-project/my-image@sha245:...")

Attestor options:
  -a <attestor>
      ID of the attestor (e.g. "my-attestor")
  -A <attestor project>
      ID of the project where the attestor exists. Defaults to the global
      project ID.

KMS options:
  -v <kms key version>
      Version of the KMS key to use for signing (e.g. "1")
  -k <kms key>
      Name of the KMS get (e.g. "my-key")
  -l <kms location>
      Location of the KMS key (e.g. "global")
  -r <kms key ring>
      Name of the KMS keyring (e.g. "my-keyring")
  -V <kms project>
      ID of the project where the KMS key exists. Defaults to the global
      project ID.

Contributing

See CONTRIBUTING

License

Copyright 2019, Google, Inc. Licensed under the Apache License, Version 2.0

See LICENSE.

gke-binary-auth-tools's People

Contributors

bgood avatar chrisricci avatar hasebe avatar sethvargo avatar temores avatar zsais avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

gke-binary-auth-tools's Issues

Denied by Attestor. Attestor cannot attest to an image deployed by tag.

Hello,

I was trying to showcase binary authorization to my client as POC. During the deployment, it is failing with following error message:

pods "hello-app-6589454ddd-wlkbg" is forbidden: image policy webhook backend denied one or more images: Denied by cluster admission rule for us-central1.staging-cluster. Denied by Attestor. Image gcr.io//hello-app:e1479a4 denied by projects//attestors/vulnz-attestor: Attestor cannot attest to an image deployed by tag

I have adhered all steps mentioned in the site.

I have verified the image repeatedly for few occurances, for example using below command to force fully make the attestation:

gcloud alpha container binauthz attestations sign-and-create   --project "projectxyz"  --artifact-url "gcr.io/projectxyz/hello-app@sha256:82f1887cf5e1ff80ee67f4a820703130b7d533f43fe4b7a2b6b32ec430ddd699"   --attestor "vulnz-attestor"   --attestor-project "projectxyz"   --keyversion "1"   --keyversion-key "vulnz-signer"   --keyversion-location "us-central1"   --keyversion-keyring "binauthz"   --keyversion-project "projectxyz"

It throws error as:

ERROR: (gcloud.alpha.container.binauthz.attestations.sign-and-create) Resource in project [project xyz] is the subject of a conflict: occurrence ID "c5f03cc3-3829-44cc-ae38-2b2b3967ba61" already exists in project "projectxyz"

So when I verify, I found the attestion present:

gcloud beta container binauthz attestations list       --artifact-url "gcr.io/projectxyz/hello-app@sha256:82f1887cf5e1ff80ee67f4a820703130b7d533f43fe4b7a2b6b32ec430ddd699"       --attestor "vulnz-attestor"       --attestor-project "projectxyz"       --format json  | jq '.[0].kind' \
>       | grep 'ATTESTATION'
"ATTESTATION"

Here are the screen shots:

deployment error

container

cloud build

Any feedback please?

Thanks in advance.

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.