My attempts with killer simulator for CKA have expired, i’m using a home lab of CKA to keep practicing. i could play with majority of questions except Question 24 as it’s specific to the killer environment.
Requirements of question 24:
There was a security incident where an intruder was able to access the whole cluster from a single hacked backend Pod .
To prevent this create a NetworkPolicy called np-backend
in Namespace project-snake
. It should allow the backend-*
Pods only to:
- connect to
db1-*
Pods on port 1111 - connect to
db2-*
Pods on port 2222
Use the app
label of Pods in your policy.
After implementation, connections from backend-*
Pods to vault-*
Pods on port 3333 should for example no longer work.
Important: Don’t delete any current objects deployed.
I wanted to build similar environments like killer simulator:
➜ k -n project-snake get pod -o wide
NAME READY STATUS RESTARTS AGE IP …
backend-0 1/1 Running 0 4m14s 10.44.0.24 …
db1-0 1/1 Running 0 4m14s 10.44.0.25 …
db2-0 1/1 Running 0 4m16s 10.44.0.23 …
vault-0 1/1 Running 0 4m16s 10.44.0.22 …
➜ k -n project-snake exec backend-0 – curl -s 10.44.0.25:1111
database one
➜ k -n project-snake exec backend-0 – curl -s 10.44.0.23:2222
database two
➜ k -n project-snake exec backend-0 – curl -s 10.44.0.22:3333
vault secret storage
My question is how to provision a docker container that listens at port 1111/2222/3333 and returns the messages above when doing curl