RexOps / RexOps/Rex

Expand iptables module

Open
#1,109 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Perl
Stars
737
Forks
214
PR merge metrics
No merged PRs in 30d

Description

So I have these commands I want to use with Rex iptables:

# /sbin/iptables -A INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m recent --set
# /sbin/iptables -A INPUT -p tcp --dport 80 -i eth0 -m state --state NEW -m recent --update --seconds 60  --hitcount 15 -j DROP

The problem I run into is with the -m <match> [match options]. So I would need to create an arrayref for the match arg

m => [['state', '--state NEW'],['recent', '--update --seconds 60  --hitcount 15']]

This is an example me and @ferki talked about but maybe there is an easier solution? Otherwise I think the stance would be if you need something more advanced then to write a custom module to handle that use case.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading Rex's iptables module and its current handling of match arguments. Compare the requested state and recent match clauses with the existing API, then clarify whether arrayref support is the intended solution or whether advanced rules should use a custom module; done means the requested commands can be represented consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
devops, networking
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.