Skip to content
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

feat: add javascript rule for google tag manager #554

Merged
merged 2 commits into from
Feb 13, 2023

Conversation

vjerci
Copy link
Contributor

@vjerci vjerci commented Feb 10, 2023

Description

Most of web frontend leaks to third parties in large corporations is done trough google tag manager which then passes it on third party or an analytics tool.

This pr adds a rule which detects sending sensitive data to gtm's dataLayer. Which is a strong signal for potential abuse.

Rule patterns:

patterns:
  - pattern: |
      dataLayer.push($<DATA_TYPE>)
    filters:
      - variable: DATA_TYPE
        detection: datatype
  - pattern: |
      window.dataLayer.push($<DATA_TYPE>)
    filters:
      - variable: DATA_TYPE
        detection: datatype

Related

Checklist

  • I've added test coverage that shows my fix or feature works as expected.
  • I've updated or added documentation if required.
  • I've included usage information in the description if CLI behavior was updated or added.
  • PR title follows Conventional Commits format

@vjerci vjerci marked this pull request as ready for review February 10, 2023 17:43
@vjerci vjerci merged commit bb06b74 into main Feb 13, 2023
@vjerci vjerci deleted the feat/google-tag-manager branch February 13, 2023 10:59
@vjerci vjerci mentioned this pull request Feb 13, 2023
32 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants