-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
IP Restriction at TCP Level. #6679
Comments
That should be doable. PR welcome, or I/we (at Kong) can take a look, but cannot promise exactly when. |
We are willing to submit a PR, if someone can point us in the right direction. |
Hello @scrudge, If you use the L4 proxy functionalities provided by Kong, It should works at the L3. See: https://docs.konghq.com/2.2.x/proxy/#proxy-tcptls-traffic The reason why Kong's IP restriction plugin under HTTP mode (and Nginx's own ngx_http_access_module, for that matter) works in L7 mode is because the client may present headers such as |
Sorry for reviving this but has anyone managed to use TCPIngress with ip restriction?
The IP restriction works for HTTP but not TCP. |
The plugin currently only works for HTTP, not TCP. See:
We want for this to work on TCPIngress objects also. It looks like the plugin needs to be reworked to support TCP. Ideally it would use the configured real_ip_header if available, fallback to proxy_protocol source IP if available, or fallback to TCP source IP as a last resort. |
Re-opening this since this is a fair ask. PRs welcome. |
We are currently testing these changes. Plan on submitting PR in the near future. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
The change we've made is based on release/2.8.x. Can we submit a PR to merge these changes into a new 2.x release? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@merusso thank you for your interest in submitting a new feature for Kong! Kong 2.8 is not under active development now, this means we are only adding fixes to bugs or security vulnerabilities, and a new feature would not see the sunlight. Please, open a PR targeting |
@locao We have also included a PR for the master branch as well. We are requesting that both PRs be accepted, as we are currently stuck on 2.8.x because of open issue we have with v3 that prevents us from upgrading. I'll update the Kong support ticket with more info. |
Can this issue be reopened? We have open PRs meant to resolve this issue. |
Reopening to keep tracking this. |
Resolves Kong#6679 This change adds TCP support to the ip-restriction plugin by implementing the Stream module's preread function. When a TCP connection is rejected due to IP restriction rules, a JSON error response is written to the stream and the connection is closed.
We forgot to remove the "pending author feedback" label so it was closed. Reopening. |
Summary
I am using Kong IP restriction plugin, according to the documentation its only compatible with HTTP and HTTPs, wanted to apply it at TCP level. Is there such a provision in Kong? Or a work around.
The text was updated successfully, but these errors were encountered: