Redact smb://, sftp:// and ssh:// paths in the trace scrub

Open Beginner friendly
#853 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
83/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
security, testing

Research direction

Read dokimi/repos/host_fingerprint.py and inspect _PATH, then find the existing path scrub tests. Add cases for smb://, sftp:// and ssh:// covering plain paths, quoted paths with spaces, and uppercase schemes; preserve each scheme while replacing its path with <path>. Run the relevant tests and confirm all cases pass.

Written by the indexing model from the issue text.

Description

#781 redacts file: URLs and UNC paths in error text (_PATH in dokimi/repos/host_fingerprint.py). The trace scrub still lets other URL schemes through.

Probe on the _PATH regex from #781 (its sub with <path>):

  • cp smb://fileserver/share/Jane/secret.txt here is unchanged.
  • sftp://jdoe@host/home/jdoe/key is unchanged.
  • ssh://jdoe@host/home/jdoe/x is unchanged.
  • file:///home/jdoe/x becomes <path>, and so does \\srv\share\x.

The absolute-path branch excludes a / after : (the scheme: before //), and the UNC branch needs // not preceded by :, so the host and path after smb://, sftp:// and ssh:// are not redacted.

Ask: redact smb://, sftp:// and ssh:// paths in the trace scrub the way file:// is redacted (the scheme kept, the path replaced by <path>), with a test per scheme for a plain path, a quoted path with a space, and an uppercase scheme.

Follow-up to #781 (its path scrub handles file: and UNC only).

Dominant language
Python
Stars
39
Forks
13
Avg merge
1d 10h
Merged PRs (30d)
519

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from intel/dokimi

All issues in intel/dokimi

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.