Giter VIP home page Giter VIP logo

shorewall-formula's Issues

Dynamically generated params with mine

Hello,

We are actually happily using this formula, but we are facing a new need, to dynamically generate a parameter with the salt mine.

Our situation looks like:

  • a server S which provides a service on port P
  • a bunch of 'client' servers C, they need to access the service on S
  • C are tagged/identified/configured with a pillar UseService: True

If we want to maintain firewall of S to only open port P, we could use a pillar like this

shorewall:
  rules:
    NEW:
      - action: ACCEPT
      - source $S_CLIENTS
      - dest: $FW
      - proto: tcp
      - destport: P

But the param S_CLIENTS can only be specified statically with

shorewall:
  params:
    - key: S_CLIENTS
      value: 10.10.10.1,10.10.10.2,10.10.10.3

The only solution I see, would be to let shorewall:params manage (in addition to actual static values) mine queries. Something like what mysql-formula already implements. New pillar could look like

shorewall:
  params:
    - key: S_CLIENTS
      mine: 
        target: I@UseService
        function: <mine function to retrieve public IP>
        expr_form: compound

I already have some code to implement this idea (which still needs work before any PR), but I would like to know what users think about this idea.

shorewall 5 support

Time goes on, and so we get shorewall 5 on the way.

I wish to keep the formula both compatible with version 4 and 5, but the following applies:

  • obsolete configuration file:
    • 'tcrules' and 'tos' => 'mangle'
    • 'blacklist' => 'blrules'
    • 'routestopped' => 'stoppedrules'
    • 'notrack' => 'conntrack'
  • macros only with format-2 (probably not a big issue)
  • since shorewall 4.6 COMMENT, FORMAT and SECTION Lines now require the leading question mark ("?")

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.