test(security): prove KPI child environment is least-authority - #253
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughKPI 자식 프로세스 환경 생성을 ChangesKPI 자식 프로세스 환경 격리
Estimated code review effort: 3 (Moderate) | ~20 minutes Mergeability Score: ⚪ Minimal · up to The PR’s child-environment behavior change has no identified actionable merge-blocking risk in the supplied evidence and is merge-ready after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant KpiGate as kpi-gate.mjs
participant EnvironmentHelper as createKpiChildEnvironment
participant ChildProcess as KPI child process
KpiGate->>EnvironmentHelper: 단계 이름과 환경 전달
EnvironmentHelper-->>KpiGate: 허용된 단계별 환경 반환
KpiGate->>ChildProcess: 제한된 환경으로 자식 프로세스 실행
Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review Please review the current exact head only. Prior draft-skip status and predecessor evidence are non-passing and must not be reused. |
|
|
Purpose
Start issue #110 test-first from the surviving protected KPI lineage after #250 integrated and superseded moving predecessor #105. This Draft is intentionally RED: it proves the current KPI gate still forwards excessive ambient authority to its child scoring processes and defines the smallest reviewed environment contract before implementation.
Exact source identity
82d884d0415a83423d56fba9bac5262c3470a646;fix/kpi-child-env-isolation-current-main;e7faa4c98ce24149087e01cf8dacb25d8167c12f;Current defect / RCA
Protected
scripts/kpi-gate.mjsfirst buildsconst kpiChildEnvironment = { ...process.env }, removes only six selected keys, then overlays per-step values. That still forwardsHOME, proxy configuration, provider/Cloudflare variables, Maintainer/Reviewer App material, unrelatedNOEMA_*state, and any future ambient variable unless someone remembers to denylist it.The two child contracts are narrower:
kpi-checkrequires only the explicitly reviewedNOEMA_KPI_REQUIRE_WINDOW_DAYSstep input;kpi-alertsupports onlyNOEMA_ALERT_5M_FAILURE_RATE,NOEMA_ALERT_5M_P95_MS,NOEMA_ALERT_RATE_LIMIT_MINUTES, andNOEMA_ALERT_WORKFLOW_SPIKE_MULTIPLIERfrom ambient configuration.process.execPathis already the exact Node executable, so this child boundary does not require ambientPATHto preserve executable resolution.RED contract
The new regression uses only synthetic hostile values for GitHub/GH/Copilot tokens, NVIDIA/model credentials, Maintainer/Reviewer App material, Cloudflare/provider credentials, proxy values,
HOME,NODE_OPTIONS,NODE_PATH, unrelatedNOEMA_*, and supported KPI/alert inputs. It requires:createKpiChildEnvironmentcontract instead of copyingprocess.env;kpi-checkto receive only its explicit strict-window input;kpi-alertto receive only the four reviewed alert-threshold inputs;The helper and source integration deliberately do not exist on this RED head. Fresh CI is expected to fail specifically at this contract. A failure elsewhere is not accepted as RED proof.
Authority boundary
No production provenance/snapshot/evidence-retention logic is changed on this head. No workflow, gate, secret, reviewer, model, release, deployment, licensing, IP, or acquisition authority is altered or invented.
COPILOT_GITHUB_TOKENis not used.Before any GREEN write, refetch protected base, exact head/blobs, issue/writer state, reviews and current workflow evidence; then implement the smallest allowlist-based child environment and reacquire focused/full exact-head validation plus protected-base Security Scan.
Related: #3, #27, #29, #104, #105, #107, #109, #110
Summary by CodeRabbit
개선 사항
kpi-check와kpi-alert에 필요한 설정만 선별해 전달하며, 민감하거나 불필요한 환경 정보의 전달을 방지합니다.테스트