Strip userinfo from OpenSearch host URL before using it as task-log label#65509
Merged
potiuk merged 1 commit intoapache:mainfrom Apr 19, 2026
Merged
Strip userinfo from OpenSearch host URL before using it as task-log label#65509potiuk merged 1 commit intoapache:mainfrom
potiuk merged 1 commit intoapache:mainfrom
Conversation
…abel Follow-up to apache#65349 — OpenSearch's `_group_logs_by_host` had the same credential-leak as Elasticsearch: the raw `[opensearch] host` config value (which commonly embeds `user:password@...`) was used as a log-source dictionary key, exposing credentials in task logs. Apply the same `_strip_userinfo` helper; the OpenSearch client still connects with the full URL so auth is unaffected. Both `OpensearchTaskHandler` and `OpensearchRemoteLogIO` sites are patched. Also add `AGENTS.md` to both `providers/opensearch` and `providers/elasticsearch` noting that the two providers are forks and most task-log-handler fixes should be cross-applied.
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.
Follow-up to #65349 (thanks @Owen-CH-Leung for catching this). OpenSearch's task-log handler has the same credential-leak as Elasticsearch did:
_group_logs_by_hostfalls back to the raw[opensearch] hostconfig value as the log-source label, so a host URL containinguser:password@...appears as a dictionary key in task-log output.Applies the same
_strip_userinfohelper used inproviders/elasticsearch. The OpenSearch client itself still connects using the full unredacted URL, so authentication is unaffected. Both_group_logs_by_hostsites (OpensearchTaskHandlerandOpensearchRemoteLogIO) are patched.Also adds
AGENTS.mdto bothproviders/opensearchandproviders/elasticsearchnoting that the two providers are forks and that most task-log-handler fixes should be cross-applied, so this kind of cross-provider miss is easier to avoid next time.Test plan
test_strip_userinfoparametrized across 7 input URL shapes (with userinfo, without userinfo, username-only, non-URL, empty) — all passtest_os_task_handler.pynon-db suite continues to pass (42/42)Changelog
Added a redaction note above the latest version header in
providers/opensearch/docs/changelog.rst(mirrors the ES PR).Was generative AI tooling used to co-author this PR?
Generated-by: Claude Opus 4.7 (1M context) following the guidelines