Skip to content

Record that an LDAP connection test ran, and how it ended - #2541

Open
janisdombr wants to merge 14 commits into
warp-tech:mainfrom
janisdombr:upstream-fix/ldap-errors
Open

janisdombr wants to merge 14 commits into
warp-tech:mainfrom
janisdombr:upstream-fix/ldap-errors

Conversation

@janisdombr

Copy link
Copy Markdown
Contributor

The POST /ldap-servers/test endpoint dials a host and port taken from the request body and writes nothing to the log. warpgate-admin/src/api/ldap_servers.rs has 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 arbitrary host:port combinations and nothing afterwards shows it happened, or that it succeeded.

This adds tracing::info! on success and tracing::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.

`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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant