checkpoints: snapshots copy untracked secret files into git objects

Open
#9,110 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
62/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
git, javascript
Domain
security, tooling

Research direction

Start in packages/server/src/checkpoint-manager.js at _createGitSnapshot, following the private-index setup through the git add -A -- . call to see where pathspec excludes can be attached and where the commit and tag are written. Read the existing checkpoint tests to learn the fixture setup, then add a regression case with an untracked credentials/x.p12, an untracked .env and a .env.example, asserting via git cat-file -e that only the first two are absent and that the warning fires once per snapshot. Finish by documenting in the checkpoint docs that untracked, non-ignored files are included unless excluded.

Written by the indexing model from the issue text.

Description

enhancement server

Context

CheckpointManager._createGitSnapshot (packages/server/src/checkpoint-manager.js) builds a checkpoint by staging everything under the session's cwd into a private index with git add -A -- ., writing a commit with commit-tree, and tagging it chroxy-checkpoint/<id>.

git add -A respects .gitignore but nothing else. Any untracked file that isn't ignored is therefore copied into the repository's object store, and kept there for as long as the checkpoint tag exists. That includes local credentials, signing material, .env files and exported keys that a user keeps beside the code without a gitignore rule.

The tags are local. But git push --tags, git push --mirror, or a mirror clone used as a backup then carries those files off the machine, and nothing in the UI says a checkpoint captured them.

Proposal

  1. Before staging, exclude common secret paths and extensions from the snapshot through pathspec excludes on the add. Examples: *.p12, *.pfx, *.pem, *.key, *.keystore, *.jks, *.mobileprovision, .env and .env.* (but not .env.example), and credentials/.
  2. When an untracked, non-ignored file matches one of those patterns, leave it out and emit a warning that names the path, so the user can add a gitignore rule.
  3. Document that checkpoints include untracked, non-ignored files.

Acceptance

  • A snapshot of a tree containing an untracked credentials/x.p12 and an untracked .env does not contain either blob (git cat-file -e fails for both). The checkpoint still restores the rest of the tree.
  • The skipped paths are reported once per snapshot.
  • Existing checkpoint tests pass. A regression test covers both exclusions and the .env.example exception.
Dominant language
JavaScript
Stars
7
Forks
1
Avg merge
2h 3m
Merged PRs (30d)
333

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 blamechris/chroxy

All issues in blamechris/chroxy

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.