REST Resource: projects.occurrences

Resource: Occurrence

An instance of an analysis type that has been found on a resource.

JSON representation
{
  "name": string,
  "resourceUri": string,
  "noteName": string,
  "kind": enum (NoteKind),
  "remediation": string,
  "createTime": string,
  "updateTime": string,

  // Union field details can be only one of the following:
  "vulnerability": {
    object (VulnerabilityOccurrence)
  },
  "build": {
    object (BuildOccurrence)
  },
  "image": {
    object (ImageOccurrence)
  },
  "package": {
    object (PackageOccurrence)
  },
  "deployment": {
    object (DeploymentOccurrence)
  },
  "discovery": {
    object (DiscoveryOccurrence)
  },
  "attestation": {
    object (AttestationOccurrence)
  },
  "upgrade": {
    object (UpgradeOccurrence)
  }
  // End of list of possible types for union field details.
}
Fields
name

string

Output only. The name of the occurrence in the form of projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID].

resourceUri

string

Required. Immutable. A URI that represents the resource for which the occurrence applies. For example, https://gcr.io/project/image@sha256:123abc for a Docker image.

noteName

string

Required. Immutable. The analysis note associated with this occurrence, in the form of projects/[PROVIDER_ID]/notes/[NOTE_ID]. This field can be used as a filter in list requests.

kind

enum (NoteKind)

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. Required. Immutable. Describes the details of the note kind found on this resource. details can be only one of the following:
vulnerability

object (VulnerabilityOccurrence)

Describes a security vulnerability.

build

object (BuildOccurrence)

Describes a verifiable build.

image

object (ImageOccurrence)

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

package

object (PackageOccurrence)

Describes the installation of a package on the linked resource.

deployment

object (DeploymentOccurrence)

Describes the deployment of an artifact on a runtime.

discovery

object (DiscoveryOccurrence)

Describes when a resource was discovered.

attestation

object (AttestationOccurrence)

Describes an attestation of an artifact.

upgrade

object (UpgradeOccurrence)

Describes an available package upgrade on the linked resource.

VulnerabilityOccurrence

An occurrence of a severity vulnerability on a resource.

JSON representation
{
  "type": string,
  "severity": enum (Severity),
  "cvssScore": number,
  "packageIssue": [
    {
      object (PackageIssue)
    }
  ],
  "shortDescription": string,
  "longDescription": string,
  "relatedUrls": [
    {
      object (RelatedUrl)
    }
  ],
  "effectiveSeverity": enum (Severity),
  "fixAvailable": boolean
}
Fields
type

string

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

severity

enum (Severity)

Output only. The note provider assigned severity of this 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)

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

shortDescription

string

Output only. A one sentence description of this vulnerability.

longDescription

string

Output only. A detailed description of this vulnerability.

relatedUrls[]

object (RelatedUrl)

Output only. URLs related to this vulnerability.

effectiveSeverity

enum (Severity)

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

fixAvailable

boolean

Output only. Whether at least one of the affected packages has a fix available.

PackageIssue

A detail for a distro and package this vulnerability occurrence was found in and its associated fix (if one is available).

JSON representation
{
  "affectedCpeUri": string,
  "affectedPackage": string,
  "affectedVersion": {
    object (Version)
  },
  "fixedCpeUri": string,
  "fixedPackage": string,
  "fixedVersion": {
    object (Version)
  },
  "fixAvailable": boolean
}
Fields
affectedCpeUri

string

Required. The CPE URI this vulnerability was found in.

affectedPackage

string

Required. The package this vulnerability was found in.

affectedVersion

object (Version)

Required. The version of the package that is installed on the resource affected by this vulnerability.

fixedCpeUri

string

The CPE URI this vulnerability was fixed in. It is possible for this to be different from the affectedCpeUri.

fixedPackage

string

The package this vulnerability was fixed in. It is possible for this to be different from the affectedPackage.

fixedVersion

object (Version)

Required. The version of the package this vulnerability was fixed in. Setting this to VersionKind.MAXIMUM means no fix is yet available.

fixAvailable

boolean

Output only. Whether a fix is available for this package.

BuildOccurrence

Details of a build occurrence.

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

object (BuildProvenance)

Required. The actual provenance for the build.

provenanceBytes

string

Serialized JSON representation of the provenance, used in generating the build signature in the corresponding build note. 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,
  "endTime": string,
  "creator": string,
  "logsUri": string,
  "sourceProvenance": {
    object (Source)
  },
  "triggerId": string,
  "buildOptions": {
    string: string,
    ...
  },
  "builderVersion": string
}
Fields
id

string

Required. 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".

endTime

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.

logsUri

string

URI where any logs for this provenance 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

Required. 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
{
  "checksum": string,
  "id": string,
  "names": [
    string
  ]
}
Fields
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
{
  "artifactStorageSourceUri": string,
  "fileHashes": {
    string: {
      object(FileHashes)
    },
    ...
  },
  "context": {
    object (SourceContext)
  },
  "additionalContexts": [
    {
      object (SourceContext)
    }
  ]
}
Fields
artifactStorageSourceUri

string

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.

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

Git commit hash.

ImageOccurrence

Details of the derived image portion 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)

Required. The fingerprint of the derived image.

distance

number

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": string,
  "arguments": string
}
Fields
directive

string

Required. The recovered Dockerfile directive used to construct this layer. See https://docs.docker.com/engine/reference/builder/ for more information.

arguments

string

The recovered arguments to the Dockerfile directive.

PackageOccurrence

Details on how a particular software package was 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)

Required. 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

Required. The CPE URI 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.

DeploymentOccurrence

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)

Required. 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.

DiscoveryOccurrence

Provides information about the analysis status of a discovered resource.

JSON representation
{
  "continuousAnalysis": enum (ContinuousAnalysis),
  "analysisStatus": enum (AnalysisStatus),
  "analysisStatusError": {
    object (Status)
  }
}
Fields
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 is output only and populated by the API.

ContinuousAnalysis

Whether the resource is continuously 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. Currently for initial analysis only (not updated in continuous analysis).

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

AttestationOccurrence

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 authority to which this attestation is attached is primarily useful for lookup (how to find this attestation if you already know the authority and artifact to be verified) and intent (for which authority this attestation was intended to sign.

JSON representation
{
  "serializedPayload": string,
  "signatures": [
    {
      object (Signature)
    }
  ]
}
Fields
serializedPayload

string (bytes format)

Required. The serialized payload that is verified by one or more signatures.

A base64-encoded string.

signatures[]

object (Signature)

One or more signatures over serializedPayload. Verifier implementations should consider this attestation message verified if at least one signature verifies serializedPayload. See Signature in common.proto for more details on signature structure and verification.

Signature

Verifiers (e.g. Kritis implementations) MUST verify signatures with respect to the trust anchors defined in policy (e.g. a Kritis policy). Typically this means that the verifier has been configured with a map from publicKeyId to public key material (and any required parameters, e.g. signing algorithm).

In particular, verification implementations MUST NOT treat the signature publicKeyId as anything more than a key lookup hint. The publicKeyId DOES NOT validate or authenticate a public key; it only provides a mechanism for quickly selecting a public key ALREADY CONFIGURED on the verifier through a trusted channel. Verification implementations MUST reject signatures in any of the following circumstances: * The publicKeyId is not recognized by the verifier. * The public key that publicKeyId refers to does not verify the signature with respect to the payload.

The signature contents SHOULD NOT be "attached" (where the payload is included with the serialized signature bytes). Verifiers MUST ignore any "attached" payload and only verify signatures with respect to explicitly provided payload (e.g. a payload field on the proto message that holds this Signature, or the canonical serialization of the proto message that holds this signature).

JSON representation
{
  "signature": string,
  "publicKeyId": string
}
Fields
signature

string (bytes format)

The content of the signature, an opaque bytestring. The payload that this signature verifies MUST be unambiguously provided with the Signature during verification. A wrapper message might provide the payload explicitly. Alternatively, a message might have a canonical serialization that can always be unambiguously computed to derive the payload.

A base64-encoded string.

publicKeyId

string

The identifier for the public key that verifies this signature. * The publicKeyId is required. * The publicKeyId MUST be an RFC3986 conformant URI. * When possible, the publicKeyId SHOULD be an immutable reference, such as a cryptographic digest.

Examples of valid publicKeyIds:

OpenPGP V4 public key fingerprint: * "openpgp4fpr:74FAF3B861BDA0870C7B6DEF607E48D2A663AEEA" See https://www.iana.org/assignments/uri-schemes/prov/openpgp4fpr for more details on this scheme.

RFC6920 digest-named SubjectPublicKeyInfo (digest of the DER serialization): * "ni:///sha-256;cD9o9Cq6LG3jD0iKXqEi_vdjJGecm_iXkbqVoScViaU" * "nih:///sha-256;703f68f42aba2c6de30f488a5ea122fef76324679c9bf89791ba95a1271589a5"

UpgradeOccurrence

A Upgrade Occurrence represents that a specific resourceUrl could install a specific upgrade. This presence is supplied via local sources (i.e. it is present in the mirror and the running system has noticed its availability).

JSON representation
{
  "package": string,
  "parsedVersion": {
    object (Version)
  },
  "distribution": {
    object (UpgradeDistribution)
  }
}
Fields
package

string

Required - The package this Upgrade is for.

parsedVersion

object (Version)

Required - The version of the package in a machine + human readable form.

distribution

object (UpgradeDistribution)

Metadata about the upgrade for avaiable for the specific operating system for the resourceUrl. This allows efficient filtering, as well as making it easier to use the occurrence.

Methods

batchCreate

Creates new occurrences in batch.

create

Creates a new occurrence.

delete

Deletes the specified occurrence.

get

Gets the specified occurrence.

getIamPolicy

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

getNotes

Gets the note attached to the specified occurrence.

list

Lists occurrences for the specified project.

patch

Updates the specified 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.
Esta página foi útil? Conte sua opinião sobre:

Enviar comentários sobre…

Container Registry Documentation