Giter Site home page Giter Site logo

joshlarsen / driftbot Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 1.0 69 KB

A simple web app software supply chain monitoring toolkit

Home Page: https://driftbot.io

License: MIT License

JavaScript 100.00%
software-supply-chain magecart crypto-mining security appsec formjacking

driftbot's Introduction

A simple web app software supply chain monitoring toolkit.

Goals

To provide a simple way for website/webapp owners to monitor their sites for unexpected changes in software supply chain profile (a.k.a. drift).

To use automation to detect things like:

  • changes to sources where JavaScript files are loaded from (script hosts)
  • changes to XHR/ajax request sources (xhr hosts)
  • changes to WebSocket connection sources (websocket hosts)
  • changes to WebWorker connection sources (webworker hosts)
  • unseen JavaScript files that use heavy obfuscation - like hex, unicode, or escaping (obfuscation hosts)
  • unseen JavaScript files that use suspicious function calls like eval, atob, and btoa

How it works

Driftbot uses Puppeteer to drive a headless Chrome browser that interacts with your site like a real user would. It records and analyzes every JavaScript file and remote connection initiated by your site. Assuming your site isn't already compromised, monitoring for changes to this baseline can alert you that something (e.g. third-party package) has been exploited and needs further investigation.

Setup

To run Driftbot on your site(s), you'll need to clone this repo and configure your site's URL. See the full setup guide at https://driftbot.io/howto.

Development

Prerequisites:

  • Node.js 14+
  • Docker

If you'd like to test locally, make sure the headless browser container is running:

$ docker-compose up

In another terminal, create an empty authorized_hosts.json file.

$ cp authorized_hosts.json.sample authorized_hosts.json

Then run the bot to test output:

$ SITE_URL=https://mysite.com node driftbot.js

Note that no GitHub Issues are created when running locally.

Kudos

Driftbot is a simple project, due in large part to the amazing work by the authors of these projects:

driftbot's People

Contributors

joshlarsen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

daveyshmave

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.