How to combine two actions in a single Jail in fail2ban

Discussion in 'HOWTO-Related Questions' started by Mikheil, Mar 19, 2024.

  1. Mikheil

    Mikheil New Member

    action - %(action_mw)s
    destemail = root@local host
    Works fine until I have another action statement such as"
    action = iptables-multiport[port = "http,https... ". protocol = tcp]

    I've searched everwhere, even on Perplexity to get the two actions in the same jail without an error. So far I've been unable to find a way to het fail2ban to send me an email if there is already an action in the jail. I've had at least 10 suggestions, but so far they ALL give me an error
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    man 5 jail.conf
    shows
    Code:
      Actions
           Each jail can be configured with only a single filter, but may have multiple actions. By default, the  name  of  a
           action is the action filename, and in the case of Python actions, the ".py" file extension is stripped. Where mul‐
           tiple of the same action are to be used, the actname option can be assigned to the  action  to  avoid  duplication
           e.g.:
    
           [ssh-iptables-ipset]
           enabled = true
           action = smtp.py[[email protected], actname=smtp-chris]
                    smtp.py[[email protected], actname=smtp-sally]
    
    
     
    till likes this.

Share This Page