Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Commit b28caa0

Browse files
authored
Merge pull request #12 from k8sstormcenter/fix/makefile-destroy
fix: fix destroy rules in makefile for matcher & neo4j
2 parents d866682 + 39cc69f commit b28caa0

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

Makefile

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
11
STIX_MODEL_PATH=stix/examples/stix-attack-model.json
22

3-
all: install-matcher install-neo4j insert-attack-models
4-
5-
install-matcher:
6-
kubectl apply -f pattern_matcher/resources.yaml
3+
all: install-neo4j install-matcher insert-attack-models
74

85
install-neo4j:
96
helm repo add neo4j https://helm.neo4j.com/neo4j
107
helm repo update
118
helm upgrade --install --create-namespace neo4j-poc neo4j/neo4j --namespace neo4j -f neo4j/values.yaml
9+
kubectl -n neo4j wait --timeout=10m --for=condition=Ready pod -l app=hub
10+
11+
install-matcher:
12+
kubectl apply -f pattern_matcher/resources.yaml
13+
kubectl -n redpanda wait --for=condition=Ready pod -l app=matcher
1214

1315
forward-neo4j:
16+
kubectl port-forward -n neo4j service/neo4j-poc 7474:7474 &
1417
kubectl port-forward -n neo4j service/neo4j-poc 7687:7687
1518

1619
insert-attack-models:
1720
POD_NAME=$$(kubectl get pods -n redpanda -l app=matcher -o jsonpath='{.items[0].metadata.name}') ;\
1821
kubectl cp ${STIX_MODEL_PATH} redpanda/$${POD_NAME}:/tmp ;\
1922
kubectl exec -it -n redpanda $${POD_NAME} -- python /app/src/patternmatcher/load.py /tmp/$(notdir ${STIX_MODEL_PATH})
2023

24+
destroy: destroy-matcher destroy-neo4j
25+
2126
destroy-matcher:
22-
kubectl delete pods matcher -n redpanda
27+
kubectl delete deployment/matcher -n redpanda
2328

2429
destroy-neo4j:
25-
helm uninstall neo4-poc -n neo4j
30+
helm uninstall neo4j-poc -n neo4j
2631
kubectl delete ns neo4j

README.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ The [stix](./stix) directory provides examples and resources to help users under
4444

4545

4646
## Getting Started
47-
Follow these detailed steps to deploy the necessary components on your honey cluster, create your attack model, upload it, and set up monitoring for your specific attack interests:
47+
Follow these detailed steps to deploy the necessary components on your honey cluster, create your attack model, upload it, and set up monitoring for your specific attack interests.
48+
49+
Step 1-3 can be executed at once using:
50+
```bash
51+
make
52+
```
4853

4954

5055
### Step 1: Deploy the Threat Database
@@ -86,3 +91,11 @@ After setting up your models, you can either simulate an attack on the honey clu
8691
Once connected, navigate to `localhost:7474` in your web browser to check the database entries and see if the matcher has detected any relevant attacks as defined by your models. With some luck you should be able to see lots of colorful detected balls.
8792

8893
[![Detection](./figures/log-detection.png)](https://drive.google.com/file/d/1RfPr_7RmXDlU22-l7ZFoMnWJKloP0VpG/view?usp=sharing)
94+
95+
96+
### Teardown
97+
Remove all created resources (from step 1-3) on your cluster using
98+
99+
```bash
100+
make destroy
101+
```

0 commit comments

Comments
 (0)