-
Notifications
You must be signed in to change notification settings - Fork 102
Validate external files #1426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: external-file-mgmt-integration
Are you sure you want to change the base?
Validate external files #1426
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## external-file-mgmt-integration #1426 +/- ##
=================================================================
Coverage ? 86.29%
=================================================================
Files ? 102
Lines ? 12846
Branches ? 0
=================================================================
Hits ? 11086
Misses ? 1272
Partials ? 488
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
e50d100 to
2e981e0
Compare
I am validating the external files through a two-stage validation process performed immediately after a file is downloaded to a temp(or a secured folder), before moving to the actual file path.
Stage 1 uses MIME-type sniffing to reject any file content identified as an executable binary (e.g., ELF), regardless of its file extension.
Stage 2 is where the Agent uses the file's intended extension (e.g., .conf, .pem, .yaml) to determine its expected format using the filename received in the file meta and then validates that the content is structurally correct for that role (e.g., ensuring a .yaml file is plain text, or a .pem file contains the required -----BEGIN header). This ensures the files are both non-malicious and correctly formatted for NGINX.
Checklist
Before creating a PR, run through this checklist and mark each as complete.
CONTRIBUTINGdocumentmake install-toolsand have attached any dependency changes to this pull requestREADME.md)