REST Resource: projects.occurrences

Resource: Occurrence

Occurrence includes information about analysis occurrences for an image.

JSON representation
{
  "name": string,
  "resourceUrl": string,
  "resource": {
    object (Resource)
  },
  "noteName": string,
  "kind": enum (Kind),
  "remediation": string,
  "createTime": string,
  "updateTime": string,

  // Union field details can be only one of the following:
  "vulnerabilityDetails": {
    object (VulnerabilityDetails)
  },
  "buildDetails": {
    object (BuildDetails)
  },
  "derivedImage": {
    object (Derived)
  },
  "installation": {
    object (Installation)
  },
  "deployment": {
    object (Deployment)
  },
  "discovered": {
    object (Discovered)
  },
  "attestation": {
    object (Attestation)
  }
  // End of list of possible types for union field details.
}
Fields
name

string

Output only. The name of the Occurrence in the form "projects/{projectId}/occurrences/{OCCURRENCE_ID}"

resourceUrl

string

The unique URL of the image or the container for which the Occurrence applies. For example, https://gcr.io/project/image@sha256:foo This field can be used as a filter in list requests.

resource

object (Resource)

The resource for which the Occurrence applies.

noteName

string

An analysis note associated with this image, in the form "providers/{providerId}/notes/{NOTE_ID}" This field can be used as a filter in list requests.

kind

enum (Kind)

Output only. This explicitly denotes which of the Occurrence details are specified. This field can be used as a filter in list requests.

remediation

string

A description of actions that can be taken to remedy the Note

createTime

string (Timestamp format)

Output only. The time this Occurrence was created.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

Output only. The time this Occurrence was last updated.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

Union field details. Describes the details of the vulnerability Note found in this resource. details can be only one of the following:
vulnerabilityDetails

object (VulnerabilityDetails)

Details of a security vulnerability note.

buildDetails

object (BuildDetails)

Build details for a verifiable build.

derivedImage

object (Derived)

Describes how this resource derives from the basis in the associated note.

installation

object (Installation)

Describes the installation of a package on the linked resource.

deployment

object (Deployment)

Describes the deployment of an artifact on a runtime.

discovered

object (Discovered)

Describes the initial scan status for this resource.

attestation

object (Attestation)

Describes an attestation of an artifact.

Resource

Resource is an entity that can have metadata. E.g., a Docker image.

JSON representation
{
  "name": string,
  "uri": string,
  "contentHash": {
    object (Hash)
  }
}
Fields
name

string

The name of the resource. E.g., the name of a Docker image - "Debian".

uri

string

The unique URI of the resource. E.g., "https://gcr.io/project/image@sha256:foo" for a Docker image.

contentHash

object (Hash)

The hash of the resource content. E.g., the Docker digest.

VulnerabilityDetails

Used by Occurrence to point to where the vulnerability exists and how to fix it.

JSON representation
{
  "type": string,
  "severity": enum (Severity),
  "cvssScore": number,
  "packageIssue": [
    {
      object (PackageIssue)
    }
  ],
  "effectiveSeverity": enum (Severity)
}
Fields
type

string

The type of package; whether native or non native(ruby gems, node.js packages etc)

severity

enum (Severity)

Output only. The note provider assigned Severity of the vulnerability.

cvssScore

number

Output only. The CVSS score of this vulnerability. CVSS score is on a scale of 0-10 where 0 indicates low severity and 10 indicates high severity.

packageIssue[]

object (PackageIssue)

The set of affected locations and their fixes (if available) within the associated resource.

effectiveSeverity

enum (Severity)

The distro assigned severity for this vulnerability when that is available and note provider assigned severity when distro has not yet assigned a severity for this vulnerability.

PackageIssue

This message wraps a location affected by a vulnerability and its associated fix (if one is available).

JSON representation
{
  "affectedLocation": {
    object (VulnerabilityLocation)
  },
  "fixedLocation": {
    object (VulnerabilityLocation)
  },
  "severityName": string
}
Fields
affectedLocation

object (VulnerabilityLocation)

The location of the vulnerability.

fixedLocation

object (VulnerabilityLocation)

The location of the available fix for vulnerability.

severityName

string

BuildDetails

Message encapsulating build provenance details.

JSON representation
{
  "provenance": {
    object (BuildProvenance)
  },
  "provenanceBytes": string
}
Fields
provenance

object (BuildProvenance)

The actual provenance

provenanceBytes

string

Serialized JSON representation of the provenance, used in generating the BuildSignature in the corresponding Result. After verifying the signature, provenanceBytes can be unmarshalled and compared to the provenance to confirm that it is unchanged. A base64-encoded string representation of the provenance bytes is used for the signature in order to interoperate with openssl which expects this format for signature verification.

The serialized form is captured both to avoid ambiguity in how the provenance is marshalled to json as well to prevent incompatibilities with future changes.

BuildProvenance

Provenance of a build. Contains all information needed to verify the full details about the build from source to completion.

JSON representation
{
  "id": string,
  "projectId": string,
  "commands": [
    {
      object (Command)
    }
  ],
  "builtArtifacts": [
    {
      object (Artifact)
    }
  ],
  "createTime": string,
  "startTime": string,
  "finishTime": string,
  "creator": string,
  "logsBucket": string,
  "sourceProvenance": {
    object (Source)
  },
  "triggerId": string,
  "buildOptions": {
    string: string,
    ...
  },
  "builderVersion": string
}
Fields
id

string

Unique identifier of the build.

projectId

string

ID of the project.

commands[]

object (Command)

Commands requested by the build.

builtArtifacts[]

object (Artifact)

Output of the build.

createTime

string (Timestamp format)

Time at which the build was created.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

startTime

string (Timestamp format)

Time at which execution of the build was started.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

finishTime

string (Timestamp format)

Time at which execution of the build was finished.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

creator

string

E-mail address of the user who initiated this build. Note that this was the user's e-mail address at the time the build was initiated; this address may not represent the same end-user for all time.

logsBucket

string

Google Cloud Storage bucket where logs were written.

sourceProvenance

object (Source)

Details of the Source input to the build.

triggerId

string

Trigger identifier if the build was triggered automatically; empty if not.

buildOptions

map (key: string, value: string)

Special options applied to this build. This is a catch-all field where build providers can enter any desired additional details.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

builderVersion

string

Version string of the builder at the time this build was executed.

Command

Command describes a step performed as part of the build pipeline.

JSON representation
{
  "name": string,
  "env": [
    string
  ],
  "args": [
    string
  ],
  "dir": string,
  "id": string,
  "waitFor": [
    string
  ]
}
Fields
name

string

Name of the command, as presented on the command line, or if the command is packaged as a Docker container, as presented to docker pull.

env[]

string

Environment variables set before running this Command.

args[]

string

Command-line arguments used when executing this Command.

dir

string

Working directory (relative to project source root) used when running this Command.

id

string

Optional unique identifier for this Command, used in waitFor to reference this Command as a dependency.

waitFor[]

string

The ID(s) of the Command(s) that this Command depends on.

Artifact

Artifact describes a build product.

JSON representation
{
  "name": string,
  "checksum": string,
  "id": string,
  "names": [
    string
  ]
}
Fields
name
(deprecated)

string

Name of the artifact. This may be the path to a binary or jar file, or in the case of a container build, the name used to push the container image to Google Container Registry, as presented to docker push.

This field is deprecated in favor of the plural names field; it continues to exist here to allow existing BuildProvenance serialized to json in google.devtools.containeranalysis.v1alpha1.BuildDetails.provenance_bytes to deserialize back into proto.

checksum

string

Hash or checksum value of a binary, or Docker Registry 2.0 digest of a container.

id

string

Artifact ID, if any; for container images, this will be a URL by digest like gcr.io/projectID/imagename@sha256:123456

names[]

string

Related artifact names. This may be the path to a binary or jar file, or in the case of a container build, the name used to push the container image to Google Container Registry, as presented to docker push. Note that a single Artifact ID can have multiple names, for example if two tags are applied to one image.

Source

Source describes the location of the source used for the build.

JSON representation
{
  "artifactStorageSource": {
    object (StorageSource)
  },
  "fileHashes": {
    string: {
      object(FileHashes)
    },
    ...
  },
  "context": {
    object (SourceContext)
  },
  "additionalContexts": [
    {
      object (SourceContext)
    }
  ],

  // Union field source can be only one of the following:
  "storageSource": {
    object (StorageSource)
  },
  "repoSource": {
    object (RepoSource)
  }
  // End of list of possible types for union field source.
}
Fields
artifactStorageSource

object (StorageSource)

If provided, the input binary artifacts for the build came from this location.

fileHashes

map (key: string, value: object (FileHashes))

Hash(es) of the build source, which can be used to verify that the original source integrity was maintained in the build.

The keys to this map are file paths used as build source and the values contain the hash values for those files.

If the build source came in a single package such as a gzipped tarfile (.tar.gz), the FileHash will be for the single path to that file.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

context

object (SourceContext)

If provided, the source code used for the build came from this location.

additionalContexts[]

object (SourceContext)

If provided, some of the source code used for the build may be found in these locations, in the case where the source repository had multiple remotes or submodules. This list will not include the context specified in the context field.

Union field source. Source location information. source can be only one of the following:
storageSource
(deprecated)

object (StorageSource)

If provided, get the source from this location in in Google Cloud Storage.

repoSource
(deprecated)

object (RepoSource)

If provided, get source from this location in a Cloud Repo.

StorageSource

StorageSource describes the location of the source in an archive file in Google Cloud Storage.

JSON representation
{
  "bucket": string,
  "object": string,
  "generation": string
}
Fields
bucket

string

Google Cloud Storage bucket containing source (see Bucket Name Requirements).

object

string

Google Cloud Storage object containing source.

generation

string (int64 format)

Google Cloud Storage generation for the object.

RepoSource

RepoSource describes the location of the source in a Google Cloud Source Repository.

JSON representation
{
  "projectId": string,
  "repoName": string,

  // Union field revision can be only one of the following:
  "branchName": string,
  "tagName": string,
  "commitSha": string
  // End of list of possible types for union field revision.
}
Fields
projectId

string

ID of the project that owns the repo.

repoName

string

Name of the repo.

Union field revision. A revision within the source repository must be specified in one of these ways. revision can be only one of the following:
branchName

string

Name of the branch to build.

tagName

string

Name of the tag to build.

commitSha

string

Explicit commit SHA to build.

SourceContext

A SourceContext is a reference to a tree of files. A SourceContext together with a path point to a unique revision of a single file or directory.

JSON representation
{
  "labels": {
    string: string,
    ...
  },

  // Union field context can be only one of the following:
  "cloudRepo": {
    object (CloudRepoSourceContext)
  },
  "gerrit": {
    object (GerritSourceContext)
  },
  "git": {
    object (GitSourceContext)
  }
  // End of list of possible types for union field context.
}
Fields
labels

map (key: string, value: string)

Labels with user defined metadata.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

Union field context. A SourceContext can refer any one of the following types of repositories. context can be only one of the following:
cloudRepo

object (CloudRepoSourceContext)

A SourceContext referring to a revision in a Google Cloud Source Repo.

gerrit

object (GerritSourceContext)

A SourceContext referring to a Gerrit project.

git

object (GitSourceContext)

A SourceContext referring to any third party Git repo (e.g., GitHub).

CloudRepoSourceContext

A CloudRepoSourceContext denotes a particular revision in a Google Cloud Source Repo.

JSON representation
{
  "repoId": {
    object (RepoId)
  },

  // Union field revision can be only one of the following:
  "revisionId": string,
  "aliasContext": {
    object (AliasContext)
  }
  // End of list of possible types for union field revision.
}
Fields
repoId

object (RepoId)

The ID of the repo.

Union field revision. A revision in a Cloud Repo can be identified by either its revision ID or its alias. revision can be only one of the following:
revisionId

string

A revision ID.

aliasContext

object (AliasContext)

An alias, which may be a branch or tag.

RepoId

A unique identifier for a Cloud Repo.

JSON representation
{

  // Union field id can be only one of the following:
  "projectRepoId": {
    object (ProjectRepoId)
  },
  "uid": string
  // End of list of possible types for union field id.
}
Fields
Union field id. A cloud repo can be identified by either its project ID and repository name combination, or its globally unique identifier. id can be only one of the following:
projectRepoId

object (ProjectRepoId)

A combination of a project ID and a repo name.

uid

string

A server-assigned, globally unique identifier.

ProjectRepoId

Selects a repo using a Google Cloud Platform project ID (e.g., winged-cargo-31) and a repo name within that project.

JSON representation
{
  "projectId": string,
  "repoName": string
}
Fields
projectId

string

The ID of the project.

repoName

string

The name of the repo. Leave empty for the default repo.

AliasContext

An alias to a repo revision.

JSON representation
{
  "kind": enum (Kind),
  "name": string
}
Fields
kind

enum (Kind)

The alias kind.

name

string

The alias name.

Kind

The type of an alias.

Enums
KIND_UNSPECIFIED Unknown.
FIXED Git tag.
MOVABLE Git branch.
OTHER Used to specify non-standard aliases. For example, if a Git repo has a ref named "refs/foo/bar".

GerritSourceContext

A SourceContext referring to a Gerrit project.

JSON representation
{
  "hostUri": string,
  "gerritProject": string,

  // Union field revision can be only one of the following:
  "revisionId": string,
  "aliasContext": {
    object (AliasContext)
  }
  // End of list of possible types for union field revision.
}
Fields
hostUri

string

The URI of a running Gerrit instance.

gerritProject

string

The full project name within the host. Projects may be nested, so "project/subproject" is a valid project name. The "repo name" is the hostURI/project.

Union field revision. A revision in a Gerrit project can be identified by either its revision ID or its alias. revision can be only one of the following:
revisionId

string

A revision (commit) ID.

aliasContext

object (AliasContext)

An alias, which may be a branch or tag.

GitSourceContext

A GitSourceContext denotes a particular revision in a third party Git repository (e.g., GitHub).

JSON representation
{
  "url": string,
  "revisionId": string
}
Fields
url

string

Git repository URL.

revisionId

string

Required. Git commit hash.

Derived

Derived describes the derived image portion (Occurrence) of the DockerImage relationship. This image would be produced from a Dockerfile with FROM <DockerImage.Basis in attached Note>.

JSON representation
{
  "fingerprint": {
    object (Fingerprint)
  },
  "distance": number,
  "layerInfo": [
    {
      object (Layer)
    }
  ],
  "baseResourceUrl": string
}
Fields
fingerprint

object (Fingerprint)

The fingerprint of the derived image.

distance

number (uint32 format)

Output only. The number of layers by which this image differs from the associated image basis.

layerInfo[]

object (Layer)

This contains layer-specific metadata, if populated it has length "distance" and is ordered with [distance] being the layer immediately following the base image and [1] being the final layer.

baseResourceUrl

string

Output only. This contains the base image URL for the derived image occurrence.

Layer

Layer holds metadata specific to a layer of a Docker image.

JSON representation
{
  "directive": enum (Directive),
  "arguments": string
}
Fields
directive

enum (Directive)

The recovered Dockerfile directive used to construct this layer. TODO(b/132434884) Use only directiveString when all directive values are backfilled.

arguments

string

The recovered arguments to the Dockerfile directive.

Directive

Instructions from dockerfile

Enums
DIRECTIVE_UNSPECIFIED Default value for unsupported/missing directive
MAINTAINER https://docs.docker.com/engine/reference/builder/
RUN https://docs.docker.com/engine/reference/builder/
CMD https://docs.docker.com/engine/reference/builder/
LABEL https://docs.docker.com/engine/reference/builder/
EXPOSE https://docs.docker.com/engine/reference/builder/
ENV https://docs.docker.com/engine/reference/builder/
ADD https://docs.docker.com/engine/reference/builder/
COPY https://docs.docker.com/reference/builder/#copy
ENTRYPOINT https://docs.docker.com/engine/reference/builder/
VOLUME https://docs.docker.com/engine/reference/builder/
USER https://docs.docker.com/engine/reference/builder/
WORKDIR https://docs.docker.com/engine/reference/builder/
ARG https://docs.docker.com/engine/reference/builder/
ONBUILD https://docs.docker.com/engine/reference/builder/
STOPSIGNAL https://docs.docker.com/engine/reference/builder/
HEALTHCHECK https://docs.docker.com/engine/reference/builder/
SHELL https://docs.docker.com/engine/reference/builder/

Installation

This represents how a particular software package may be installed on a system.

JSON representation
{
  "name": string,
  "location": [
    {
      object (Location)
    }
  ]
}
Fields
name

string

Output only. The name of the installed package.

location[]

object (Location)

All of the places within the filesystem versions of this package have been found.

Location

An occurrence of a particular package installation found within a system's filesystem. e.g. glibc was found in /var/lib/dpkg/status

JSON representation
{
  "cpeUri": string,
  "version": {
    object (Version)
  },
  "path": string
}
Fields
cpeUri

string

The cpeUri in cpe format denoting the package manager version distributing a package.

version

object (Version)

The version installed at this location.

path

string

The path from which we gathered that this package/version is installed.

Deployment

The period during which some deployable was active in a runtime.

JSON representation
{
  "userEmail": string,
  "deployTime": string,
  "undeployTime": string,
  "config": string,
  "address": string,
  "resourceUri": [
    string
  ],
  "platform": enum (Platform)
}
Fields
userEmail

string

Identity of the user that triggered this deployment.

deployTime

string (Timestamp format)

Beginning of the lifetime of this deployment.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

undeployTime

string (Timestamp format)

End of the lifetime of this deployment.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

config

string

Configuration used to create this deployment.

address

string

Address of the runtime element hosting this deployment.

resourceUri[]

string

Output only. Resource URI for the artifact being deployed taken from the deployable field with the same name.

platform

enum (Platform)

Platform hosting this deployment.

Platform

Types of platforms.

Enums
PLATFORM_UNSPECIFIED Unknown
GKE Google Container Engine
FLEX Google App Engine: Flexible Environment
CUSTOM Custom user-defined platform

Discovered

Provides information about the scan status of a discovered resource.

JSON representation
{
  "operation": {
    object (Operation)
  },
  "continuousAnalysis": enum (ContinuousAnalysis),
  "analysisStatus": enum (AnalysisStatus),
  "analysisStatusError": {
    object (Status)
  }
}
Fields
operation

object (Operation)

Output only. An operation that indicates the status of the current scan. This field is deprecated, do not use.

continuousAnalysis

enum (ContinuousAnalysis)

Whether the resource is continuously analyzed.

analysisStatus

enum (AnalysisStatus)

The status of discovery for the resource.

analysisStatusError

object (Status)

When an error is encountered this will contain a LocalizedMessage under details to show to the user. The LocalizedMessage output only and populated by the API.

ContinuousAnalysis

Whether the resource is actively analyzed.

Enums
CONTINUOUS_ANALYSIS_UNSPECIFIED Unknown
ACTIVE The resource is continuously analyzed.
INACTIVE The resource is ignored for continuous analysis.

AnalysisStatus

Analysis status for a resource.

Enums
ANALYSIS_STATUS_UNSPECIFIED Unknown
PENDING Resource is known but no action has been taken yet.
SCANNING Resource is being analyzed.
FINISHED_SUCCESS Analysis has finished successfully.
FINISHED_FAILED Analysis has finished unsuccessfully, the analysis itself is in a bad state.
FINISHED_UNSUPPORTED The resource is known not to be supported.

Attestation

Occurrence that represents a single "attestation". The authenticity of an Attestation can be verified using the attached signature. If the verifier trusts the public key of the signer, then verifying the signature is sufficient to establish trust. In this circumstance, the AttestationAuthority to which this Attestation is attached is primarily useful for look-up (how to find this Attestation if you already know the Authority and artifact to be verified) and intent (which authority was this attestation intended to sign for).

JSON representation
{
  "pgpSignedAttestation": {
    object (PgpSignedAttestation)
  }
}
Fields
pgpSignedAttestation

object (PgpSignedAttestation)

PgpSignedAttestation

An attestation wrapper with a PGP-compatible signature. This message only supports ATTACHED signatures, where the payload that is signed is included alongside the signature itself in the same file.

JSON representation
{
  "signature": string,
  "contentType": enum (ContentType),
  "pgpKeyId": string
}
Fields
signature

string

The raw content of the signature, as output by GNU Privacy Guard (GPG) or equivalent. Since this message only supports attached signatures, the payload that was signed must be attached. While the signature format supported is dependent on the verification implementation, currently only ASCII-armored (--armor to gpg), non-clearsigned (--sign rather than --clearsign to gpg) are supported. Concretely, gpg --sign --armor --output=signature.gpg payload.json will create the signature content expected in this field in signature.gpg for the payload.json attestation payload.

contentType

enum (ContentType)

Type (for example schema) of the attestation payload that was signed. The verifier must ensure that the provided type is one that the verifier supports, and that the attestation payload is a valid instantiation of that type (for example by validating a JSON schema).

pgpKeyId

string

The cryptographic fingerprint of the key used to generate the signature, as output by, e.g. gpg --list-keys. This should be the version 4, full 160-bit fingerprint, expressed as a 40 character hexadecimal string. See https://tools.ietf.org/html/rfc4880#section-12.2 for details. Implementations may choose to acknowledge "LONG", "SHORT", or other abbreviated key IDs, but only the full fingerprint is guaranteed to work. In gpg, the full fingerprint can be retrieved from the fpr field returned when calling --list-keys with --with-colons. For example:

gpg --with-colons --with-fingerprint --force-v4-certs \
    --list-keys attester@example.com
tru::1:1513631572:0:3:1:5
pub:...<SNIP>...
fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:

Above, the fingerprint is 24FF6481B76AC91E66A00AC657A93A81EF3AE6FB.

ContentType

Type (for example schema) of the attestation payload that was signed.

Enums
CONTENT_TYPE_UNSPECIFIED ContentType is not set.
SIMPLE_SIGNING_JSON Atomic format attestation signature. See https://github.com/containers/image/blob/8a5d2f82a6e3263290c8e0276c3e0f64e77723e7/docs/atomic-signature.md The payload extracted from signature is a JSON blob conforming to the linked schema.

Methods

create

Creates a new Occurrence.

delete

Deletes the given Occurrence from the system.

get

Returns the requested Occurrence.

getIamPolicy

Gets the access control policy for a note or an Occurrence resource.

getNotes

Gets the Note attached to the given Occurrence.

getVulnerabilitySummary

Gets a summary of the number and severity of occurrences.

list

Lists active Occurrences for a given project matching the filters.

patch

Updates an existing occurrence.

setIamPolicy

Sets the access control policy on the specified Note or Occurrence.

testIamPermissions

Returns the permissions that a caller has on the specified note or occurrence resource.
Esta página foi útil? Conte sua opinião sobre:

Enviar comentários sobre…