Repository navigation
feat(archiver): validate deployment archives before extraction - #1619
Soner (shyim) wants to merge 4 commits into
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughAdds ChangesTar archive validation
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue remains; the archive validation change is ready for normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The validator adds checks for unsafe archives, but it is not yet connected to a deployment extraction path shown in this revision. No new runtime exposure is established; protection at extraction remains unverified. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1619 +/- ##
==========================================
+ Coverage 65.11% 65.18% +0.07%
==========================================
Files 479 480 +1
Lines 31643 31711 +68
==========================================
+ Hits 20604 20672 +68
Misses 11039 11039
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Skip PAX global headers, which git archive emits as metadata. Allow symlinks whose targets are absent from the archive (e.g. excluded by WriteTarGz) as long as they stay inside the archive root. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| // ValidateTarGz checks an archive before extracting it on a deployment host. | ||
| // Only regular files, directories, and relative symlinks that stay inside the | ||
| // archive root are allowed. Symlink targets may be missing, e.g. excluded paths. | ||
| // It consumes the gzip stream, including its checksum, without extracting files. | ||
| func ValidateTarGz(ctx context.Context, r io.Reader) (err error) { |
There was a problem hiding this comment.
Why?
Archive validation for deployment epic. No there is no proper go lib out who would handle this
Is there really a need for this? E.g. where are these broken archives coming from in the first place? And wouldn't it be enough to just error while extracting (e.g. following "parse, don't validate" principle).
I'm trying to understand the background and underlying issue we want to solve here. Another idea could also be that we somehow "sign" or "checksum" the archives we generated and only accept those to make sure nobody messed with them 🤔
There was a problem hiding this comment.
valid 🤔 lets keep it out for simplicity 🤔
What changed?
Added tar.gz validation for paths, entry types, permissions, symlinks and gzip integrity, with tests.
Why?
Archive validation for deployment epic. No there is no proper go lib out who would handle this
How was this tested?
unit tests
Related issue or discussion
Split from #1573.
Summary by CodeRabbit