Validate external files#1426
Closed
Akshay2191 wants to merge 17 commits intoexternal-file-mgmt-integrationfrom
Closed
Validate external files#1426Akshay2191 wants to merge 17 commits intoexternal-file-mgmt-integrationfrom
Akshay2191 wants to merge 17 commits intoexternal-file-mgmt-integrationfrom
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
Contributor
Author
|
This was a part of POC. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)