Skip to content

Commit

Permalink
fix os usage case
Browse files Browse the repository at this point in the history
  • Loading branch information
sobregosodd committed Oct 28, 2024
1 parent 8bb9532 commit d2e5640
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions guarddog/analyzer/sourcecode/npm-exfiltrate-sensitive-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ rules:
- patterns:
- pattern-either:
- pattern: process.env

- patterns:
- pattern-either: # after defining fs
- pattern-inside: |
$OS = require('os')
...
- pattern-either:
# match use of ootb functions
- pattern: $OS. ... .homedir()
- pattern: $OS. ... .hostname()
- pattern: $OS. ... .userInfo()


- patterns:
- pattern-either: # after defining fs
- pattern-inside: |
Expand All @@ -31,11 +44,6 @@ rules:
import $FS from 'fs/promises'
...
- pattern-either:
# match use of ootb functions
- pattern: $FS. ... .homedir()
- pattern: $FS. ... .hostname()
- pattern: $FS. ... .userInfo()

# match access to sensitive files
- patterns:
- pattern-either:
Expand Down

0 comments on commit d2e5640

Please sign in to comment.