Skip to content

Stop implicit argv logging#194

Merged
codeforester merged 2 commits into
mainfrom
security/191-20260725-safe-argv-logging
Jul 25, 2026
Merged

Stop implicit argv logging#194
codeforester merged 2 commits into
mainfrom
security/191-20260725-safe-argv-logging

Conversation

@codeforester

Copy link
Copy Markdown
Collaborator

Summary

  • remove the stdlib's automatic unredacted command-line DEBUG record
  • preserve original-argument capture and wrapper-option filtering
  • document that applications own schema-aware redaction before explicitly
    logging invocation details
  • add regression coverage proving enabled DEBUG sinks contain only an explicit
    safe diagnostic, not option, positional, or URL-embedded secret values

Issue

Closes #191

Validation

  • bats lib/bash/std/tests/lib_std.bats — 153 tests passed locally, with one
    environment-specific process-listing skip
  • ./tests/validate.sh — 315 tests passed
  • git diff --check

Notes

Checklist

  • Branch name follows <category>/<issue>-<YYYYMMDD>-<slug>.
  • Pull request is scoped to one issue, unless a documented multi-issue exception applies.
  • Pull request body explains what changed and how it was validated.
  • Relevant project checks pass.
  • Documentation is updated when behavior or user-facing commands change.
  • CHANGELOG is updated for notable user-visible or release-worthy changes.
  • Pull request includes Fixes #<issue> or Closes #<issue> when merge should close the issue.

@codeforester codeforester mentioned this pull request Jul 25, 2026
7 tasks
@codeforester
codeforester marked this pull request as ready for review July 25, 2026 23:03
@codeforester
codeforester merged commit a03d282 into main Jul 25, 2026
2 checks passed
@codeforester
codeforester deleted the security/191-20260725-safe-argv-logging branch July 25, 2026 23:03
@codeforester codeforester mentioned this pull request Jul 25, 2026
10 tasks
codeforester added a commit that referenced this pull request Jul 25, 2026
## Summary

- make persistent-sink eligibility reflect the configured filesystem
path
- keep `log_is_enabled` non-mutating while rejecting missing-parent,
  non-regular, symlink, non-owned, and unwritable targets
- create new primary logs privately and normalize new or existing files
to
  mode `0600` before appending
- suppress best-effort setup and redirection failures, then disable a
failed
  path for the remainder of the process
- apply the same sink contract to structured and file-content logging

## Issue

Closes #192

## Validation

- `bats lib/bash/std/tests/lib_std.bats` — 159 tests passed locally,
with one
  environment-specific process-listing skip
- `./tests/validate.sh` — 321 tests passed
- `shellcheck --severity=warning lib/bash/std/lib_std.sh`
- `git diff --check`

## Notes

- This PR is stacked on #194; its base branch is
  `security/191-20260725-safe-argv-logging`.
- Successful terminal behavior and rendered log records are unchanged.
- `log_is_enabled` does not create or chmod a path; the final setup and
append
  remain best-effort across filesystem races and I/O failures.
- Parent-directory creation, ACL removal, rotation, and new public sink
APIs are
  out of scope.
- #193 will add an actual Bash 4.2 logging smoke test over the completed
path.
- `VERSION` remains unchanged; this work is targeted to the `v1.4.0`
  milestone.

## Checklist

- [x] Branch name follows `<category>/<issue>-<YYYYMMDD>-<slug>`.
- [x] Pull request is scoped to one issue, unless a documented
multi-issue exception applies.
- [x] Pull request body explains what changed and how it was validated.
- [x] Relevant project checks pass.
- [x] Documentation is updated when behavior or user-facing commands
change.
- [x] CHANGELOG is updated for notable user-visible or release-worthy
changes.
- [x] Pull request includes `Fixes #<issue>` or `Closes #<issue>` when
merge should close the issue.
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.

Stop implicitly logging unredacted process arguments

1 participant