-
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
Validate external files #1426
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## external-file-mgmt-integration #1426 +/- ##
==================================================================
- Coverage 86.31% 86.29% -0.02%
==================================================================
Files 102 102
Lines 12603 12846 +243
==================================================================
+ Hits 10878 11086 +208
- Misses 1249 1272 +23
- Partials 476 488 +12
... and 6 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
e50d100 to
2e981e0
Compare
|
This was a part of POC. |
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)