This document describes a threat finding type in Security Command Center. Threat findings are generated by threat detectors when they detect a potential threat in your cloud resources. For a full list of available threat findings, see Threat findings index.
Finding description
A process started with stream redirection to a remote connected socket. Spawning a network-connected shell can allow an attacker to perform arbitrary actions after a limited initial compromise. To respond to this finding, do the following:
Step 1: Review finding details
Open a
Reverse Shell
finding as directed in Reviewing findings. The details panel for the finding opens to the Summary tab.On the Summary tab, review the information in the following sections:
- What was detected, especially the following fields:
- Program binary: the absolute path of the process started with stream redirection to a remote socket.
- Arguments: the arguments provided when invoking the process binary.
- Affected resource, especially the following fields:
- Resource full name: the full resource name of the cluster.
- Project full name: the affected Google Cloud project.
- Related links, especially the following fields:
- VirusTotal indicator: link to the VirusTotal analysis page.
- What was detected, especially the following fields:
In the detail view of the finding, click the JSON tab.
In the JSON, note the following fields.
resource
:project_display_name
: the name of the project that contains the asset.
sourceProperties
:Pod_Namespace
: the name of the Pod's Kubernetes namespace.Pod_Name
: the name of the GKE Pod.Container_Name
: the name of the affected container.VM_Instance_Name
: the name of the GKE node where the Pod executed.Reverse_Shell_Stdin_Redirection_Dst_Ip
: the remote IP address of the connectionReverse_Shell_Stdin_Redirection_Dst_Port
: the remote portReverse_Shell_Stdin_Redirection_Src_Ip
: the local IP address of the connectionReverse_Shell_Stdin_Redirection_Src_Port
: the local portContainer_Image_Uri
: the name of the container image being executed.
Step 2: Review cluster and node
In the Google Cloud console, go to the Kubernetes clusters page.
On the Google Cloud console toolbar, select the project listed in
resource.project_display_name
, if necessary.Select the cluster listed in
resource.name
. Note any metadata about the cluster and its owner.Click the Nodes tab. Select the node listed in
VM_Instance_Name
.Click the Details tab and note the
container.googleapis.com/instance_id
annotation.
Step 3: Review Pod
In the Google Cloud console, go to the Kubernetes Workloads page.
On the Google Cloud console toolbar, select the project listed in
resource.project_display_name
, if necessary.Filter on the cluster listed in
resource.name
and the Pod namespace listed inPod_Namespace
, if necessary.Select the Pod listed in
Pod_Name
. Note any metadata about the Pod and its owner.
Step 4: Check logs
In the Google Cloud console, go to Logs Explorer.
On the Google Cloud console toolbar, select the project listed in
resource.project_display_name
, if necessary.Set Select time range to the period of interest.
On the page that loads, do the following:
- Find Pod logs for
Pod_Name
by using the following filter:resource.type="k8s_container"
resource.labels.project_id="resource.project_display_name"
resource.labels.location="location"
resource.labels.cluster_name="cluster_name"
resource.labels.namespace_name="Pod_Namespace"
resource.labels.pod_name="Pod_Name"
- Find cluster audit logs by using the following filter:
logName="projects/resource.project_display_name/logs/cloudaudit.googleapis.com%2Factivity"
resource.type="k8s_cluster"
resource.labels.project_id="resource.project_display_name"
resource.labels.location="location"
resource.labels.cluster_name="cluster_name"
Pod_Name
- Find GKE node console logs by using the following filter:
resource.type="gce_instance"
resource.labels.instance_id="instance_id"
- Find Pod logs for
Step 5: Investigate running container
If the container is still running, it might be possible to investigate the container environment directly.
Go to the Google Cloud console.
On the Google Cloud console toolbar, select the project listed in
resource.project_display_name
, if necessary.Click Activate Cloud Shell.
Obtain GKE credentials for your cluster by running the following commands.
For zonal clusters:
gcloud container clusters get-credentials cluster_name --zone location --project resource.project_display_name
For regional clusters:
gcloud container clusters get-credentials cluster_name --region location --project resource.project_display_name
Launch a shell within the container environment by running:
kubectl exec --namespace=Pod_Namespace -ti Pod_Name -c Container_Name -- /bin/sh
This command requires the container to have a shell installed at
/bin/sh
.To view all processes running in the container, run the following command in the container shell:
ps axjf
This command requires the container to have
/bin/ps
installed.
Step 6: Research attack and response methods
- Review MITRE ATT&CK framework entries for this finding type: Command and Scripting Interpreter, Ingress Tool Transfer.
- Check the SHA-256 hash value for the binary flagged as malicious on VirusTotal by clicking the link in VirusTotal indicator. VirusTotal is an Alphabet-owned service that provides context on potentially malicious files, URLs, domains, and IP addresses.
- To develop a response plan, combine your investigation results with the MITRE research and VirusTotal analysis.
Step 7: Implement your response
The following response plan might be appropriate for this finding, but might also impact operations. Carefully evaluate the information you gather in your investigation to determine the best way to resolve findings.
- Contact the owner of the project with the compromised container.
- Stop or delete the compromised container and replace it with a new container.
What's next
- Learn how to work with threat findings in Security Command Center.
- Refer to the Threat findings index.
- Learn how to review a finding through the Google Cloud console.
- Learn about the services that generate threat findings.