-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat]: added exploit pfa intent (#120)
* added exploit pfa intent Signed-off-by: Ved Ratan <[email protected]> * added caldera documentation Signed-off-by: Ved Ratan <[email protected]> --------- Signed-off-by: Ved Ratan <[email protected]>
- Loading branch information
Showing
16 changed files
with
169 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
|
||
## Defining Abilities | ||
|
||
Since exploit-pfa doesn't pre-exist in caldera abilities so we need to define the abilities by ourselves. | ||
|
||
### Create abilities | ||
|
||
Commands | ||
|
||
|
||
```bash | ||
kubectl create -f https://raw.githubusercontent.com/5GSEC/nimbus/main/docs/attack-emulation/pod.yaml | ||
``` | ||
|
||
```bash | ||
kubectl get pods nginx | ||
``` | ||
|
||
```bash | ||
kubectl exec -it nginx -- /bin/bash -c "apt-get update && apt-get install -y git" | ||
``` | ||
|
||
```bash | ||
kubectl exec -it nginx -- /bin/bash -c "cp /usr/bin/git /tmp/" | ||
``` | ||
|
||
```bash | ||
kubectl exec -it nginx -- /bin/bash -c "/tmp/git clone https://github.com/thockin/test.git" | ||
``` | ||
|
||
```bash | ||
kubectl delete pod nginx | ||
``` | ||
|
||
### Create test pod | ||
|
||
![alt text](images/create-test-pod.png) | ||
|
||
### Get the pod | ||
|
||
![alt text](images/get-pod.png) | ||
|
||
### Install git | ||
|
||
![alt text](images/install-git.png) | ||
|
||
### Move git binary | ||
|
||
![alt text](images/move-git.png) | ||
|
||
## Clone a github repo | ||
|
||
![alt text](images/clone-repo.png) | ||
|
||
## Delete the test pod | ||
|
||
![alt text](images/delete-test-pod.png) | ||
|
||
## Create Adversary | ||
|
||
- `+` New Profile | ||
- `+` Add Ability | ||
|
||
![alt text](images/create-adversary.png) | ||
|
||
## Create Operation | ||
|
||
- `+` New Operation | ||
- set Adversary | ||
|
||
![alt text](images/operation.png) | ||
|
||
|
||
## Attack Emulation | ||
|
||
After creating the operation click on start to start the attack, optionally you can also check locally in your terminal that whether the caldera agent is working as expected or not. | ||
|
||
![alt text](images/emulation.png) | ||
|
||
|
||
|
||
## Mitigation | ||
|
||
For the mitigation of `Exploit-PFA` we need nimbus-kuberamor adapter to be in-place: | ||
- First we need to install nimbus, you can do so by following the steps over [here](../../docs/getting-started.md#nimbus). | ||
- Now you can follow the guide [here](../../docs/getting-started.md#nimbus-kubearmor) to install nimbus-kubearmor adapter. | ||
- Now apply the escape-host-intent in your cluster as defined [here](../../examples/namespaced/exploit-pfa-si |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ apiVersion: v1 | |
kind: Pod | ||
metadata: | ||
name: nginx | ||
labels: | ||
app: nginx | ||
spec: | ||
containers: | ||
- image: nginx | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright 2023 Authors of Nimbus | ||
|
||
apiVersion: intent.security.nimbus.com/v1 | ||
kind: SecurityIntent | ||
metadata: | ||
name: exploit-pfa | ||
spec: | ||
intent: | ||
id: PreventExecutionFromTempOrLogsFolders | ||
description: "Mitigate the execution of harmful binaries which may result in exploiting public facing application" | ||
action: Block | ||
--- | ||
apiVersion: intent.security.nimbus.com/v1 | ||
kind: SecurityIntentBinding | ||
metadata: | ||
name: exploit-pfa-binding | ||
spec: | ||
intents: | ||
- name: exploit-pfa | ||
selector: | ||
any: | ||
- resources: | ||
kind: Pod | ||
namespace: default | ||
matchLabels: | ||
app: nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters