You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|4|allowed|blocked (by not running as root and no hostPID and no privileged securityContect)|allowed|blocked (by not running as root and no hostPID and no privileged securityContect)
41
41
|5|allowed|blocked (by not running as root and no hostPID and no privileged securityContect)|allowed|blocked (by not running as root and no hostPID and no privileged securityContect)
42
42
|6|allowed|blocked (by not running as root and no hostPID and no privileged securityContect)|allowed|blocked (by not running as root and no hostPID and no privileged securityContect)
43
-
|7|allowed|blocked (by not running as root and no hostPID and no privileged securityContect)|allowed|blocked (by not running as root and no hostPID and no privileged securityContect)
Run `cat example-curls.sh` to see what we are about to run. To run these against security-playground-restricted instead run `example-curls-restricted.sh`.
46
46
@@ -76,23 +76,7 @@ This triggers the:
76
76
#### security-playground-restricted
77
77
This will be blocked by our python app not being run as the root user, and therefore not having access to install packages with apt, in security-playground-restricted.
78
78
79
-
### 4. Crypto Mining Example
80
-
Here we are downloading popular crytpo miner cgminer and running it.
81
-
82
-
This will fire several Rules including:
83
-
*`Mailicious filenames written` and `Malicilous binary detected` from the `Sysdig Runtime Threat Intelligence` Managed Policy
84
-
*`Drift Detection` from `Container Drift`
85
-
*`Detect outbound connections to common miner pool ports` from the `Sysdig Runtime Threat Intelligence` Managed Policy
86
-
*`Cryto Mining Detection` from `Machine Learning`
87
-
88
-
NOTE: If you want to actually mine (needed to trigger a couple of the rules above) remove the --dry-run from the command in the curl
89
-
90
-
NOTE: This example currently only works with Intel/AMD (not ARM including Apple M1/M2)
91
-
92
-
#### security-playground-restricted
93
-
This is the only example that still works with sysdig-playground-restricted as you don't need to be root to download and run the crypto miner. It can, however, be blocked by a Sysdig Container Drift Policy set to enforce/prevent the drift.
94
-
95
-
### 5. Break out of our container and install crictl on the host/Node
79
+
### 4. Break out of our container and install crictl on the host/Node
96
80
97
81
As discussed above, given the parameters we have specified (run as root, hostPID, privileged) we are allowed to break out of our container/Linux namespace if we ask. You can do that with the tool `nsenter`. We use this to download and install `crictl`, the tool to manage the container runtime directly, on the Node outside the container. We'll leverage this command behind there in the following examples.
98
82
@@ -103,7 +87,7 @@ This will fire two Rules:
103
87
#### security-playground-restricted
104
88
This will be blocked by our python app not being run as the root user, and therefore not being root outside the container either in security-playground-restricted. It also would be blocked by not having hostPID and/or the privileged securityContext in the PodSpec.
105
89
106
-
### 6. Break out of our container and interact with other containers via crictl
90
+
### 5. Break out of our container and interact with other containers via crictl
107
91
108
92
The `crictl` command is similar to the Docker CLI and allows you to directly manage the local container runtime (containerd) on the Node - bypassing Kubernetes which normally is how you'd manage it.
109
93
@@ -114,11 +98,27 @@ This will fire several the `The docker client is executed in a container` rule i
114
98
#### security-playground-restricted
115
99
This will be blocked by our python app not being run as the root user, and therefore not being root outside the container either in security-playground-restricted. It also would be blocked by not having hostPID and/or the privileged securityContext in the PodSpec.
116
100
117
-
### 7. Run a command (a psql query) in another container on the same Node (that runs a PostgreSQL DB)
101
+
### 6. Run a command (a psql query) in another container on the same Node (that runs a PostgreSQL DB)
118
102
119
103
Finally let's exfiltrate some data by running a query within `psql` inside another container on the same host. Even if the database wasn't running within the container (maybe it is an AWS RDS instead) the application Pod needs to have the connection string/secret within it decrypted at runtime in order for *it* to connect. Which means if we can install/run the database client within that other container/Pod then this will still work.
120
104
121
105
This will fire the the `The docker client is executed in a container` rule in the `Sysdig Runtime Notable Events` Managed Policy twice (once for the `crictl ps` to find the container ID and another for the `crictl exec` that runs the `psql` command to extract the data).
122
106
123
107
#### security-playground-restricted
124
108
This will be blocked by our python app not being run as the root user, and therefore not being root outside the container either in security-playground-restricted. It also would be blocked by not having hostPID and/or the privileged securityContext in the PodSpec.
109
+
110
+
### 7. Crypto Mining Example
111
+
Here we are downloading popular crytpo miner cgminer and running it.
112
+
113
+
This will fire several Rules including:
114
+
*`Mailicious filenames written` and `Malicilous binary detected` from the `Sysdig Runtime Threat Intelligence` Managed Policy
115
+
*`Drift Detection` from `Container Drift`
116
+
*`Detect outbound connections to common miner pool ports` from the `Sysdig Runtime Threat Intelligence` Managed Policy
117
+
*`Cryto Mining Detection` from `Machine Learning`
118
+
119
+
NOTE: If you want to actually mine (needed to trigger a couple of the rules above) remove the --dry-run from the command in the curl. Also note that without the --dry-run that it will keep running until you kill the Pod!
120
+
121
+
NOTE: This example currently only works with Intel/AMD (not ARM including Apple M1/M2)
122
+
123
+
#### security-playground-restricted
124
+
This is the only example that still works with sysdig-playground-restricted as you don't need to be root to download and run the crypto miner. It can, however, be blocked by a Sysdig Container Drift Policy set to enforce/prevent the drift.
0 commit comments