Audit snapshot uploader scope: dotfiles under dataDir now writable via HOME
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
- Domain
- infrastructure, security
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:
-
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.
-
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.
-
(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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sei-protocol/sei-k8s-controller
-
Difficulty 5/5 Over a week Newbie friendliness 32/100
-
Difficulty 5/5 Over a week Newbie friendliness 32/100
sei-protocol/sei-k8s-controller#457 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
All issues in sei-protocol/sei-k8s-controller
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100