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

✨ CIDR blocks for default Security Group rule "Node Port Services" #5147

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

krasoffski
Copy link
Contributor

What type of PR is this?
/kind feature

What this PR does / why we need it:
There is issue #3314 which describes problem when default Security Group rule "Node Port Services" it too wide.

This PR allows to specify CIDR Blocks for Security Group rule "Node Port Services" with keeping original behavior if no CIDR Blocks are provided by attribute AWSCluster.spec.network.NodePortIngressRuleCidrBlocks.

In our practice, we've deployed stackgres and add LB for Admin page, but security team found opened ports with this admin page, cause stackgress by default open NodePort too under the hood.
Thus allowing to specify networks from which node port services can be accessed negotiated this problem.

Which issue(s) this PR fixes:
Fixes #3314 (possible fix).

Special notes for your reviewer:
I did not add similar attribute for IPv6 CIDR blocks because there is validation that IPv6 cannot be used with unmanaged clusters at this time..
New unit tests for original and new behavior are added.
Added unit tests for webhook validation of correctness provided CidrBlocks.

Checklist:

  • squashed commits
  • includes documentation
  • includes emojis
  • adds unit tests
  • adds or updates e2e tests

Release note:

New `AWSCluster.spec.network.NodePortIngressRuleCidrBlocks` parameter  which allows to specify IPv4 CIDR blocks for Security group rule "Node Port Services" instead of default `0.0.0.0/`. 

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/contains-merge-commits cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 9, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign nrb for approval. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 9, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @krasoffski. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@krasoffski krasoffski force-pushed the default_node_port_security_group branch from 75c03a7 to daf349d Compare October 9, 2024 14:10
@krasoffski krasoffski changed the title ✨ Cidr blocks for default NodePort services Ingress Rule ✨ CIDR blocks for default Security Group rule "Node Port Services" Oct 9, 2024
@AndiDog
Copy link
Contributor

AndiDog commented Oct 10, 2024

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 10, 2024
@krasoffski krasoffski force-pushed the default_node_port_security_group branch from daf349d to 09931bf Compare October 10, 2024 16:10
@krasoffski
Copy link
Contributor Author

@AndiDog Thank you, Andreas. Looks like tests are passed.

@richardcase @killianmuldoon guys, could you, please, take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. needs-priority ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Security group rule "Node Port Services" can be more restrictive
3 participants