Giter Club home page Giter Club logo

pam_network_namespace's Introduction

pam_network_namespace

A Linux PAM (Pluggable Authentication Module) that makes sessions run in their own network namespace.

A veth (Virtual Ethernet) bridge is created between the parent namespace and the new one. This means each user has their own ethernet adapter.

Cleanup of veth devices is automatic once there are no processes left using the network namespace

Building

Run make

Dependencies

pam_network_namespace's People

Contributors

daurnimator avatar ivan avatar kellerfuchs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

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

pam_network_namespace's Issues

Hashbang network design

Brain dump

  • Global IPv6 access (users get own address/prefix)
    • Need to turn on net.ipv6.conf.all.forwarding sysctl
    • Need to configure the network inside of user namespaces.
      • Can we use systemd.network?
      • Do we want to use DHCPv6?
      • We can do simple, static configuration, using the 32bit UID as a suffix in the server's /64 subnet.
  • Internal IPv4 network, for NATed IPv4 connectivity
    • Address allocation
      • Use UIDs as suffix for a large subnet?
        Imposes UID range restrictions, hard to extend or interconnect.
      • Do we want to use DHCP?
    • Need to NAT user traffic
  • Need to identify which user traffic is from?
    • For IPv6, can be done using the src/dst addresses
    • For IPv4, we need to either expose that info using identd, or drop identd support
    • When creating veth, give non-session side a MAC address ending in UID?
    • Need to filter each user's packets and only allow a 'dst' with their assigned ranges
  • What should setup iptables rules?
    For static rules, we already use ferm

Use named namespaces?

To make it a named netns:

  • mkdir("/var/run/netns", 0755) != EEXIST
  • mount("", "/var/run/netns", "none", MS_REC|MS_SHARED, NULL)
  • open("/var/run/netns/%s", O_RDONLY|O_CREAT|O_EXCL, 0) = 5
  • close(5)
  • mount("/proc/self/ns/net", "/var/run/netns/%s", "proc", MS_BIND, NULL)

Unfortunatly, I think this would lose us automatic cleanup

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.