-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to run privileged, with capabilities, or writable filesystem? #388
Comments
With a apiVersion: kctf.dev/v1
kind: Challenge
metadata:
name: chal-sample
spec:
deployed: true
powDifficultySeconds: 0
network:
public: false
podTemplate:
template:
spec:
containers:
- name: challenge
securityContext:
capabilities:
add:
- SYS_ADMIN
readOnlyRootFilesystem: false
healthcheck:
# TIP: disable the healthcheck during development
enabled: false
image: kind/challenge:73be8f9fcfc09a9e588aafbcc4b6689d18ec6d15a7ab62e6fb4c36e557c06511
Error Messages:
shows
Since the only other thing I have modified is that it launches |
I just completely stopped all challenges and my local kind cluster, deleted the The problem with being stuck at ContainerCreation is a different issue and I'll have to do more debugging to reproduce it reliably. My original question is answered now: Yes, there is a way to specify these things in the yaml. Caveat: when I specify |
thanks, please reopen if there's news |
Hi, I have some challenge where I would like to modify some of the following settings of the
spec.spec.securityContext
:privileged: true
SYS_ADMIN
. For exampleNET_ADMIN
to be able to create veth interfaces in the containerreadOnlyRootFilesystem: false
no_new_privs
(probably unneccessary, idk)The use case for me is not just for debugging, but I think in general it would be very useful to have the option to specify these settings in the
challenge.yaml
config for anyone who needs to make an existing challenge work in kctf to pinpoint the problems.This issue can be considered related to #344 and #387 .
I am considering to patch kctf for my own use-case to support the few configurations I want, so I had a look at the code. As far as I can tell, a deployment with healthcheck and a deployment without healthcheck are created similarly, from a
kctfv1.Challenge
struct, which contains the ChallengeSpec, which in turn is probably generated directly from thechallenge.yaml
file?As far as I can tell, the deployment function uses the spec parameter but has some hardcoded defaults that can not be changed, such as
readOnlyRootFilesystem = true
. The SecurityContext seems to be modified, not overwritten, but I don't understand how to specify settings for it.However, although I think patching this "should be easy ™️ ":
Spec.PodTemplate
sounds like the functionality I wish for might even already exist? Simply adding the securityContext to thechallenge.yaml
results in a failure whenkctf chal start
validates the file.What are your opinions on this? I am hoping for any of
It might be worth mentioning that I am new to kubernetes, so please excuse me if it turns out the problems I am having are completely unrelated to kctf and could be solved using just kubernetes.
The text was updated successfully, but these errors were encountered: