Git Product home page Git Product logo

network-namespace-wrapper's Introduction

Network Namespace Wrapper

This is a simple C application that will allow you to launch any binary in a specified network namespace. It is intended to be used to allow an unprivileged user to run a specified application in a specified network namespace.

Compilation/Installation

This application takes arguments at compile-time. You must set the define variables for NAMESPACE and BINARY. NAMESPACE is a string of the name of your network namespace, as reported by ip netns. BINARY is a string of the path to the binary you want to run in a separate namespace.

The installation of this will require the binary be owned by root with the sticky bit. This allows the application elevated permissions, to switch to the namespace, then it immediately drops back to user permissions.

An example to compile this and install this is shown below.

gcc -D 'NAMESPACE="my_namespace"' -D 'BINARY="/usr/bin/bash"' -o bash-wrapped main.c
install -m 4755 -o 0 -g 0 bash-wrapped /usr/local/bin/bash-wrapped

Security

Use this at your own risk, and if you are concerned about a security issue, please audit the source code yourself and report any bugs.

The application you run has no restricted permissions compared to any other applications on the system, except the network namespace it is in. This means the application may launch other applications within the network namespace. You should not make the assumption that the application run in the namespace is the only application able to run in the namespace.

network-namespace-wrapper's People

Contributors

milesbreslin 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.