Git Product home page Git Product logo

bundlewrap-firewalld's Introduction

bundlewrap-firewalld

bundlewrap-firewalld installs firewalld. It provides an action to reload firewalld after changes to other bundles. Additionally it's possible to open custom ports.

Requirements

(!) Make sure you have access to a remote console in case firewalld denies your access to the system.

Metadata

'metadata': {
    'firewalld': { 
        'default_zone': 'internal', # optional, add all interfaces to this zone
        'custom_zones': True, # optional, add each interface to the specified zone
        'ports': [ # optional, add custom ports which will be opened
            "321/tcp",
            "456/udp",
        ],
    },
    'interfaces': { # required, to set a default-zone and for other actions
        'eth0': {
            'ip_address': '172.16.16.42',
            'firewalld_zone': 'public', # required if `custom_zones` is set to True.
        },
        'tun0': {
            'ip_address': '10.10.10.42',
            'firewalld_zone': 'internal', # required if `custom_zones` is set to True.
        },
    },
}

Example Metdata

Set a default interface for all interfaces

'metadata': {
    'firewalld': { 
        'default_zone': 'internal',
    },
    'interfaces': {
        'eth0': {},
        'tun0': {},
    },
}

Set custom zones for each interface

'metadata': {
    'firewalld': { 
        'custom_zones': True,
    },
    'interfaces': {
        'eth0': {
            'firewalld_zone': 'public',
        },
        'tun0': {
            'firewalld_zone': 'internal',
        },
    },
}

Notes

Adding custom ports

Custom Ports are added either to your default_zone, to all custom_zones or, if none of the options before is set, to the public zone, which is the default zone on Fedora.

Known issues

Changing the zone of an interface will always end up with an error from bw, e.g.:

✘ bw-test-fedora  firewalld  action:firewalld_set_custom_zone_ens37 failed

firewaldd_cmd displays a warning when setting up the zone and therefores exits with status 254 instead of 0:

┌ root@bw-test-fedora /root
└ # firewall-cmd --permanent --zone=public --add-interface=ens37
The interface is under control of NetworkManager, setting zone to 'public'.
┌ root@bw-test-fedora /root
└ # echo $status
254

A second run of bq apply will show that the zone has been set correctly. In case you want to check manually just run firewall-cmd --list-interfaces --zone=<zone>

bundlewrap-firewalld's People

Contributors

stillbeben avatar

Watchers

 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.