Giter VIP home page Giter VIP logo

attestation-demo's Introduction

Tools

syft - generate sboms from images. used by default with buildkit

grype - scan an sbom

Docker attestations - create sbom and provenance from docker build

conftest - better way to write rego

docker buildkit

requires having containerd as the image store for docker desktop enable to be able to store and push the attestations

with buildkit the attestations are stored within the layers of the image. this is different than how cosign works and the sigstore tooling. sigstore/cosign#2688

crane manifest dev.registry.tanzu.vmware.com/warroyo/buildkit-attest

provenance:

docker buildx imagetools inspect /:
--format "{{ json .Provenance.SLSA }}"

sbom:

docker buildx imagetools inspect /:
--format "{{ json .SBOM.SPDX }}"

requires using opa cli to do verifications

opa eval -i buildkit-provenance.json -d validate-base.rego data.validate.allow --format pretty

cosign

attaches artifacts to the images. this seems to be a more standard way that sigstore expects

docker build . -t dev.registry.tanzu.vmware.com/warroyo/cosign-attest

need to create provenance and sbom

sbom syft dev.registry.tanzu.vmware.com/warroyo/cosign-attest -o spdx-json > sbom.json

cosign attest --type spdxjson --predicate sbom.json --key cosign.key dev.registry.pivotal.io/warroyo/basic-build@sha256:7620cb34610ef908e5143eddc8093834d2dc8388e8188c1adee2497179162fb2 --tlog-upload=false

cosign download attestation
--predicate-type=https://spdx.dev/Document
dev.registry.tanzu.vmware.com/warroyo/cosign-attest | jq -r .payload | base64 -d | jq

cosign verify-attestation --key cosign.pub dev.registry.tanzu.vmware.com/warroyo/cosign-attest --insecure-ignore-tlog=true --type spdxjson

cosign verify-attestation --key cosign.pub dev.registry.tanzu.vmware.com/warroyo/cosign-attest --insecure-ignore-tlog=true --type spdxjson | jq -r .payload | base64 -D | jq . > att.json

cosign verify-attestation --key cosign.pub dev.registry.tanzu.vmware.com/warroyo/cosign-attest --insecure-ignore-tlog=true --type spdxjson | jq -r .payload | base64 -D | jq -r .predicate | grype

combined

docker buildx imagetools inspect dev.registry.tanzu.vmware.com/warroyo/buildkit-attest --format "{{ json .SBOM.SPDX }}" > buildkit-sbom

docker buildx imagetools inspect dev.registry.tanzu.vmware.com/warroyo/buildkit-attest --format "{{ json .Provenance.SLSA }}" >buildkit-provenance.json

then attest with cosign

cosign attest --type spdxjson --predicate buildkit-sbom.json --key cosign.key dev.registry.pivotal.io/warroyo/buildkit-attest@sha256:80f18774e1b4dc6cc1ef7fb93e42a3b41083d2fb0e141047b05e6a0bd35e9923 --tlog-upload=false

cosign attest --type slsaprovenance --predicate buildkit-provenance.json --key cosign.key dev.registry.pivotal.io/warroyo/buildkit-attest@sha256:80f18774e1b4dc6cc1ef7fb93e42a3b41083d2fb0e141047b05e6a0bd35e9923 --tlog-upload=false

attestation-demo's People

Contributors

warroyo avatar

Stargazers

Royce Williams avatar

Watchers

 avatar

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.