-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Adds a new auth backend that only accepts loopback connections #13767
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
Adds a new auth backend that only accepts loopback connections #13767
Conversation
This auth backend behaves the same as the internal backend provided in the core broker, but it only accepts loopback connections. External connection attempts will receive an error.
@aaron-seo if the goal of this backend is to only allow loopback connections of automation tools, accepting all local connections without requiring them to be whitelisted make sense to me. I'm not sure I understand the part about testing remote connections. It should be a matter of connecting from any other host? |
|
Ah, wrote that before 4.1 shipped, will update to 4.2
If I'm running locally with |
Working on a fix for the failures in |
Submitted as #13795 to see if the Selenium suite failures might have something to do with the secret access. |
Quoting @MarcialRosales in #13795: When I run one of the failing selenium tests I capture the following stack trace in the logs. I can consistently reproduce this issue. If I run it from
@aaron-seo To run the test locally and from source you can follow these instructions:
This command starts up RabbitMQ using gmake and configured for the test suite
If you do not want to run it from source but directly against a RabbitMQ docker image, all you need to do is run this command (this is explained here):
|
Thank you for checking and for the instructions! Turns out to be an issue with |
Merged in #13818. |
Proposed Changes
As discussed in #13205, this PR adds a new auth backend that works exactly like the internal one, but only accepts loopback connections. This PR does so by retrieving the socket in the plain auth mechanism and passes the socket through AuthProps to the auth_backend.
I'm able to test localhost connections, but haven't found a reliable way to test non-localhost connections.
It also accepts all loopback connections, not necessary only the
loopback_users
. This behavior is subject to change and open to thoughts on it.The README.md assumes this will get shipped with 4.1.1, that is subject to change as needed.
Manual testing performed
Setup
gmake run-broker
Test localhost conections
Both connect fine
Test non-localhost connections
(Note: I just manually changed
rabbit_net:is_loopback/1
to returnfalse
to test for now)Logs look like this for both attempts
Types of Changes
What types of changes does your code introduce to this project?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply.You can also fill these out after creating the PR.
If you're unsure about any of them, don't hesitate to ask on the mailing list.
We're here to help!
This is simply a reminder of what we are going to look for before merging your code.
CONTRIBUTING.md
documentFurther Comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution
you did and what alternatives you considered, etc.