Audit snapshot uploader scope: dotfiles under dataDir now writable via HOME

Open
#237 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
go, kubernetes

Research direction

Trace the sidecar snapshot uploader in sei-protocol/seictl and determine which part of dataDir it archives. Then inspect internal/noderesource/noderesource.go near the HOME declaration for the defensive comment. Done means the uploader scope is documented; if it archives wholesale dataDir, add the stated excludes and tests, otherwise record the scoped-subdirectory result and close the issue.

Written by the indexing model from the issue text.

Description

Problem

After #234, `HOME` on the seid container points at `dataDir` (`/sei` today). Cosmos SDK / seid subcommands that consult `~/.foo` will now write into the data PVC instead of failing with ENOENT/EACCES. Examples:

  • `~/.bash_history` if anyone `kubectl exec`s with a shell
  • `~/.cache/` from any Go binary using `os.UserCacheDir()`
  • Cosmos SDK keyring backends defaulting to `~/.seid/keyring-*` (mediated by sidecar today, but a future image with debug entrypoints could trigger)

Surfaced during cross-review of #234 by the security-specialist agent.

Impact

The snapshot uploader (in the sidecar, `seictl serve`) is the load-bearing question. If it tars `/sei` wholesale, any dotfile that ends up under dataDir rides along into S3 and into every node that restores from that snapshot. This is "silently-introduced persistence surface" — no exploit today, but expands threat surface and creates a confused-deputy risk for future seid plugins.

Relevant experts

  • security-specialist (threat model)
  • platform-engineer (snapshot pipeline ownership)

Proposed approach

Two layers:

  1. Audit the sidecar's snapshot upload code path. Find what subdirectory of `dataDir` is tar'd. If it's a specific subdir (e.g., `data/`), this issue is informational only — close after documenting. If it's wholesale `dataDir` content, add explicit excludes.

  2. Add a defensive comment block in `internal/noderesource/noderesource.go` near the HOME env declaration, calling out that `dataDir` now resembles a home directory and any future tooling that tars or syncs from there should be explicit about what's included.

  3. (Cut-first) Default excludes in the uploader: `.bash_history`, `.cache/`, `.ssh/`, `.aws/`, `.kube/`, `.config/`, `keyring-*`. Only relevant if step 1 shows wholesale-tar behavior.

Acceptance criteria

  • Sidecar snapshot uploader scope is documented (in this issue or a doc reference)
  • If wholesale-tar: excludes added, tests added, follow-up tracked
  • If scoped-subdir: this issue closed with link to the relevant sidecar code

Out of scope

  • Migrating dataDir to a structure that more cleanly separates "home dir" from "data dir" (would be a much larger refactor; the convention everywhere is `~/.sei == dataDir`)
  • Cosmos SDK keyring relocation

References

  • #234 cross-review (security-specialist) — surfaced this
  • sei-protocol/seictl — sidecar snapshot upload implementation lives there
Dominant language
Go
Stars
1
Forks
2
Avg merge
2h 29m
Merged PRs (30d)
56

Contributor guide

No contributing guide indexed for this repository

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 sei-protocol/sei-k8s-controller

All issues in sei-protocol/sei-k8s-controller

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.