Skip to content

firewall-port check reports the inverse of reality #6073

@0byt3

Description

@0byt3

Here is the behaviour I am seeing with /etc/xapi.d/plugins/firewall-port:
Screenshot from 2024-10-22 08-02-03

The change that would work.

    check)
        if [[ -z `iptables -S $CHAIN | grep " $PORT "` ]]
        then
            echo "Port $PORT open: true"
        else
            echo "Port $PORT open: false"
        fi
        ;;

to

    check)
        if [[ -z `iptables -n -v -S $CHAIN | grep " $PORT "` ]]
        then
            echo "Port $PORT open: true"
        else
            echo "Port $PORT open: false"
        fi
        ;;

If I knew how to do a git pull request and all that I'd do it, however I do not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions