Skip to content
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

Prevent invalid custom resources (appdefinition, session, workspace) #199

Open
2 tasks
jfaltermeier opened this issue Jul 18, 2023 · 3 comments
Open
2 tasks
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jfaltermeier
Copy link
Collaborator

jfaltermeier commented Jul 18, 2023

Describe the bug

Invalid values in the custom resources may lead to crash loops or open attack vectors.

Resources:
https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#validation

https://kubernetes.io/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definitions/#validation-rules

Reproducer Session
theia-cloud branch osweek23-1
theia-cloud-helm branch osweek23-1
terraform test-configuration 2-01_try-now
kubectl apply -f osweek23/empty-session.yaml

Reproducer Workspace
theia-cloud branch osweek23-1
theia-cloud-helm branch osweek23-1
terraform test-configuration 2-01_try-now
kubectl apply -f osweek23/empty-workspace.yaml

Reproducer AppDefinition
theia-cloud branch osweek23-2
theia-cloud-helm branch osweek23-1
terraform test-configuration 2-01_try-now
kubectl apply -f osweek23/coffee-session.yaml

Expected behavior

  • Preferably applying invalid CRs should not be possible. There might be shemas for CRDs.
  • Validate all user input from CRs in code before using it (e.g. is this really valid container-image string? is this a injection attack? do the timeout values make sense?, ...)

Cluster provider

No response

Version

No response

Additional information

No response

@jfaltermeier jfaltermeier added the bug Something isn't working label Jul 18, 2023
@jfaltermeier jfaltermeier added this to the OS Week 23 milestone Jul 18, 2023
@xai
Copy link
Member

xai commented Aug 2, 2023

Since apiextensions.k8s.io/v1, preserveUnknownFields should be set to false by default, which leads to automatic pruning of unknown fields. So I assume that we do not have to care about these 😊

Copy link

This issue is stale because it has been open for 180 days with no activity.

@github-actions github-actions bot added the stale label Jan 30, 2024
@sgraband
Copy link
Collaborator

Keep open

@github-actions github-actions bot removed the stale label Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

3 participants