Giter Site home page Giter Site logo

pbnj / mitigating-malicious-packages Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 4 KB

๐Ÿ—’๏ธ Researching & exploring how to mitigate malicious 3rd-party packages (e.g. npm, pip, rubygems ...etc)

License: MIT License

Shell 100.00%
strace containers software-supply-chain security docker

mitigating-malicious-packages's Introduction

Mitigating Malicious Packages

Table of Contents

The Problem

I've been interested in software supply chain security for some time now. This is the very early beginnings of my research in this space.

Some researchers have discovered and demonstrated how malicious 3rd party packages can be snuck in by different means.

For example, a bunch of NPM packages were removed from the pubic registry by the author, which caused software builds across the world to fail. But, the problem didn't end here. Some opportunistic malicious actors published modified versions of these packages with identical names. When downloaded by developers, these malicious packages would execute code controlled by the attackers, such as exfiltrate data, run coin miners, create backdoored channels with C&C server, or even rm -rf /

See my blog article on this for more details.

A Potential Solution

Overview

  • Detonate untrusted package/code in a container
  • Collect all syscall activities (e.g. read, write, network connections ...etc) inside the container
  • Analyze data for suspicious or undesired behavior
  • Ultimately, production software running inside containers can be limited to only perform what it is allowed to perform via seccomp, apparmor, or SE-Linux profiles

Details

  1. Build docker image: docker build -t node-tracer:latest -f Dockerfile.node .
  2. Run docker container: docker run --rm -v $PWD/strace:/strace node-tracer:latest -f -o node-tracer.strace npm install -g petermbenjamin
  3. Examine content of strace file

mitigating-malicious-packages's People

Contributors

pbnj avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

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.