Skip to content

Commit

Permalink
Merge pull request #233 from Privado-Inc/dev
Browse files Browse the repository at this point in the history
Javascript rule enhancement 1 (#232)
  • Loading branch information
pandurangpatil authored May 3, 2023
2 parents 26ec1df + 1466b05 commit afb47ca
Show file tree
Hide file tree
Showing 60 changed files with 319 additions and 659 deletions.
20 changes: 20 additions & 0 deletions config/exclusions/javascript.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
exclusions:
- id: Exclusions.Test
name: Exclude test source code
patterns:
- "(.*/(test|spec)(s)?.*)|/Test[A-Z]|Test[.]"

- id: Exclusions.JavaScript.Packages
name: Exclude External JavaScript Packages
patterns:
- "(node_modules)/.*"

- id: Exclusions.JavaScript.MinifiedFiles
name: Exclude External JavaScript MinifiedFiles
patterns:
- ".*[.]min[.]js"

- id: Exclusions.Empty
name: Exclude file which cannot be read
patterns:
- "<empty>|<unknownFullName>"
16 changes: 16 additions & 0 deletions config/sinkSkipList/javascript.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
sinkSkipList:
- id: SinkSkipList.ThirdParties
name: Skip Third Party Sinks
patterns:
- "(HTMLAnchorElement|HTMLIFrameElement|HTMLElement).*"
- "<operator>\\..*"
- "JSON\\..*"
- "Date.*"
- "this.*"
- "__Runtime\\..*"
- "(?i)(Window|__ecma\\.|Document).*"

- id: SinkSkipList.BuiltInLib
name: Skip built in language libraries
patterns:
- "(?i)(bunyan|winston|moment|axios|gulp-|webpack-).*"
34 changes: 29 additions & 5 deletions rules/sinks/leakages/logs/javascript.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,37 @@
sinks:

- id: Leakages.Log.Error
name: Log Error
patterns:
- "(?i).*(?:console|logger|bunyan|winston|log4js|pino).*(?:error|severe|fatal)|process.stderr.*write"
tags:

- id: Leakages.Log.Warn
name: Log Warn
patterns:
- "(?i).*(?:console|logger|bunyan|winston|log4js|pino).*(warn|warning)"
tags:

- id: Leakages.Log.Debug
name: Log Debug
patterns:
- "(?i).*(?:console|logger|bunyan|winston|log4js|pino).*(debug|trace)|.*debuglog.*"
tags:

- id: Leakages.Log.Info
name: Log Info
patterns:
- "(?i).*(?:console|logger|bunyan|winston|log4js|pino).*(info)"
tags:

- id: Leakages.Log.Console
name: Log Console
patterns:
- "console.(?:log|error|info|warn|debug)"
- "(?i).*(?:console|logger|bunyan|winston|log4js|pino).*(log)|process.stdout.*write"
tags:

- id: Leakages.Log.Log4js
name: Log4js
- id: Leakages.Log.Exception
name: Log Exception
patterns:
- "log4js.(?:error|info|warn|debug)"
tags:
- "(?i).*(?:logger|bunyan|winston|log4js|pino).*(exception)"
tags:
2 changes: 1 addition & 1 deletion rules/sinks/third_parties/sdk/abtasty/javascript.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ sinks:
domains:
- "abtasty.com"
patterns:
- "@abtasty\\/countdown|@abtasty\\/google-form-modal|@abtasty\\/scratchcard|@abtasty\\/popin-image|@abtasty\\/scroll-tracking|@abtasty\\/snowflakes|@abtasty\\/tooltip|@abtasty\\/promotional-banner|@flagship.io\\/react-sdk|@flagship.io\\/js-sdk|vue-abtasty|@abtasty\\/widget-utils|@abtasty\\/pulsar-common-ui|@abtasty\\/widget-form-generator|@abtasty-innovation\\/module-injector|@abtasty\\/editor-ui|@abtasty-innovation\\/module-wrapper|@abtasty\\/editor-translations|@abtasty\\/nps|@abtasty\\/social-proof|@abtasty\\/banner|@abtasty\\/element-visibility|@abtasty\\/modal|@abtasty\\/time-spent-on-page|@abtasty\\/sharing-sidebar|@abtasty\\/search-and-replace|@abtasty\\/before-after-image|@abtasty\\/popin-simple|@abtasty\\/christmas-hat|@abtasty\\/progress-bar|@abtasty\\/olark|@abtasty\\/celebrate|@abtasty\\/interstitiel|@abtasty\\/popin-video|@abtasty\\/stick-on-scroll|@abtasty\\/product-image-optimization|@abtasty-innovation\\/abtasty-api|@abtasty\\/widget-quality|@abtasty\\/socialproof|@abtasty\\/weather|@abtasty\\/zopim|@abtasty-innovation\\/cb-tag|@abtasty\\/cognitivediscountmaker|@abtasty\\/antvoice|@abtasty\\/polyfill|@abtasty\\/legal-information-banner|@abtasty-innovation\\/marketside-engine|@abtasty\\/widget-example-alpaca"
- "@abtasty\\/countdown|@abtasty\\/scratchcard|@abtasty\\/popin-image|@abtasty\\/scroll-tracking|@abtasty\\/snowflakes|@abtasty\\/tooltip|@abtasty\\/promotional-banner|@flagship.io\\/react-sdk|@flagship.io\\/js-sdk|vue-abtasty|@abtasty\\/widget-utils|@abtasty\\/pulsar-common-ui|@abtasty\\/widget-form-generator|@abtasty-innovation\\/module-injector|@abtasty\\/editor-ui|@abtasty-innovation\\/module-wrapper|@abtasty\\/editor-translations|@abtasty\\/nps|@abtasty\\/social-proof|@abtasty\\/banner|@abtasty\\/element-visibility|@abtasty\\/modal|@abtasty\\/time-spent-on-page|@abtasty\\/sharing-sidebar|@abtasty\\/search-and-replace|@abtasty\\/before-after-image|@abtasty\\/popin-simple|@abtasty\\/christmas-hat|@abtasty\\/progress-bar|@abtasty\\/olark|@abtasty\\/celebrate|@abtasty\\/interstitiel|@abtasty\\/popin-video|@abtasty\\/stick-on-scroll|@abtasty\\/product-image-optimization|@abtasty-innovation\\/abtasty-api|@abtasty\\/widget-quality|@abtasty\\/socialproof|@abtasty\\/weather|@abtasty\\/zopim|@abtasty-innovation\\/cb-tag|@abtasty\\/cognitivediscountmaker|@abtasty\\/antvoice|@abtasty\\/polyfill|@abtasty\\/legal-information-banner|@abtasty-innovation\\/marketside-engine|@abtasty\\/widget-example-alpaca"
tags:
2 changes: 1 addition & 1 deletion rules/sinks/third_parties/sdk/acumatica/javascript.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ sinks:
domains:
- "acumatica.com"
patterns:
- "@acumatica\\/jiraapi"
- "acumsrc"
tags:
13 changes: 0 additions & 13 deletions rules/sinks/third_parties/sdk/ajnasz/javascript.yaml

This file was deleted.

84 changes: 81 additions & 3 deletions rules/sinks/third_parties/sdk/amazon/javascript.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion rules/sinks/third_parties/sdk/amplitude/javascript.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ sinks:
domains:
- "amplitude.com"
patterns:
- "amplitude-js|react-amplitude-hooks|amplitude|amplitude-viewer|read-audio|react-native-amplitude-analytics|@analytics\\/amplitude|@itly\\/plugin-amplitude-node|vue-amplitude|@segment\\/analytics.js-integration-amplitude|gatsby-plugin-amplitude-analytics|@amplitude\\/react-amplitude|vue-amplitude-js|react-amplitude|gatsby-plugin-amplitude|@mntm\\/stats|@uptechworks\\/analytics-service-angular|@suttj\\/amplitude-js|@csod-oss\\/tracker-vendor-amplitude|node-amplitude|@rudderstack\\/rudder-integration-amplitude-react-native|@shawacademynpm\\/gatsby-plugin-amplitude-analytics|djipav|react-native-amplitude-sdk|@jtran\\/amplitude-js|@exiasr\\/gatsby-plugin-amplitude-analytics|amplitude-vue|@quintoandar\\/storybook-amplitude|@amplitude\\/analytics-connector"
- "@amplitude/analytics-browser|react-amplitude-hooks|amplitude|read-audio|react-native-amplitude-analytics|@analytics\\/amplitude|@itly\\/plugin-amplitude-node|vue-amplitude|@segment\\/analytics.js-integration-amplitude|gatsby-plugin-amplitude-analytics|@amplitude\\/react-amplitude|vue-amplitude-js|react-amplitude|gatsby-plugin-amplitude|@mntm\\/stats|@uptechworks\\/analytics-service-angular|@suttj\\/amplitude-js|@csod-oss\\/tracker-vendor-amplitude|node-amplitude|@rudderstack\\/rudder-integration-amplitude-react-native|@shawacademynpm\\/gatsby-plugin-amplitude-analytics|djipav|react-native-amplitude-sdk|@jtran\\/amplitude-js|@exiasr\\/gatsby-plugin-amplitude-analytics|amplitude-vue|@quintoandar\\/storybook-amplitude|@amplitude\\/analytics-connector"
tags:
13 changes: 0 additions & 13 deletions rules/sinks/third_parties/sdk/amykron/javascript.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions rules/sinks/third_parties/sdk/aplynk/javascript.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion rules/sinks/third_parties/sdk/apple/javascript.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ sinks:
domains:
- "apple.com"
patterns:
- "node-apple-receipt-verify"
- "node-apple-receipt-verify|app-store-validator"
tags:
13 changes: 0 additions & 13 deletions rules/sinks/third_parties/sdk/asche/javascript.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions rules/sinks/third_parties/sdk/asimetriq/javascript.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions rules/sinks/third_parties/sdk/asmagin/javascript.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions rules/sinks/third_parties/sdk/asti-usa/javascript.yaml

This file was deleted.

20 changes: 20 additions & 0 deletions rules/sinks/third_parties/sdk/atlassian/javascript.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,23 @@ sinks:
patterns:
- "@atlassian\\/johnson"
tags:

- id: ThirdParties.SDK.Atlassian.Jira
name: Atlassian Jira
domains:
- "atlassian.com/software/jira"
patterns:
- "jira.js|create-jira-release-notes|jira-activity|jira-term|@cn-shell\\/jira|jira-linkify|jira-wrapper|jira-track|jirascope|jira-miner"
- "@acumatica\\/jiraapi|@itentialopensource\\/adapter-jira|cz-jira-smart-commit-clone"
- "@roadiehq\\/backstage-plugin-jira|@devx\\/plugin-jira-backend|coc-jira-complete|alfred-jira-search"
- "hubot-jira|hubot-jira-connector|hubot-jira-issue-helper|hubot-jira-lotto"
- "(huyhq-|@vmo11\\/)cz-jira-smart-commit"
tags:

- id: ThirdParties.SDK.Atlassian.BitbucketServer
name: Atlassian Bitbucket Server
domains:
- "bitbucket.org"
patterns:
- "bitbucket|netlify-cms-backend-bitbucket"
tags:
13 changes: 0 additions & 13 deletions rules/sinks/third_parties/sdk/attackofzach/javascript.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions rules/sinks/third_parties/sdk/berglind/javascript.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions rules/sinks/third_parties/sdk/berkeley/javascript.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions rules/sinks/third_parties/sdk/bespokeview/javascript.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions rules/sinks/third_parties/sdk/bibabo/javascript.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions rules/sinks/third_parties/sdk/bitbucket/javascript.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions rules/sinks/third_parties/sdk/blackeyetech/javascript.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions rules/sinks/third_parties/sdk/blueskylabs/javascript.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions rules/sinks/third_parties/sdk/brianneisler/javascript.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions rules/sinks/third_parties/sdk/bryangrim/javascript.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions rules/sinks/third_parties/sdk/budick/javascript.yaml

This file was deleted.

13 changes: 0 additions & 13 deletions rules/sinks/third_parties/sdk/chatous/javascript.yaml

This file was deleted.

Loading

0 comments on commit afb47ca

Please sign in to comment.