-
Notifications
You must be signed in to change notification settings - Fork 3
Production Polish #16
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
Open
martindale
wants to merge
14
commits into
master
Choose a base branch
from
feature/rsi
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
dcf8fb4
Block spam to document conversion
martindale 361a750
Use latest Fabric
martindale d235f3e
Use latest Fabric
martindale 2658e18
Update Codacy rules
martindale fc99641
Use latest Fabric
martindale 0f221d9
Add missing work
martindale 250a178
Use latest Fabric
martindale 992ea47
Use latest Fabric
martindale ac506e2
Add new tests, use latest Fabric
martindale c12df87
Address memory bounding issue
martindale afa8394
Prepare for future release, use latest Fabric
martindale 72f2f22
Add debug telemetry, additional memory fixes
martindale 6bf825d
Add various startup scripts, cleanups
martindale 64e0403
Use latest Fabric, expand coverage
martindale File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| 'use strict'; | ||
|
|
||
| /** | ||
| * Detect OpenSSF / GHSA bulk malware advisories (e.g. `@zalastax/nolb-*`). | ||
| * Those dumps were ingested as Fabric documents and Internal messages until Hub OOM. | ||
| * @param {*} input metadata, JSON object, UTF-8 string, or Buffer | ||
| * @returns {boolean} | ||
| */ | ||
| function looksLikeBulkSecurityAdvisory (input) { | ||
| if (input == null) return false; | ||
| if (Buffer.isBuffer(input)) { | ||
| const n = Math.min(input.length, 8192); | ||
| return looksLikeBulkSecurityAdvisory(input.slice(0, n).toString('utf8')); | ||
| } | ||
| if (typeof input === 'string') { | ||
| const s = input.length > 16384 ? input.slice(0, 16384) : input; | ||
| if (/@zalastax\/nolb-/i.test(s)) return true; | ||
| if (/malicious code in @/i.test(s)) return true; | ||
| if (/"security_advisory"\s*:/.test(s) && ( | ||
| /GHSA-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}/i.test(s) || | ||
| /"type"\s*:\s*"malware"/i.test(s) | ||
| )) return true; | ||
| const trimmed = s.trim(); | ||
| if (trimmed.startsWith('{') || trimmed.startsWith('[')) { | ||
| try { | ||
| return looksLikeBulkSecurityAdvisory(JSON.parse(trimmed)); | ||
| } catch (_) { | ||
| return false; | ||
| } | ||
| } | ||
| return false; | ||
| } | ||
| if (typeof input !== 'object') return false; | ||
| if (input.security_advisory && typeof input.security_advisory === 'object') return true; | ||
| const summary = String(input.summary || input.title || input.name || ''); | ||
| if (input.ghsa_id && /malicious code in @/i.test(summary)) return true; | ||
| if (/@zalastax\/nolb-/i.test(summary) || /malicious code in @/i.test(summary)) return true; | ||
| const nested = input.object || input.content || input.advisory || input.payload; | ||
| if (nested && nested !== input && looksLikeBulkSecurityAdvisory(nested)) return true; | ||
| return false; | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| } | ||
|
|
||
| module.exports = { | ||
| looksLikeBulkSecurityAdvisory | ||
| }; | ||
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.