Creates a new occurrence.
Scopes
You will need authorization for the https://www.googleapis.com/auth/cloud-platform scope to make a valid call.
If unset, the scope for this method defaults to https://www.googleapis.com/auth/cloud-platform.
You can set the scope for this method like this: containeranalysis1-beta1 --scope <scope> projects occurrences-create ...
Required Scalar Argument
- <parent> (string)
- Required. The name of the project in the form of
projects/[PROJECT_ID]
, under which the occurrence is to be created.
- Required. The name of the project in the form of
Required Request Value
The request value is a data-structure with various fields. Each field may be a simple scalar or another data-structure. In the latter case it is advised to set the field-cursor to the data-structure's field to specify values more concisely.
For example, a structure like this:
Occurrence:
attestation:
attestation:
generic-signed-attestation:
content-type: string
serialized-payload: string
pgp-signed-attestation:
content-type: string
pgp-key-id: string
signature: string
build:
in-toto-slsa-provenance-v1:
-type: string
predicate:
build-definition:
build-type: string
run-details:
builder:
id: string
version: { string: string }
metadata:
finished-on: string
invocation-id: string
started-on: string
predicate-type: string
provenance:
build-options: { string: string }
builder-version: string
create-time: string
creator: string
end-time: string
id: string
logs-uri: string
project-id: string
source-provenance:
artifact-storage-source-uri: string
context:
cloud-repo:
alias-context:
kind: string
name: string
repo-id:
project-repo-id:
project-id: string
repo-name: string
uid: string
revision-id: string
gerrit:
alias-context:
kind: string
name: string
gerrit-project: string
host-uri: string
revision-id: string
git:
revision-id: string
url: string
labels: { string: string }
start-time: string
trigger-id: string
provenance-bytes: string
create-time: string
deployment:
deployment:
address: string
config: string
deploy-time: string
platform: string
resource-uri: [string]
undeploy-time: string
user-email: string
derived-image:
derived-image:
base-resource-url: string
distance: integer
fingerprint:
v1-name: string
v2-blob: [string]
v2-name: string
discovered:
discovered:
analysis-completed:
analysis-type: [string]
analysis-status: string
analysis-status-error:
code: integer
message: string
continuous-analysis: string
last-analysis-time: string
last-scan-time: string
sbom-status:
error: string
sbom-state: string
envelope:
payload: string
payload-type: string
installation:
installation:
architecture: string
cpe-uri: string
license:
comments: string
expression: string
name: string
package-type: string
version:
epoch: integer
inclusive: boolean
kind: string
name: string
revision: string
intoto:
signed:
byproducts:
custom-values: { string: string }
command: [string]
environment:
custom-values: { string: string }
kind: string
name: string
note-name: string
remediation: string
resource:
content-hash:
type: string
value: string
name: string
uri: string
sbom:
create-time: string
creator-comment: string
creators: [string]
document-comment: string
external-document-refs: [string]
id: string
license-list-version: string
namespace: string
title: string
sbom-reference:
payload:
-type: string
predicate:
digest: { string: string }
location: string
mime-type: string
referrer-id: string
predicate-type: string
payload-type: string
spdx-file:
attributions: [string]
comment: string
contributors: [string]
copyright: string
files-license-info: [string]
id: string
license-concluded:
comments: string
expression: string
notice: string
spdx-package:
comment: string
filename: string
home-page: string
id: string
license-concluded:
comments: string
expression: string
package-type: string
source-info: string
summary-description: string
title: string
version: string
spdx-relationship:
comment: string
source: string
target: string
type: string
update-time: string
vulnerability:
cvss-score: number
cvss-v2:
attack-complexity: string
attack-vector: string
authentication: string
availability-impact: string
base-score: number
confidentiality-impact: string
exploitability-score: number
impact-score: number
integrity-impact: string
privileges-required: string
scope: string
user-interaction: string
cvss-v3:
attack-complexity: string
attack-vector: string
authentication: string
availability-impact: string
base-score: number
confidentiality-impact: string
exploitability-score: number
impact-score: number
integrity-impact: string
privileges-required: string
scope: string
user-interaction: string
cvss-version: string
effective-severity: string
extra-details: string
long-description: string
severity: string
short-description: string
type: string
vex-assessment:
cve: string
impacts: [string]
justification:
details: string
justification-type: string
note-name: string
state: string
vulnerability-id: string
can be set completely with the following arguments which are assumed to be executed in the given order. Note how the cursor position is adjusted to the respective structures, allowing simple field names to be used most of the time.
-r .attestation.attestation.generic-signed-attestation content-type=duo
- 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).
-
serialized-payload=kasd
- The serialized payload that is verified by one or more
signatures
. The encoding and semantic meaning of this payload must match what is set incontent_type
.
- The serialized payload that is verified by one or more
-
..pgp-signed-attestation content-type=sadipscing
- 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).
pgp-key-id=tempor
- 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 thefpr
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:...... fpr:::::::::24FF6481B76AC91E66A00AC657A93A81EF3AE6FB:
Above, the fingerprint is24FF6481B76AC91E66A00AC657A93A81EF3AE6FB
.
- The cryptographic fingerprint of the key used to generate the signature, as output by, e.g.
-
signature=sea
- Required. 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 insignature.gpg
for thepayload.json
attestation payload.
- Required. 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 (
-
....build.in-toto-slsa-provenance-v1 -type=et
- InToto spec defined at https://github.com/in-toto/attestation/tree/main/spec#statement
-
predicate.build-definition build-type=lorem
- No description provided.
-
..run-details.builder id=magna
- No description provided.
-
version=key=takimata
- No description provided.
- the value will be associated with the given
key
-
..metadata finished-on=rebum.
- No description provided.
invocation-id=at
- No description provided.
-
started-on=invidunt
- No description provided.
-
.... predicate-type=clita
- No description provided.
-
..provenance build-options=key=stet
- Special options applied to this build. This is a catch-all field where build providers can enter any desired additional details.
- the value will be associated with the given
key
builder-version=aliquyam
- Version string of the builder at the time this build was executed.
create-time=ut
- Time at which the build was created.
creator=sit
- 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.
end-time=vero
- Time at which execution of the build was finished.
id=rebum.
- Required. Unique identifier of the build.
logs-uri=dolores
- URI where any logs for this provenance were written.
project-id=consetetur
- ID of the project.
source-provenance artifact-storage-source-uri=dolores
- If provided, the input binary artifacts for the build came from this location.
context.cloud-repo.alias-context kind=sed
- The alias kind.
-
name=invidunt
- The alias name.
-
..repo-id.project-repo-id project-id=clita
- The ID of the project.
-
repo-name=dolor
- The name of the repo. Leave empty for the default repo.
-
.. uid=aliquyam
- A server-assigned, globally unique identifier.
-
.. revision-id=magna
- A revision ID.
-
..gerrit.alias-context kind=diam
- The alias kind.
-
name=nonumy
- The alias name.
-
.. gerrit-project=et
- 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.
host-uri=sanctus
- The URI of a running Gerrit instance.
-
revision-id=accusam
- A revision (commit) ID.
-
..git revision-id=tempor
- Git commit hash.
-
url=sed
- Git repository URL.
-
.. labels=key=est
- Labels with user defined metadata.
- the value will be associated with the given
key
-
... start-time=takimata
- Time at which execution of the build was started.
-
trigger-id=dolor
- Trigger identifier if the build was triggered automatically; empty if not.
-
.. provenance-bytes=diam
- Serialized JSON representation of the provenance, used in generating the build signature in the corresponding build note. After verifying the signature,
provenance_bytes
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.
- Serialized JSON representation of the provenance, used in generating the build signature in the corresponding build note. After verifying the signature,
-
.. create-time=at
- Output only. The time this occurrence was created.
deployment.deployment address=erat
- Address of the runtime element hosting this deployment.
config=justo
- Configuration used to create this deployment.
deploy-time=ipsum
- Required. Beginning of the lifetime of this deployment.
platform=accusam
- Platform hosting this deployment.
resource-uri=dolores
- Output only. Resource URI for the artifact being deployed taken from the deployable field with the same name.
- Each invocation of this argument appends the given value to the array.
undeploy-time=consetetur
- End of the lifetime of this deployment.
-
user-email=no
- Identity of the user that triggered this deployment.
-
...derived-image.derived-image base-resource-url=justo
- Output only. This contains the base image URL for the derived image occurrence.
distance=56
- Output only. The number of layers by which this image differs from the associated image basis.
fingerprint v1-name=diam
- Required. The layer ID of the final layer in the Docker image's v1 representation.
v2-blob=sea
- Required. The ordered list of v2 blobs that represent a given image.
- Each invocation of this argument appends the given value to the array.
-
v2-name=ipsum
- Output only. The name of the image's v2 blobs computed via: [bottom] := v2_blobbottom := sha256(v2_blob[N] + " " + v2_name[N+1]) Only the name of the final blob is kept.
-
....discovered.discovered.analysis-completed analysis-type=stet
- No description provided.
- Each invocation of this argument appends the given value to the array.
-
.. analysis-status=gubergren
- The status of discovery for the resource.
analysis-status-error code=96
- The status code, which should be an enum value of google.rpc.Code.
-
message=no
- A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
-
.. continuous-analysis=sit
- Whether the resource is continuously analyzed.
last-analysis-time=kasd
- The last time continuous analysis was done for this resource. Deprecated, do not use.
last-scan-time=amet
- The last time this resource was scanned.
sbom-status error=lorem
- If there was an error generating an SBOM, this will indicate what that error was.
-
sbom-state=justo
- The progress of the SBOM generation.
-
....envelope payload=invidunt
- No description provided.
-
payload-type=sed
- No description provided.
-
..installation.installation architecture=nonumy
- Output only. The CPU architecture for which packages in this distribution channel were built. Architecture will be blank for language packages.
cpe-uri=sea
- Output only. The cpe_uri in CPE format denoting the package manager version distributing a package. The cpe_uri will be blank for language packages.
license comments=ipsum
- Comments
-
expression=kasd
- Often a single license can be used to represent the licensing terms. Sometimes it is necessary to include a choice of one or more licenses or some combination of license identifiers. Examples: "LGPL-2.1-only OR MIT", "LGPL-2.1-only AND MIT", "GPL-2.0-or-later WITH Bison-exception-2.2".
-
.. name=justo
- Required. Output only. The name of the installed package.
package-type=ea
- Output only. The type of package; whether native or non native (e.g., ruby gems, node.js packages, etc.).
version epoch=24
- Used to correct mistakes in the version numbering scheme.
inclusive=false
- Whether this version is specifying part of an inclusive range. Grafeas does not have the capability to specify version ranges; instead we have fields that specify start version and end versions. At times this is insufficient - we also need to specify whether the version is included in the range or is excluded from the range. This boolean is expected to be set to true when the version is included in a range.
kind=clita
- Required. Distinguishes between sentinel MIN/MAX versions and normal versions.
name=vero
- Required only when version kind is NORMAL. The main part of the version name.
-
revision=invidunt
- The iteration of the package build from the above version.
-
....intoto.signed.byproducts custom-values=key=nonumy
- No description provided.
- the value will be associated with the given
key
-
.. command=erat
- This field contains the full command executed for the step. This can also be empty if links are generated for operations that aren't directly mapped to a specific command. Each term in the command is an independent string in the list. An example of a command in the in-toto metadata field is: "command": ["git", "clone", "https://github.com/in-toto/demo-project.git"]
- Each invocation of this argument appends the given value to the array.
-
environment custom-values=key=erat
- No description provided.
- the value will be associated with the given
key
-
.... kind=dolores
- Output only. This explicitly denotes which of the occurrence details are specified. This field can be used as a filter in list requests.
name=ipsum
- Output only. The name of the occurrence in the form of
projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]
.
- Output only. The name of the occurrence in the form of
note-name=voluptua.
- 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.
- Required. Immutable. The analysis note associated with this occurrence, in the form of
remediation=eos
- A description of actions that can be taken to remedy the note.
resource.content-hash type=duo
- Required. The type of hash that was performed.
-
value=elitr
- Required. The hash value.
-
.. name=consetetur
- Deprecated, do not use. Use uri instead. The name of the resource. For example, the name of a Docker image - "Debian".
-
uri=et
- Required. The unique URI of the resource. For example,
https://gcr.io/project/image@sha256:foo
for a Docker image.
- Required. The unique URI of the resource. For example,
-
..sbom create-time=clita
- Identify when the SPDX file was originally created. The date is to be specified according to combined date and time in UTC format as specified in ISO 8601 standard
creator-comment=sit
- A field for creators of the SPDX file to provide general comments about the creation of the SPDX file or any other relevant comment not included in the other fields
creators=takimata
- Identify who (or what, in the case of a tool) created the SPDX file. If the SPDX file was created by an individual, indicate the person's name
- Each invocation of this argument appends the given value to the array.
document-comment=erat
- A field for creators of the SPDX file content to provide comments to the consumers of the SPDX document
external-document-refs=diam
- Identify any external SPDX documents referenced within this SPDX document
- Each invocation of this argument appends the given value to the array.
id=nonumy
- Identify the current SPDX document which may be referenced in relationships by other files, packages internally and documents externally
license-list-version=lorem
- A field for creators of the SPDX file to provide the version of the SPDX License List used when the SPDX file was created
namespace=at
- Provide an SPDX document specific namespace as a unique absolute Uniform Resource Identifier (URI) as specified in RFC-3986, with the exception of the ‘#’ delimiter
-
title=diam
- Identify name of this document as designated by creator
-
..sbom-reference.payload -type=diam
- Identifier for the schema of the Statement.
predicate digest=key=sed
- A map of algorithm to digest of the contents of the SBOM.
- the value will be associated with the given
key
location=et
- The location of the SBOM.
mime-type=ea
- The mime type of the SBOM.
-
referrer-id=dolore
- The person or system referring this predicate to the consumer.
-
.. predicate-type=ipsum
- URI identifying the type of the Predicate.
-
.. payload-type=ea
- The kind of payload that SbomReferenceIntotoPayload takes. Since it's in the intoto format, this value is expected to be 'application/vnd.in-toto+json'.
-
..spdx-file attributions=at
- This field provides a place for the SPDX data creator to record, at the file level, acknowledgements that may be needed to be communicated in some contexts
- Each invocation of this argument appends the given value to the array.
comment=sit
- This field provides a place for the SPDX file creator to record any general comments about the file
contributors=sit
- This field provides a place for the SPDX file creator to record file contributors
- Each invocation of this argument appends the given value to the array.
copyright=lorem
- Identify the copyright holder of the file, as well as any dates present
files-license-info=stet
- This field contains the license information actually found in the file, if any
- Each invocation of this argument appends the given value to the array.
id=duo
- Uniquely identify any element in an SPDX document which may be referenced by other elements
license-concluded comments=elitr
- Comments
-
expression=aliquyam
- Often a single license can be used to represent the licensing terms. Sometimes it is necessary to include a choice of one or more licenses or some combination of license identifiers. Examples: "LGPL-2.1-only OR MIT", "LGPL-2.1-only AND MIT", "GPL-2.0-or-later WITH Bison-exception-2.2".
-
.. notice=erat
- This field provides a place for the SPDX file creator to record license notices or other such related notices found in the file
-
..spdx-package comment=ut
- A place for the SPDX file creator to record any general comments about the package being described
filename=et
- Provide the actual file name of the package, or path of the directory being treated as a package
home-page=lorem
- Output only. Provide a place for the SPDX file creator to record a web site that serves as the package's home page
id=rebum.
- Uniquely identify any element in an SPDX document which may be referenced by other elements
license-concluded comments=et
- Comments
-
expression=sed
- Often a single license can be used to represent the licensing terms. Sometimes it is necessary to include a choice of one or more licenses or some combination of license identifiers. Examples: "LGPL-2.1-only OR MIT", "LGPL-2.1-only AND MIT", "GPL-2.0-or-later WITH Bison-exception-2.2".
-
.. package-type=stet
- Output only. The type of package: OS, MAVEN, GO, GO_STDLIB, etc.
source-info=aliquyam
- Provide a place for the SPDX file creator to record any relevant background information or additional comments about the origin of the package
summary-description=kasd
- Output only. A short description of the package
title=lorem
- Output only. Identify the full name of the package as given by the Package Originator
-
version=sit
- Output only. Identify the version of the package
-
..spdx-relationship comment=kasd
- A place for the SPDX file creator to record any general comments about the relationship
source=tempor
- Also referred to as SPDXRef-A The source SPDX element (file, package, etc)
target=dolor
- Also referred to as SPDXRef-B The target SPDC element (file, package, etc) In cases where there are "known unknowns", the use of the keyword NOASSERTION can be used The keywords NONE can be used to indicate that an SPDX element (package/file/snippet) has no other elements connected by some relationship to it
-
type=amet
- Output only. The type of relationship between the source and target SPDX elements
-
.. update-time=sit
- Output only. The time this occurrence was last updated.
vulnerability cvss-score=0.6642185324610259
- 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.
cvss-v2 attack-complexity=ipsum
- Defined in CVSS v3, CVSS v2
attack-vector=ipsum
- Base Metrics Represents the intrinsic characteristics of a vulnerability that are constant over time and across user environments. Defined in CVSS v3, CVSS v2
authentication=et
- Defined in CVSS v2
availability-impact=elitr
- Defined in CVSS v3, CVSS v2
base-score=0.08920170932611438
- The base score is a function of the base metric scores.
confidentiality-impact=sadipscing
- Defined in CVSS v3, CVSS v2
exploitability-score=0.8201834988730824
- No description provided.
impact-score=0.37408685535865127
- No description provided.
integrity-impact=consetetur
- Defined in CVSS v3, CVSS v2
privileges-required=et
- Defined in CVSS v3
scope=sit
- Defined in CVSS v3
-
user-interaction=lorem
- Defined in CVSS v3
-
..cvss-v3 attack-complexity=nonumy
- Defined in CVSS v3, CVSS v2
attack-vector=diam
- Base Metrics Represents the intrinsic characteristics of a vulnerability that are constant over time and across user environments. Defined in CVSS v3, CVSS v2
authentication=ipsum
- Defined in CVSS v2
availability-impact=invidunt
- Defined in CVSS v3, CVSS v2
base-score=0.9674724688728986
- The base score is a function of the base metric scores.
confidentiality-impact=voluptua.
- Defined in CVSS v3, CVSS v2
exploitability-score=0.18951813186317334
- No description provided.
impact-score=0.4250572039863144
- No description provided.
integrity-impact=eirmod
- Defined in CVSS v3, CVSS v2
privileges-required=erat
- Defined in CVSS v3
scope=duo
- Defined in CVSS v3
-
user-interaction=et
- Defined in CVSS v3
-
.. cvss-version=erat
- Output only. CVSS version used to populate cvss_score and severity.
effective-severity=sit
- 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. When there are multiple PackageIssues for this vulnerability, they can have different effective severities because some might be provided by the distro while others are provided by the language ecosystem for a language pack. For this reason, it is advised to use the effective severity on the PackageIssue level. In the case where multiple PackageIssues have differing effective severities, this field should be the highest severity for any of the PackageIssues.
extra-details=accusam
- Occurrence-specific extra details about the vulnerability.
long-description=et
- Output only. A detailed description of this vulnerability.
severity=nonumy
- Output only. The note provider assigned Severity of the vulnerability.
short-description=accusam
- Output only. A one sentence description of this vulnerability.
type=ut
- The type of package; whether native or non native(ruby gems, node.js packages etc)
vex-assessment cve=voluptua.
- Holds the MITRE standard Common Vulnerabilities and Exposures (CVE) tracking number for the vulnerability. Deprecated: Use vulnerability_id instead to denote CVEs.
impacts=consetetur
- Contains information about the impact of this vulnerability, this will change with time.
- Each invocation of this argument appends the given value to the array.
justification details=dolor
- Additional details on why this justification was chosen.
-
justification-type=amet
- The justification type for this vulnerability.
-
.. note-name=et
- The VulnerabilityAssessment note from which this VexAssessment was generated. This will be of the form:
projects/[PROJECT_ID]/notes/[NOTE_ID]
.
- The VulnerabilityAssessment note from which this VexAssessment was generated. This will be of the form:
state=aliquyam
- Provides the state of this Vulnerability assessment.
vulnerability-id=ipsum
- The vulnerability identifier for this Assessment. Will hold one of common identifiers e.g. CVE, GHSA etc.
About Cursors
The cursor position is key to comfortably set complex nested structures. The following rules apply:
- The cursor position is always set relative to the current one, unless the field name starts with the
.
character. Fields can be nested such as in-r f.s.o
. - The cursor position is set relative to the top-level structure if it starts with
.
, e.g.-r .s.s
- You can also set nested fields without setting the cursor explicitly. For example, to set a value relative to the current cursor position, you would specify
-r struct.sub_struct=bar
. - You can move the cursor one level up by using
..
. Each additional.
moves it up one additional level. E.g....
would go three levels up.
Optional Output Flags
The method's return value a JSON encoded structure, which will be written to standard output by default.
- -o out
- out specifies the destination to which to write the server's result to.
It will be a JSON-encoded structure.
The destination may be
-
to indicate standard output, or a filepath that is to contain the received bytes. If unset, it defaults to standard output.
- out specifies the destination to which to write the server's result to.
It will be a JSON-encoded structure.
The destination may be
Optional General Properties
The following properties can configure any call, and are not specific to this method.
-
-p $-xgafv=string
- V1 error format.
-
-p access-token=string
- OAuth access token.
-
-p alt=string
- Data format for response.
-
-p callback=string
- JSONP
-
-p fields=string
- Selector specifying which fields to include in a partial response.
-
-p key=string
- API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
-
-p oauth-token=string
- OAuth 2.0 token for the current user.
-
-p pretty-print=boolean
- Returns response with indentations and line breaks.
-
-p quota-user=string
- Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
-
-p upload-type=string
- Legacy upload protocol for media (e.g. "media", "multipart").
-
-p upload-protocol=string
- Upload protocol for media (e.g. "raw", "multipart").