-
Notifications
You must be signed in to change notification settings - Fork 31
feat: Embed NetworkPolicy to extensions #105
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
base: main
Are you sure you want to change the base?
Conversation
|
Hi @vicentefb. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for agent-sandbox canceled.
|
|
Thanks for this. Looks like a good approach. |
11cc35f to
c437102
Compare
c437102 to
4f60f49
Compare
|
|
||
| // NameHash generates an FNV-1a hash from a string and returns | ||
| // it as a fixed-length hexadecimal string. | ||
| func NameHash(objectName string) string { |
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.
Is it possible to reuse the same method in the SandboxController? https://github.com/kubernetes-sigs/agent-sandbox/blob/main/controllers/sandbox_controller.go#L236
gongmax
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.
LGTM
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: gongmax, vicentefb The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
1b20ba3 to
0ae856b
Compare
updated logging to avoid error rebase 'rebase
0ae856b to
fbd0596
Compare
Related to #32
This PR introduces an opinionated security for sandboxes by integrating the automated creation of K8s
NetworkPolicyresources. The change is introduced in theextensionsfolder.This is achieved by extending the
SandboxTemplateAPI and implementing the corresponding lifecycle management logic within thesandboxclaim-controller. These changes ensure that all sandboxes are secure by default with a "deny-all" network posture.Key Changes
NetworkPolicy Integration:
The
SandboxTemplateCRD has been extended with aspec.networkPolicysection, allowing administrators to define a secure "blueprint" for sandbox networking.The
sandboxclaim-controllernow reconciles these settings, creating a unique, "default-deny" NetworkPolicy for each SandboxClaim.This implementation directly fulfills key security requirements:
Restricts pod-to-pod communication: Each sandbox gets an individual policy, ensuring it is isolated from other sandboxes.
Controls ingress: The policy only allows traffic from trusted sources defined in the template (e.g., an L7XLB).
Restricts egress: All outgoing traffic is blocked by default, except for essential DNS lookups.
Blocks API server access: This is a direct result of the default-deny egress posture.
Controller RBAC Updates:
sandboxclaim-controllerhas been updated to include the necessary permissions to manage networkpolicies across the cluster.Unit Tests: