Git Product home page Git Product logo

macvlan-experiments's Introduction

macvlan-experiments

Playing with a fork of balena-engine with macvlan driver set

Warning: this won't work on current balena-engine or balenaos

This exploration is twofold:

  • confirm that a container can be attached to a macvlan (or ipvlan) and a bridge network at the same time
  • confirm we can manipulate the network stack (and especially the fw) of a macvlan container from another (properly privileged) container

This project will:

  • setup a bridge network with default configuration: my_bridge
  • setup a macvlan network on 10.0.10.0/24 vlan10: my_macvlan
  • starts balena-hello-world:
    • helloworld nodejs application serving a webpage on port 80 and 8080
    • attached to both my_macvlan and my_bridge networks
  • starts balena-hello-controls:
    • privileges container with procfs and balena-socket labels
    • no network
    • runs a script at start to :
      • find the PID of balena-hello-world
      • enter the network namespace of balena-hello-world using it's PID
      • find which network interface is on the 10.0.10.0 network
      • set iptablest to ALLOW port 8080 on that interface and DROP everything else

Here's the tests performed on the setup and which confirms hypothesis:

  • connect from another vlan to the container address (i.e. 10.0.0.3) on port 80 -> denied
  • connect from another vlan to the container address (i.e. 10.0.0.3) on port 8080 -> denied
  • connect from vlan10 to the container address (i.e. 10.0.0.3) on port 80 -> denied
  • connect from vlan10 to the container address (i.e. 10.0.0.3) on port 8080 -> allowed
  • connect from the same network as the host to the host address (i.e. 192.168.1.101) on port 8080 -> allowed
  • connect from the same network as the host to the host address (i.e. 192.168.1.101) on port 80 -> allowed
  • connect from the internet using balena-cloud public_url -> allowed

macvlan-experiments's People

Contributors

aethernet avatar

Watchers

 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.