crate / crate/cratedb-toolkit

Redact sensitive information from I/O error messages

Open
#877 0 comments 0 reactions 1 assignee Claimed by @bgunebakan View on GitHub
Dominant language
Python
Stars
10
Forks
5
Avg merge
7d 5h
Merged PRs (30d)
7

Description

## Summary

Redact sensitive information before an error message includes an unsupported input URL.

## Rationale

`IoRouter.load_table()` currently includes `source_url_obj` in its `NotImplementedError` message for unsupported resources. URLs can contain credentials in query parameters. For example, a Kinesis URL can include `aws_secret_access_key`. The error can reach CLI output or logs.

## Affected area

- `cratedb_toolkit/io/router.py`
- Error formatting for unsupported `IoRouter.load_table()` source URLs
- Related tests for CLI or router error output

## Required changes

- Format unsupported source URLs with sensitive query values masked before raising an error.
- Define the redaction behavior for credential-bearing URL components and query parameters.
- Add a regression test that uses an unsupported URL with a query secret and verifies that the secret value does not occur in the error message.

## Acceptance criteria

- Error messages do not expose credential values from unsupported source URLs.
- The error still identifies the unsupported resource sufficiently for troubleshooting.
- A regression test covers a URL that contains a query secret.

## Backlinks

- Requested by: @bgunebakan
- Pull request: https://github.com/crate/cratedb-toolkit/pull/874
- Review comment: https://github.com/crate/cratedb-toolkit/pull/874#discussion_r3690283662

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.