Documentation
¶
Index ¶
- Constants
- func CheckTagAndPullArchive(url, tool, creds string, archivePath *os.File) error
- func CreateTarball(sourcePath, outputPath string) error
- func CreateWorkspace(desiredTool, ociURL, creds string) error
- func ExtractTarContents(tarReader *tar.Reader, destinationDir string) error
- func FetchPolicyFromRegistry(cmd string) (string, error)
- func GenerateCraneOptions(ctx context.Context, ref name.Reference, auth authn.Authenticator, ...) ([]crane.Option, error)
- func GetCreds(creds string) (authn.Authenticator, error)
- func GetRemoteURL() (string, error)
- func ParseAnnotations(args []string) (map[string]string, error)
- func ParseOCIReference(ociURL string) (name.Reference, error)
- func PullArtifact(ctx context.Context, creds, dest, path string) error
- func SignCosign(imageRef, keyRef string) error
- func VerifyArifact(ctx context.Context, url, key string) (verified bool, err error)
Constants ¶
const ( // CreatedAnnotation is the OpenContainers annotation for specifying // the date and time on which the OCI artifact was built (RFC 3339). CreatedAnnotation = "org.opencontainers.image.created" // ConfigMediaType is the OpenContainers artifact media type for the config layer. ConfigMediaType = "application/vnd.genval.config.v1+json" // ContentMediaType is the OpenContainers artifact media type for the content layer. ContentMediaType = "application/vnd.genval.content.v1.tar+gzip" ContentTypeAnnotation = "genval.content.type" // SourceAnnotation is the OpenContainers annotation for specifying // the upstream source of an OCI artifact. SourceAnnotation = "org.opencontainers.image.source" URLPrefix = "oci://" // TODO: Move all the URLs to a .env file to read from // OCI URLs for Rego policies DockerfilePolicies = URLPrefix + "ghcr.io/intelops/policyhub/genval/dockerfile_policies:v0.0.1" InfrafilePolicies = URLPrefix + "ghcr.io/intelops/policyhub/genval/infrafile_policies:v0.0.1" TerraformPolicies = URLPrefix + "ghcr.io/intelops/policyhub/genval/terraform_policies:v0.0.1" InputPolicies = URLPrefix + "ghcr.io/intelops/policyhub/genval/input_policies:v0.0.1" )
Variables ¶
This section is empty.
Functions ¶
func CheckTagAndPullArchive ¶ added in v0.1.1
CheckTagAndPullArchive checks for provided tag to be available in the remote, if available pulls the archive and stores it in the specified directory and retuens an error if encountered.
func CreateTarball ¶
CreateTarball creates a tarball from a file or directory.
func CreateWorkspace ¶
func ExtractTarContents ¶
ExtractTarContents extracts the contents of a tar.Reader to the specified directory.
func FetchPolicyFromRegistry ¶ added in v0.1.5
FetchPolicyFromRegistry fetches the policy based on the command provided
func GenerateCraneOptions ¶ added in v0.1.6
func GenerateCraneOptions(ctx context.Context, ref name.Reference, auth authn.Authenticator, scopes []string) ([]crane.Option, error)
Most parts of GenerateCraneOptions and its related funcs are copied from https://github.com/google/go-containerregistry/blob/1b4e4078a545f2b6f96766a064b45ee77cdbefdd/pkg/v1/remote/options.go#L128
func GetRemoteURL ¶ added in v0.1.5
GetGitRemoteURL fetches the remote url
func ParseOCIReference ¶ added in v0.1.6
func PullArtifact ¶
PullArtifact checks if tag exists and pull's the artifact from remote repository and writes to disk
func SignCosign ¶
SignCosign signs an image (`imageRef`) in Keyless mode https://github.com/sigstore/cosign/blob/main/KEYLESS.md.
Types ¶
This section is empty.