mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-25 09:10:39 +00:00
feat: add support for SBOM attestation (#217)
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
This commit is contained in:
parent
a1837cc829
commit
cf1e48b342
@ -260,3 +260,8 @@ properties:
|
|||||||
description: Generate [provenance](https://docs.docker.com/build/attestations/slsa-provenance/) attestation for the build (shorthand for `--attest=type=provenance`).
|
description: Generate [provenance](https://docs.docker.com/build/attestations/slsa-provenance/) attestation for the build (shorthand for `--attest=type=provenance`).
|
||||||
type: string
|
type: string
|
||||||
required: false
|
required: false
|
||||||
|
|
||||||
|
- name: sbom
|
||||||
|
description: Generate [sbom](https://docs.docker.com/build/attestations/sbom/) attestation for the build (shorthand for `--attest type=sbom`).
|
||||||
|
type: string
|
||||||
|
required: false
|
||||||
|
@ -314,5 +314,12 @@ func settingsFlags(settings *plugin.Settings, category string) []cli.Flag {
|
|||||||
Destination: &settings.Build.Provenance,
|
Destination: &settings.Build.Provenance,
|
||||||
Category: category,
|
Category: category,
|
||||||
},
|
},
|
||||||
|
&cli.StringFlag{
|
||||||
|
Name: "sbom",
|
||||||
|
EnvVars: []string{"PLUGIN_SBOM"},
|
||||||
|
Usage: "generates sbom attestation for the build",
|
||||||
|
Destination: &settings.Build.SBOM,
|
||||||
|
Category: category,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -156,6 +156,10 @@ func commandBuild(build Build, dryrun bool) *execabs.Cmd {
|
|||||||
args = append(args, "--provenance", build.Provenance)
|
args = append(args, "--provenance", build.Provenance)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if build.SBOM != "" {
|
||||||
|
args = append(args, "--sbom", build.SBOM)
|
||||||
|
}
|
||||||
|
|
||||||
return execabs.Command(dockerBin, args...)
|
return execabs.Command(dockerBin, args...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,6 +64,7 @@ type Build struct {
|
|||||||
NamedContext cli.StringSlice // Docker build named context
|
NamedContext cli.StringSlice // Docker build named context
|
||||||
Labels cli.StringSlice // Docker build labels
|
Labels cli.StringSlice // Docker build labels
|
||||||
Provenance string // Docker build provenance attestation
|
Provenance string // Docker build provenance attestation
|
||||||
|
SBOM string // Docker build sbom attestation
|
||||||
}
|
}
|
||||||
|
|
||||||
// Settings for the Plugin.
|
// Settings for the Plugin.
|
||||||
|
Loading…
Reference in New Issue
Block a user