Record that an LDAP connection test ran, and how it ended - #2541
Open
janisdombr wants to merge 14 commits into
Open
janisdombr wants to merge 14 commits into
janisdombr wants to merge 14 commits into
Conversation
`ldap_servers.rs` contains no logging at all. The test-connection endpoint dials a host and port taken from the request body and leaves nothing behind saying it happened — so an admin probing addresses through the gateway is invisible afterwards, in a product whose purpose is that such things are not. The message returned to the caller is unchanged and stays verbatim. It is gated by `AdminPermission::ConfigEdit` and answers the question the button was pressed to ask; sanitising it would remove the feature rather than protect anything.
4 tasks
# Conflicts: # warpgate-admin/src/api/ldap_servers.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
POST /ldap-servers/testendpoint dials a host and port taken from the request body and writes nothing to the log.warpgate-admin/src/api/ldap_servers.rshas no logging statements at all.It is gated by
AdminPermission::ConfigEdit, so the caller is trusted — but trust in a role and an audit trail are different things, and this is a bastion. As it stands an admin can use the gateway to probe arbitraryhost:portcombinations and nothing afterwards shows it happened, or that it succeeded.This adds
tracing::info!on success andtracing::warn!on failure, both carrying the host and port, and the error on the failing path.The message returned to the caller is deliberately unchanged. It is the answer to the question the "test connection" button was pressed to ask, and sanitising it would remove the feature rather than protect anything.
Noticed while working on #2397.