-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Add option to disable clients in netapi #59622
Add option to disable clients in netapi #59622
Conversation
717853b
to
7e1d683
Compare
130e491
to
0996333
Compare
re-run ci/py3/macosxmojave/pytest |
re-run pr-macosxmojave-py3-pytest |
@barneysowood I updated the branch with |
Thanks @sagetherage. Looks like the failing tests are fixed now - thanks! Unfortunately seems to have times out on ci/py3/centos7/pycryptodome/pytest - I'll try that again now. |
re-run pr-centos7-py3-pycryptodome-pytest |
OK, tests now all green. @garethgreenaway - if you get a chance to review that would be great, thanks! |
I approved but look like there is a merge conflict. Would also like to get @dwoz review here as well. |
Hmm, have totally messed up the rebase trying to sort the conflict. Will fix that and re-push |
3b15891
to
6e21408
Compare
re-run pr-freebsd-122-amd64-py3-pytest |
re-run pr-ubuntu-2004-arm64-py3-pytest |
re-run pr-macosx-mojave-x86_64-py3-pytest |
6e21408
to
e03b3b1
Compare
re-run pr-fedora-34-x86_64-py3-pytest |
1 similar comment
re-run pr-fedora-34-x86_64-py3-pytest |
re-run pr-macosx-catalina-x86_64-py3-pytest |
re-run pr-macosx-mojave-x86_64-py3-pytest |
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.
Honestly, due to the amount of problems we've had with the netapi I think this should be an opt in scenario rather than opt out. Meaning it'd be netapi_enable_clients
and they are all disabled by default.
@dwoz - I would tend to agree, but I was trying to avoid a breaking change. If everyone is OK with that I'm happy rework this to be The other option would be to set the default (either using the |
dcdeed4
9a19bf2
to
dcdeed4
Compare
re-run pr-amazon-2-x86_64-py3-pytest |
@dwoz I really like the idea of the opt in as well, but that seems like a big change for users of salt-api. Shouldn't we add a deprecation notice somehow or give users notice before we make this change? |
080df77
to
5df0cd4
Compare
Adds an option to allow you to disable clients (eg ssh, wheel) in the netapi. Does the check before any attempts to authenticate.
Adds pytest based integration tests as the old non-pytest netapi/test_client.py tests have been removed.
5df0cd4
to
eb6b085
Compare
Closing in favour of #63050 |
What does this PR do?
Adds a new config option "netapi_disable_clients" that takes a list of clients to disable in the netapi.
Checks the list early in handling the the request before authentication occurs. Should be useful where certain clients (eg ssh or wheel) aren't required and should be disabled to reduce attack surface in the salt-api.
replaces #58872
What issues does this PR fix or reference?
New Behavior
Adds "netapi_disable_clients" list option to the config which is checked when a request is passed to NetApiClient.run() and an exception raised if the requested client is in the list.
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
No