> [!NOTE]
> Premium and Enterprise (Deprecated) [service tiers](https://docs.cloud.google.com/security-command-center/docs/service-tiers.md.txt)

> [!CAUTION]
> The Security Command Center Enterprise service tier will shut down on May 21, 2027. If your organization uses the Enterprise service tier, then the organization will automatically move to the Premium service tier on or after May 21, 2027. Contact your account representative or a [Google Cloud sales specialist](https://cloud.google.com/contact) if you have questions.

This document describes a threat finding type in Security Command Center. Threat findings are generated by
[threat detectors](https://docs.cloud.google.com/security-command-center/docs/concepts-security-sources.md.txt#threats) when they detect
a potential threat in your cloud resources. For a full list of available threat findings, see [Threat findings index](https://docs.cloud.google.com/security-command-center/docs/threat-findings-index.md.txt).

## Overview

A potentially malicious actor attempted to determine what sensitive objects in
GKE they can query for, by using the [`kubectl
auth can-i get`](https://kubernetes.io/docs/reference/access-authn-authz/authorization/#checking-api-access) command. Specifically,
the actor ran any of the following commands:

- `kubectl auth can-i get '*'`
- `kubectl auth can-i get secrets`
- `kubectl auth can-i get clusterroles/cluster-admin`

[Event Threat Detection](https://docs.cloud.google.com/security-command-center/docs/concepts-event-threat-detection-overview.md.txt) is the source of
this finding.

## How to respond

To respond to this finding, do the following:

### Step 1: Review finding details

1. Open the `Discovery: Can get sensitive Kubernetes object check` finding as directed in [Reviewing findings](https://docs.cloud.google.com/security-command-center/docs/how-to-investigate-threats.md.txt#reviewing_findings).
2. In the finding details, on the **Summary** tab, note the values of
   following fields:

   - Under **What was detected** :
     - **Kubernetes access reviews** : the requested access review information, based on the [`SelfSubjectAccessReview`](https://kubernetes.io/docs/reference/kubernetes-api/authorization-resources/self-subject-access-review-v1/) k8s resource.
     - **Principal email**: the account that made the call.
   - Under **Affected resource** :
     - **Resource display name**: the Kubernetes cluster where the action occurred.
   - Under **Related links** :
     - **Cloud Logging URI**: link to Logging entries.

### Step 2: Check logs

1. On the **Summary tab** of the finding details panel, click the **Cloud Logging URI** link to open the **Logs Explorer**.
2. On the page that loads, check for other actions taken by the principal by
   using the following filters:

   - `resource.labels.cluster_name="CLUSTER_NAME"`
   - `protoPayload.authenticationInfo.principalEmail="PRINCIPAL_EMAIL"`

     Replace the following:
   - `CLUSTER_NAME`: the value that you noted in the
     **Resource display name** field in the finding details.

   - `PRINCIPAL_EMAIL`: the value that you noted in the
     **Principal email** field in the finding details.

### Step 3: Research attack and response methods

1. Review MITRE ATT\&CK framework entries for this finding type: [Discovery](https://attack.mitre.org/tactics/TA0007/)
2. Confirm the sensitivity of the object queried and determine whether there are other signs of malicious activity by the principal in the logs.
3. If the account that you noted in the **Principal email** row in the
   [finding details](https://docs.cloud.google.com/security-command-center/docs/findings/threats/gke-control-plane-can-get-sensitive-object.md.txt#discovery_gke_findings) is not a service account,
   contact the owner of the account to confirm whether the legitimate owner
   conducted the action.

   If the principal email is a service account (IAM or
   Kubernetes), identify the source of the access review to determine its
   legitimacy.
4. To develop a response plan, combine your investigation results with
   MITRE research.

## Example finding JSON

The following is an example of the finding JSON.

```json
{
  "findings": {
    "access": {
      "principalEmail": "PRINCIPAL_EMAIL",
      "callerIp": "IP_ADDRESS",
      "callerIpGeo": {
        "regionCode": "US"
      },
      "serviceName": "k8s.io",
      "methodName": "io.k8s.authorization.v1.selfsubjectaccessreviews.create"
    },
    "canonicalName": "projects/PROJECT_NUMBER/sources/SOURCE_ID/findings/03f466dc25a8496693b7482304fb2e7f",
    "category": "Discovery: Can get sensitive Kubernetes object check",
    "contacts": {
      "technical": {
        "contacts": [
          {
            "email": "EMAIL_ADDRESS"
          },
          {
            "email": "EMAIL_ADDRESS"
          },
          {
            "email": "EMAIL_ADDRESS"
          }
        ]
      }
    },
    "createTime": "2022-10-08T01:39:42.957Z",
    "database": {},
    "eventTime": "2022-10-08T01:39:40.632Z",
    "exfiltration": {},
    "findingClass": "THREAT",
    "findingProviderId": "organizations/ORGANIZATION_NUMBER/firstPartyFindingProviders/etd",
    "indicator": {},
    "kubernetes": {
      "accessReviews": [
        {
          "name": "secrets-1665218000",
          "resource": "secrets",
          "verb": "get"
        }
      ]
    },
    "mitreAttack": {},
    "mute": "UNDEFINED",
    "name": "organizations/ORGANIZATION_NUMBER/sources/SOURCE_ID/findings/03f466dc25a8496693b7482304fb2e7f",
    "parent": "organizations/ORGANIZATION_NUMBER/sources/SOURCE_ID",
    "parentDisplayName": "Event Threat Detection",
    "resourceName": "//container.googleapis.com/projects/PROJECT_ID/locations/us-west1-a/clusters/CLUSTER_NAME",
    "severity": "LOW",
    "sourceDisplayName": "Event Threat Detection",
    "state": "ACTIVE",
    "vulnerability": {},
    "workflowState": "NEW"
  },
  "resource": {
    "name": "//container.googleapis.com/projects/PROJECT_ID/locations/us-west1-a/clusters/CLUSTER_NAME",
    "display_name": "CLUSTER_NAME",
    "project_name": "//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER",
    "project_display_name": "PROJECT_ID",
    "parent_name": "//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER",
    "parent_display_name": "PROJECT_ID",
    "type": "google.container.Cluster",
    "folders": [
      {
        "resourceFolderDisplayName": "FOLDER_NAME",
        "resourceFolder": "//cloudresourcemanager.googleapis.com/folders/FOLDER_NUMBER"
      }
    ]
  },
  "sourceProperties": {
    "sourceId": {
      "projectNumber": "PROJECT_NUMBER",
      "customerOrganizationNumber": "ORGANIZATION_NUMBER"
    },
    "detectionCategory": {
      "ruleName": "gke_control_plane",
      "subRuleName": "can_get_sensitive_object"
    },
    "detectionPriority": "LOW",
    "affectedResources": [
      {
        "gcpResourceName": "//k8s.io/authorization.k8s.io/v1/selfsubjectaccessreviews"
      },
      {
        "gcpResourceName": "//cloudresourcemanager.googleapis.com/projects/PROJECT_NUMBER"
      }
    ],
    "evidence": [
      {
        "sourceLogId": {
          "projectId": "PROJECT_ID",
          "resourceContainer": "projects/PROJECT_ID",
          "timestamp": {
            "seconds": "1665193180",
            "nanos": 632000000
          },
          "insertId": "84af497e-b00e-4cf2-8715-3ae7031880cf"
        }
      }
    ],
    "properties": {},
    "findingId": "03f466dc25a8496693b7482304fb2e7f",
    "contextUris": {
      "mitreUri": {
        "displayName": "MITRE Link",
        "url": "https://attack.mitre.org/tactics/TA0007/"
      },
      "cloudLoggingQueryUri": [
        {
          "displayName": "Cloud Logging Query Link",
          "url": "https://console.cloud.google.com/logs/query;query=timestamp%3D%222022-10-08T01:39:40.632Z%22%0AinsertId%3D%2284af497e-b00e-4cf2-8715-3ae7031880cf%22%0Aresource.labels.project_id%3D%22PROJECT_ID%22?project=PROJECT_ID"
        }
      ],
      "relatedFindingUri": {}
    }
  }
}
```

## What's next

- Learn [how to work with threat
  findings in Security Command Center](https://docs.cloud.google.com/security-command-center/docs/how-to-investigate-threats).
- Refer to the [Threat findings index](https://docs.cloud.google.com/security-command-center/docs/threat-findings-index.md.txt).
- Learn how to [review a
  finding](https://docs.cloud.google.com/security-command-center/docs/how-to-investigate-threats#reviewing_findings) through the Google Cloud console.
- Learn about the [services that
  generate threat findings](https://docs.cloud.google.com/security-command-center/docs/concepts-security-sources#threats).