-
Notifications
You must be signed in to change notification settings - Fork 71
Add extensions ecosystem support for Guarddog #589
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
64d915d
Add extensions ecosystem support for Guarddog
tesnim5hamdouni 4bce5bd
fix type-check and formatting-induced errors
tesnim5hamdouni 8e2cd4a
Remove metadata rules for now, default yara rules to all ecosystems, …
tesnim5hamdouni 2564a61
nits ...
tesnim5hamdouni 1fdda88
nits ...
tesnim5hamdouni 54b72e3
implement requested changes
tesnim5hamdouni e39c0ec
remove credits in yara rules| remove DTO structures in extension_scanner
tesnim5hamdouni 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
12 changes: 12 additions & 0 deletions
12
guarddog/analyzer/sourcecode/extension_powershell_policy_bypass.yar
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,12 @@ | ||
| rule DETECT_FILE_powershell_policy_bypass | ||
| { | ||
| meta: | ||
| author = "T HAMDOUNI, Datadog" | ||
| description = "Detects suspicious read access to /etc/passwd file, which is often targeted by malware for credential harvesting" | ||
|
|
||
| strings: | ||
| $cli = /(cat|less|more|head|tail)\s+.{0,100}\/etc\/passwd/ nocase | ||
| $read = /(readFile|readFileSync)\(\s*['"]\/etc\/passwd/ nocase | ||
| condition: | ||
| $cli or $read | ||
| } |
12 changes: 12 additions & 0 deletions
12
guarddog/analyzer/sourcecode/extension_suspicious_passwd_access_linux.yar
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,12 @@ | ||
| rule DETECT_FILE_suspicious_passwd_access_linux | ||
| { | ||
| meta: | ||
| author = "T HAMDOUNI, Datadog" | ||
| description = "Detects suspicious read access to /etc/passwd file, which is often targeted by malware for credential harvesting" | ||
|
|
||
| strings: | ||
| $cli = /(cat|less|more|head|tail)\s+.{0,100}\/etc\/passwd/ nocase | ||
| $read = /(readFile|readFileSync)\(\s*['"]\/etc\/passwd/ nocase | ||
| condition: | ||
| $cli or $read | ||
| } |
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 |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |
| from .go_package_scanner import GoModuleScanner | ||
| from .go_project_scanner import GoDependenciesScanner | ||
| from .github_action_scanner import GithubActionScanner | ||
| from .extension_scanner import ExtensionScanner | ||
| from .scanner import PackageScanner, ProjectScanner | ||
| from ..ecosystems import ECOSYSTEM | ||
|
|
||
|
|
@@ -33,6 +34,8 @@ def get_package_scanner(ecosystem: ECOSYSTEM) -> Optional[PackageScanner]: | |
| return GoModuleScanner() | ||
| case ECOSYSTEM.GITHUB_ACTION: | ||
| return GithubActionScanner() | ||
| case ECOSYSTEM.EXTENSION: | ||
| return ExtensionScanner() | ||
| return None | ||
|
|
||
|
|
||
|
|
@@ -57,4 +60,6 @@ def get_project_scanner(ecosystem: ECOSYSTEM) -> Optional[ProjectScanner]: | |
| return GoDependenciesScanner() | ||
| case ECOSYSTEM.GITHUB_ACTION: | ||
| return GitHubActionDependencyScanner() | ||
| case ECOSYSTEM.EXTENSION: | ||
| return None # we're not including dependency scanning for this PR | ||
|
Comment on lines
+63
to
+64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was this suggested by the lint? is adding no value |
||
| return None | ||
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.