fix(security): use secure temp paths in tests - #4976
Conversation
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
E2E Advisor RecommendationRequired E2E: Dispatch hint: Auto-dispatched E2E: Full advisor summaryE2E Recommendation AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
E2E Scenario Advisor RecommendationRequired scenario E2E: None Full scenario advisor summaryE2E Scenario AdvisorBase: Required scenario E2E
Optional scenario E2E
Relevant changed files
|
PR Review AdvisorFindings: 1 needs attention, 2 worth checking, 0 nice ideas Review findings🛠️ Needs attention
🔎 Worth checking
🌱 Nice ideas
Consider writing more tests for
This is an automated advisory review. A human maintainer must make the final merge decision. |
Selective E2E Results — ✅ All requested jobs passedRun: 27159307321
|
|
Follow-up for the review advisor feedback is open in #4980. It restores the production tunnel PID directory default to the existing /tmp contract and keeps the test isolation via an explicit private pidDir. |
## Summary Restores the tunnel service PID directory default to `/tmp/nemoclaw-services-<sandbox>` so the TypeScript service, legacy scripts, doctor, destroy, snapshot, and uninstall cleanup paths keep a single source of truth. This addresses the PR review advisor feedback on #4976 while preserving the secure private temp-directory test fixture. ## Changes - Revert the production tunnel PID directory resolver from `os.tmpdir()` back to the existing `/tmp/nemoclaw-services-<sandbox>` contract. - Keep the sandbox-channel test isolated by passing an explicit private `pidDir` created under `mkdtempSync`. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Verification - [x] `npx prek run --all-files` passes - [x] `npm test` passes - [x] Tests added or updated for new or changed behavior - [x] No secrets, API keys, or credentials committed - [ ] Docs updated for user-facing behavior changes - [ ] `npm run docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Updated default PID directory path handling for consistency. * **Tests** * Enhanced integration tests to validate PID cleanup behavior with explicit directory parameters. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Summary
Use private
mkdtempSyncroots for test artifacts that previously wrote predictable files under the OS temp directory. This clears the open CodeQLjs/insecure-temporary-filefindings while keeping the behavior-focused test coverage intact.Changes
os.tmpdir()for the tunnel service default PID root so tests can bind it to a private temp directory.mkdtempSyncdirectories.mkdtempSyncdirectories.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesnpm run docsbuilds without warnings (doc changes only)Signed-off-by: Carlos Villela cvillela@nvidia.com