fix(deploy): ensure remote .env file has secure permissions (600)#174
fix(deploy): ensure remote .env file has secure permissions (600)#174cv merged 1 commit intoNVIDIA:mainfrom
Conversation
|
I've taken a look at the changes and see that this PR adds a post-deployment step to enforce 600 permissions on the remote .env file, which should prevent insecure default permissions from exposing secrets. |
|
Hey @dumko2001 — securing .env permissions to 600 is a solid improvement. Would you be able to rebase onto the latest main? The repo has been moving quickly and we want to evaluate this against the current state of things. Thanks! |
59a65ca to
d08cf0e
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughThe deployment script now, after copying the local Changes
Sequence Diagram(s)sequenceDiagram
participant Local as Local Deploy Script
participant SCP as scp
participant SSH as ssh
participant Remote as Remote VM
rect rgba(200,200,255,0.5)
Local->>SCP: transfer .env to /home/ubuntu/nemoclaw/.env
SCP-->>Remote: write file
end
rect rgba(200,255,200,0.5)
Local->>SSH: run "chmod 600 /home/ubuntu/nemoclaw/.env"
SSH-->>Remote: change file permissions
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
d08cf0e to
9aa83b4
Compare
|
@cv hey successfully rebased.check it out when you have time |
|
@drobison00 thanks |
|
Not a duplicate of #186 (merged). #186 adds `chmod 600 .env` inside the sandbox during startup. This PR adds it on the remote host after SCP during `deploy()`. Different locations protecting different files. The deploy function has been restructured in #691 (SSH TOFU) — you'll need to rebase. The fix itself is a valid one-liner that #691 doesn't include. |
9aa83b4 to
748665e
Compare
|
@cv have rebased, pls take a look |
Rationale
The
.envfile on the remote deployment target could be uploaded with insecure default permissions, exposing secrets.Changes
Added a post-deployment step to explicitly enforce 600 permissions on the remote
.envfile.Verification Results
npm test..envpermissions after deployment.Leading Standards
This PR follows the project's 'First Principles' approach, prioritizing deterministic behavior and zero-trust security defaults.
Summary by CodeRabbit