-
Notifications
You must be signed in to change notification settings - Fork 20
feat(network): implement ingress network policies #1017
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
feat(network): implement ingress network policies #1017
Conversation
|
/build_test |
|
|
|
/build_test |
|
|
| }, | ||
| Ports: []networkingv1.NetworkPolicyPort{ | ||
| networkingv1.NetworkPolicyPort{ | ||
| Port: &intstr.IntOrString{IntVal: constants.AuthProxyHttpContainerPort}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a policy for the agent gateway (nginx) port as well? This could theoretically be limited to inbound traffic from the target namespaces of the CR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, I'll add that in
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened as a separate PR: #1022
ebaron
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work well. I added a commit with a couple of changes:
- Delete the NetworkPolicy object when the
disabledproperty is true - Update the NetworkPolicy spec by placing it in the body of the
CreateOrUpdate...method
What do you think?
|
/build_test |
|
|
Nice, thanks. That looks good. |
Welcome to Cryostat! 👋
Before contributing, make sure you have:
mainbranch[chore, ci, docs, feat, fix, test]git commit -S -m "YOUR_COMMIT_MESSAGE"Fixes: #1008
See #814
See also cryostatio/cryostat-helm#208
Description of the change:
Mirrors the
NetworkPolicyimplementation for ingress traffic from the Helm PR above.Motivation for the change:
Adds network-level isolation to various Pods created by the Operator, so that traffic to each is only allowed from expected origins (assuming the cluster supports this feature). This prevents unexpected connections to the database or storage, which could result in data being leaked if authentication is not configured or is somehow bypassed.
How to manually test:
oc describe networkpolicyoc runand try tocurlrequests tohttp://cryostat-sample-reports:10000orhttp://cryostat-sample-storage:8333.