File: //snap/google-cloud-cli/current/help/man/man1/gcloud_scc_assets_list.1
.TH "GCLOUD_SCC_ASSETS_LIST" 1
.SH "NAME"
.HP
gcloud scc assets list \- list Cloud Security Command Center assets
.SH "SYNOPSIS"
.HP
\f5gcloud scc assets list\fR [\fIPARENT\fR] [\fB\-\-compare\-duration\fR=\fICOMPARE_DURATION\fR] [\fB\-\-field\-mask\fR=\fIFIELD_MASK\fR] [\fB\-\-order\-by\fR=\fIORDER_BY\fR] [\fB\-\-page\-token\fR=\fIPAGE_TOKEN\fR] [\fB\-\-read\-time\fR=\fIREAD_TIME\fR] [\fB\-\-filter\fR=\fIEXPRESSION\fR] [\fB\-\-limit\fR=\fILIMIT\fR] [\fB\-\-page\-size\fR=\fIPAGE_SIZE\fR] [\fB\-\-sort\-by\fR=[\fIFIELD\fR,...]] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
\fB(DEPRECATED)\fR Security Command Center Asset APIs are deprecated and will be
removed on or after June 26, 2024. Use Cloud Asset Inventory instead (gcloud
asset) (https://cloud.google.com/sdk/gcloud/reference/asset). For more
information, see the deprecation notice at Assets Page
(https://cloud.google.com/security\-command\-center/docs/how\-to\-use\-security\-command\-center#assets_page).
List Cloud Security Command Center assets.
.SH "EXAMPLES"
List all assets under organization (123456)
.RS 2m
$ gcloud scc assets list 123456
.RE
List all assets under project (example\-project)
.RS 2m
$ gcloud scc assets list projects/example\-project
.RE
List all assets under folder (456)
.RS 2m
$ gcloud scc assets list folders/456
.RE
List all assets under organization (123456) that were present as of
2019\-01\-01T01:00:00 GMT time.
.RS 2m
$ gcloud scc assets list 123456 \-\-read\-time="2019\-01\-01T01:00:00Z"
.RE
Only list category and resource_name for all assets under organization (123456):
.RS 2m
$ gcloud scc assets list 123456 \-\-field\-mask="category,resource_name"
.RE
List all compute instances under organization (123456):
.RS 2m
$ gcloud scc assets list 123456 \e
\-\-filter="security_center_properties.resource_type=\e"google.comp\e
ute.Instance\e""
.RE
List all firewall rules that have open HTTP Ports:
.RS 2m
$ gcloud scc assets list 123456 \e
\-\-filter="security_center_properties.resource_type = \e
\e"google.compute.Firewall\e" AND resource_properties.name \e
=\e"default\-allow\-http\e""
.RE
List all assets that belong to either projects: 5678 OR 78910 (project's numeric
identifier).
.RS 2m
$ gcloud scc assets list 123456 \e
\-\-filter="security_center_properties.resource_parent = \e
\e"//cloudresourcemanager.googleapis.com/projects/5678\e" OR \e
security_center_properties.resource_parent = "\e78910\e""
.RE
List all projects that are owned by a user:someone@domain.com. Notice the usage
of : which enforces partial matching.
.RS 2m
$ gcloud scc assets list 123456 \e
\-\-filter="security_center_properties.resource_type = \e
\e"google.cloud.resourcemanager.Project\e" AND \e
security_center_properties.resource_owners : \e
\e"user:someone@domain.com\e""
.RE
List assets and add a state_change property that indicates if the asset was
added, removed, or remained present during the past 24 hours period:
.RS 2m
$ gcloud scc assets list 123456 \-\-compare\-duration=86400s
.RE
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
Parent resource \- parent organization, folder, or project in the Google Cloud
resource hierarchy to be used for the \f5gcloud scc\fR command. Specify the
argument as either [RESOURCE_TYPE/RESOURCE_ID] or [RESOURCE_ID], as shown in the
preceding examples. This represents a Cloud resource.
.RS 2m
.TP 2m
[\fIPARENT\fR]
ID of the parent or fully qualified identifier for the parent.
To set the \f5parent\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5parent\fR on the command line;
.IP "\(bu" 2m
Set the parent property in configuration using \f5gcloud config set
scc/parent\fR if it is not specified in command line.
.RE
.sp
.RE
.RE
.sp
.SH "FLAGS"
.RS 2m
.TP 2m
\fB\-\-compare\-duration\fR=\fICOMPARE_DURATION\fR
The result's "state_change" attribute is updated to indicate whether the asset
was added, removed, or remained present during the compare_duration period of
time that precedes the read_time. See \f5$ gcloud topic datetimes\fR for
information on supported duration formats.
.TP 2m
\fB\-\-field\-mask\fR=\fIFIELD_MASK\fR
Field mask to specify the Asset fields to be listed in the response. An empty
field mask will list all fields. Example field mask:
"asset.security_center_properties.resource_type,asset.security_center_properties.resource_parent"
.TP 2m
\fB\-\-order\-by\fR=\fIORDER_BY\fR
Expression that defines what fields and order to use for sorting. Example order
by: "resource_properties.sort_prop ASC"
.TP 2m
\fB\-\-page\-token\fR=\fIPAGE_TOKEN\fR
The value returned by the last 'ListAssetsResponse'; indicates that this is a
continuation of a prior 'ListAssets' call, and that the system should return the
next page of data.
.TP 2m
\fB\-\-read\-time\fR=\fIREAD_TIME\fR
Time used as a reference point when filtering. Absence of this field will
default to the API's version of NOW. See \f5$ gcloud topic datetimes\fR for
information on supported time formats.
.RE
.sp
.SH "LIST COMMAND FLAGS"
.RS 2m
.TP 2m
\fB\-\-filter\fR=\fIEXPRESSION\fR
Apply a Boolean filter \fIEXPRESSION\fR to each resource item to be listed. If
the expression evaluates \f5True\fR, then that item is listed. For more details
and examples of filter expressions, run $ gcloud topic filters. This flag
interacts with other flags that are applied in this order: \fB\-\-flatten\fR,
\fB\-\-sort\-by\fR, \fB\-\-filter\fR, \fB\-\-limit\fR.
.TP 2m
\fB\-\-limit\fR=\fILIMIT\fR
Maximum number of resources to list. The default is \fBunlimited\fR. This flag
interacts with other flags that are applied in this order: \fB\-\-flatten\fR,
\fB\-\-sort\-by\fR, \fB\-\-filter\fR, \fB\-\-limit\fR.
.TP 2m
\fB\-\-page\-size\fR=\fIPAGE_SIZE\fR
Some services group resource list output into pages. This flag specifies the
maximum number of resources per page. The default is determined by the service
if it supports paging, otherwise it is \fBunlimited\fR (no paging). Paging may
be applied before or after \fB\-\-filter\fR and \fB\-\-limit\fR depending on the
service.
.TP 2m
\fB\-\-sort\-by\fR=[\fIFIELD\fR,...]
Comma\-separated list of resource field key names to sort by. The default order
is ascending. Prefix a field with ``~'' for descending order on that field. This
flag interacts with other flags that are applied in this order:
\fB\-\-flatten\fR, \fB\-\-sort\-by\fR, \fB\-\-filter\fR, \fB\-\-limit\fR.
.RE
.sp
.SH "GCLOUD WIDE FLAGS"
These flags are available to all commands: \-\-access\-token\-file, \-\-account,
\-\-billing\-project, \-\-configuration, \-\-flags\-file, \-\-flatten,
\-\-format, \-\-help, \-\-impersonate\-service\-account, \-\-log\-http,
\-\-project, \-\-quiet, \-\-trace\-token, \-\-user\-output\-enabled,
\-\-verbosity.
Run \fB$ gcloud help\fR for details.
.SH "API REFERENCE"
This command uses the \fBsecuritycenter/v1\fR API. The full documentation for
this API can be found at: https://cloud.google.com/security\-command\-center
.SH "NOTES"
These variants are also available:
.RS 2m
$ gcloud alpha scc assets list
.RE
.RS 2m
$ gcloud beta scc assets list
.RE