Skip to main content

occurrences

Creates, updates, deletes, gets or lists a occurrences resource.

Overview

Nameoccurrences
TypeResource
Idgoogle.containeranalysis.occurrences

Fields

NameDatatypeDescription
namestringOutput only. The name of the occurrence in the form of projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID].
attestationobjectOccurrence 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.
buildobjectDetails of a build occurrence.
complianceobjectAn indication that the compliance checks in the associated ComplianceNote were not satisfied for particular resources or a specified reason.
createTimestringOutput only. The time this occurrence was created.
deploymentobjectThe period during which some deployable was active in a runtime.
discoveryobjectProvides information about the analysis status of a discovered resource.
dsseAttestationobjectDeprecated. Prefer to use a regular Occurrence, and populate the Envelope at the top level of the Occurrence.
envelopeobjectMUST match https://github.com/secure-systems-lab/dsse/blob/master/envelope.proto. An authenticated message of arbitrary type.
imageobjectDetails of the derived image portion of the DockerImage relationship. This image would be produced from a Dockerfile with FROM .
kindstringOutput only. This explicitly denotes which of the occurrence details are specified. This field can be used as a filter in list requests.
noteNamestringRequired. 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.
packageobjectDetails on how a particular software package was installed on a system.
remediationstringA description of actions that can be taken to remedy the note.
resourceUristringRequired. 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.
sbomReferenceobjectThe occurrence representing an SBOM reference as applied to a specific resource. The occurrence follows the DSSE specification. See https://github.com/secure-systems-lab/dsse/blob/master/envelope.md for more details.
updateTimestringOutput only. The time this occurrence was last updated.
upgradeobjectAn Upgrade Occurrence represents that a specific resource_url 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). For Windows, both distribution and windows_update contain information for the Windows update.
vulnerabilityobjectAn occurrence of a severity vulnerability on a resource.

Methods

NameAccessible byRequired ParamsDescription
projects_locations_notes_occurrences_listSELECTlocationsId, notesId, projectsIdLists occurrences referencing the specified note. Provider projects can use this method to get all occurrences across consumer projects referencing the specified note.
projects_locations_occurrences_getSELECTlocationsId, occurrencesId, projectsIdGets the specified occurrence.
projects_locations_occurrences_listSELECTlocationsId, projectsIdLists occurrences for the specified project.
projects_notes_occurrences_listSELECTnotesId, projectsIdLists occurrences referencing the specified note. Provider projects can use this method to get all occurrences across consumer projects referencing the specified note.
projects_occurrences_getSELECToccurrencesId, projectsIdGets the specified occurrence.
projects_occurrences_listSELECTprojectsIdLists occurrences for the specified project.
projects_locations_occurrences_batch_createINSERTlocationsId, projectsIdCreates new occurrences in batch.
projects_locations_occurrences_createINSERTlocationsId, projectsIdCreates a new occurrence.
projects_occurrences_batch_createINSERTprojectsIdCreates new occurrences in batch.
projects_occurrences_createINSERTprojectsIdCreates a new occurrence.
projects_locations_occurrences_deleteDELETElocationsId, occurrencesId, projectsIdDeletes the specified occurrence. For example, use this method to delete an occurrence when the occurrence is no longer applicable for the given resource.
projects_occurrences_deleteDELETEoccurrencesId, projectsIdDeletes the specified occurrence. For example, use this method to delete an occurrence when the occurrence is no longer applicable for the given resource.
projects_locations_occurrences_patchUPDATElocationsId, occurrencesId, projectsIdUpdates the specified occurrence.
projects_occurrences_patchUPDATEoccurrencesId, projectsIdUpdates the specified occurrence.

SELECT examples

Lists occurrences for the specified project.

SELECT
name,
attestation,
build,
compliance,
createTime,
deployment,
discovery,
dsseAttestation,
envelope,
image,
kind,
noteName,
package,
remediation,
resourceUri,
sbomReference,
updateTime,
upgrade,
vulnerability
FROM google.containeranalysis.occurrences
WHERE projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new occurrences resource.

/*+ create */
INSERT INTO google.containeranalysis.occurrences (
projectsId,
occurrences
)
SELECT
'{{ projectsId }}',
'{{ occurrences }}'
;

UPDATE example

Updates a occurrences resource.

/*+ update */
UPDATE google.containeranalysis.occurrences
SET
noteName = '{{ noteName }}',
sbomReference = '{{ sbomReference }}',
discovery = '{{ discovery }}',
attestation = '{{ attestation }}',
dsseAttestation = '{{ dsseAttestation }}',
vulnerability = '{{ vulnerability }}',
image = '{{ image }}',
envelope = '{{ envelope }}',
name = '{{ name }}',
compliance = '{{ compliance }}',
upgrade = '{{ upgrade }}',
package = '{{ package }}',
deployment = '{{ deployment }}',
build = '{{ build }}',
resourceUri = '{{ resourceUri }}',
remediation = '{{ remediation }}'
WHERE
occurrencesId = '{{ occurrencesId }}'
AND projectsId = '{{ projectsId }}';

DELETE example

Deletes the specified occurrences resource.

/*+ delete */
DELETE FROM google.containeranalysis.occurrences
WHERE occurrencesId = '{{ occurrencesId }}'
AND projectsId = '{{ projectsId }}';