Skip to content

Security: log only the host when a ping fails - #26

Merged
SandObserver merged 1 commit into
mainfrom
security/ping-log-path
Aug 10, 2026
Merged

SandObserver merged 1 commit into
mainfrom
security/ping-log-path

Conversation

@SandObserver

Copy link
Copy Markdown
Owner

Summary

  • Log u.origin alone in the ping failure record, dropping the request path.
  • Update the three existing assertions that expected the path, and add a case proving a path segment cannot reach the record.

Credentials in the authority and secrets in the query string were already excluded. The path was not, and several self-hosted services carry an API key as a path segment rather than as a query parameter, so a failed ping could write a live credential into the container log and leave it there for the life of the log.

The origin answers what the operator needs to know, which is which service is unreachable.

Testing
All green, including the Docker build. Added 1 test for the path case and updated 3 existing assertions; no other test asserted on the field.

Checklist

  • Stays within the project constraints: one container, no runtime dependencies, no build step (see CONTRIBUTING.md).
  • Tests added or updated for new logic, and the full suite, lint, and typechecks pass.
  • Docs updated if behavior or configuration changed. No documentation describes the contents of this record.
  • CHANGELOG.md updated under Unreleased if the change is user-visible. The changelog entry lands with the documentation change.

The failure record wrote the origin and the request path. Some services carry
an API key as a path segment rather than in the query string, so a failed ping
could write a credential into the container log, where it persists for the
life of the log.

The origin alone answers the operator's question, which is which service is
unreachable. Credentials in the authority and the query string were already
excluded; the path is the remaining half.
@SandObserver SandObserver added the security Security fix label Aug 10, 2026
@SandObserver
SandObserver merged commit 567e734 into main Aug 10, 2026
4 checks passed
@SandObserver
SandObserver deleted the security/ping-log-path branch August 10, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security Security fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant