gcloud beta scc findings list - list an organization or source's findings
gcloud beta scc findings list [PARENT] [--compare-duration=COMPARE_DURATION] [--field-mask=FIELD_MASK] [--order-by=ORDER_BY] [--page-token=PAGE_TOKEN] [--read-time=READ_TIME] [--source=SOURCE; default="-"] [--filter=EXPRESSION] [--limit=LIMIT] [--page-size=PAGE_SIZE] [--sort-by=[FIELD,...]] [GCLOUD_WIDE_FLAG ...]
(BETA) List an organization or source's findings. To list across all sources provide a '-' as the source id.
List all ACTIVE findings under organization 123456 across all sources:
$ gcloud beta scc findings list 123456 --filter="state=\"ACTIVE\""
List all ACTIVE findings under project abc across all sources:
$ gcloud beta scc findings list projects/abc \ --filter="state=\"ACTIVE\""
List all ACTIVE findings under folder 456 across all sources:
$ gcloud beta scc findings list folders/456 \ --filter="state=\"ACTIVE\""
List all ACTIVE findings under organization 123456 and source 5678:
$ gcloud beta scc findings list 123456 --source=5678 \ --filter="state=\"ACTIVE\""
Only list category and resource_name of all ACTIVE findings under organization 123456 and source 5678:
$ gcloud beta scc findings list 123456 --source=5678 \ --filter="state=\"ACTIVE\"" \ --field-mask="finding.category,finding.resource_name"
List all ACTIVE findings of XSS category/type, under organization 123456 and source 5678:
$ gcloud beta scc findings list 123456 --source=5678 \ --filter="state=\"ACTIVE\" AND category=\"XSS\""
List all findings attached to a particular resource under organization 123456:
$ gcloud beta scc findings list 123456 \ --filter="resource_name=\"//container.googleapis.com/projects/\ pid/zones/zone-id/clusters/cluster-id\""
List all ACTIVE findings that took place on 2019-01-01T01:00:00 GMT time, under organization 123456:
$ gcloud beta scc findings list 123456 --filter="state=\"ACTIVE\" \ AND event_time > 1546304400000"
List all findings that were ACTIVE as of 2019-01-01T01:00:00 GMT time, under organization 123456:
$ gcloud beta scc findings list 123456 \ --filter="state=\"ACTIVE\"" --read-time="2019-01-01T01:00:00Z"
- Parent resource - parent organization, folder, or project in the Google Cloud
resource hierarchy to be used for the gcloud scc command. Specify the argument as either [RESOURCE_TYPE/RESOURCE_ID] or [RESOURCE_ID], as shown in the preceding examples. This represents a Cloud resource.
- [PARENT]
ID of the parent or fully qualified identifier for the parent. To set the parent attribute:
provide the argument parent on the command line;
Set the parent property in configuration using gcloud config set scc/parent if it is not specified in command line.
- --compare-duration=COMPARE_DURATION
ListFindingsResult's "state_change" attribute is updated to indicate whether the finding had its state changed, the finding's state remained unchanged, or if the finding was added in any state during the compare_duration period of time that precedes the read_time. This is the time between (read_time - compare_duration) and read_time. The state_change value is derived based on the presence and state of the finding at the two points in time. Intermediate state changes between the two times don't affect the result. For example, the results aren't affected if the finding is made inactive and then active again. Possible "state_change" values when compare_duration is specified: "CHANGED" indicates that the finding was present at the start of compare_duration, but changed its state at read_time. "UNCHANGED" indicates that the finding was present at the start of compare_duration and did not change state at read_time. "ADDED" indicates that the finding was not present at the start of compare_duration, but was present at read_time. If compare_duration is not specified, then the only possible state_change is "UNUSED", which will be the state_change set for all findings present at read_time. Example duration: "100000s"
- --field-mask=FIELD_MASK
Field mask to specify the finding fields listed in the response. An empty field mask will list all fields. For example: --field-mask="finding.category,finding.resource_name" will only output category and resource_name for the findings in addition to default attributes. Notice the difference between hyphens (-) used with flags v/s camel case used in field masks. An empty or missing field mask will list all fields.
- --order-by=ORDER_BY
Expression that defines what fields and order to use for sorting. String value should follow SQL syntax: comma separated list of fields. For example: "name,resource_properties.a_property". The default sorting order is ascending. To specify descending order for a field, a suffix " desc" should be appended to the field name. For example: --order-by="name desc,source_properties.a_property" will order by name in descending order while source_properties.a_property in ascending order.
- --page-token=PAGE_TOKEN
Response objects will return a non-null value for page-token to indicate that there is at least one additional page of data. User can either directly request that page by specifying the page-token explicitly or let gcloud fetch one-page-at-a-time.
- --read-time=READ_TIME
Time used as a reference point when filtering. Absence of this field will default to the API's version of NOW. For example --read-time "2019-02-28T07:00:00Z"
- --source=SOURCE; default="-"
Source id. Defaults to all sources.
- --filter=EXPRESSION
Apply a Boolean filter EXPRESSION to each resource item to be listed. If the expression evaluates True, 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: --flatten, --sort-by, --filter, --limit.
- --limit=LIMIT
Maximum number of resources to list. The default is unlimited. This flag interacts with other flags that are applied in this order: --flatten, --sort-by, --filter, --limit.
- --page-size=PAGE_SIZE
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 unlimited (no paging). Paging may be applied before or after --filter and --limit depending on the service.
- --sort-by=[FIELD,...]
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: --flatten, --sort-by, --filter, --limit.
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 $ gcloud help for details.
This command uses the securitycenter/v1 API. The full documentation for this API can be found at: https://cloud.google.com/security-command-center
This command is currently in beta and might change without notice. These variants are also available:
$ gcloud scc findings list
$ gcloud alpha scc findings list