Skip to content

UFW rule log field being applied to from_service #696

@Monke69420haha

Description

@Monke69420haha

I've tested this from the jc ansible module as well as directly from the command line and get the same results.

The issue I am seeing is that when a rule has logging enabled it will populate the from_service field which I think is incorrect.

The version of UFW I am using is 0.36.2 and JC is 1.25.1 and 1.25.6 with Ansible.

ok: [jc-test] => {
    "msg": {
        "default": "allow (incoming), allow (outgoing), disabled (routed)",
        "logging": "on",
        "logging_level": "low",
        "new_profiles": "skip",
        "rules": [
            {
                "action": "ALLOW",
                "action_direction": "IN",
                "comment": "Allow HTTP from build server",
                "from_interface": "any",
                "from_ip": "1.2.3.4",
                "from_ip_prefix": 32,
                "from_service": "(log)",
                "from_transport": null,
                "index": null,
                "network_protocol": "ipv4",
                "to_interface": "any",
                "to_ip": "0.0.0.0",
                "to_ip_prefix": 0,
                "to_ports": [
                    80
                ],
                "to_service": null,
                "to_transport": "tcp"
            },
            {
                "action": "ALLOW",
                "action_direction": "IN",
                "comment": "Test rule",
                "from_interface": "any",
                "from_ip": "10.0.0.0",
                "from_ip_prefix": 8,
                "from_ports": [
                    4000
                ],
                "from_service": null,
                "from_transport": "udp",
                "index": null,
                "network_protocol": "ipv4",
                "to_interface": "any",
                "to_ip": "0.0.0.0",
                "to_ip_prefix": 0,
                "to_ports": [
                    123
                ],
                "to_service": null,
                "to_transport": "udp"
            },
            {
                "action": "ALLOW",
                "action_direction": "IN",
                "comment": "Allow SSH in from anywhere",
                "from_interface": "any",
                "from_ip": "0.0.0.0",
                "from_ip_prefix": 0,
                "from_port_ranges": [
                    {
                        "end": 65535,
                        "start": 0
                    }
                ],
                "from_service": null,
                "from_transport": "any",
                "index": null,
                "network_protocol": "ipv4",
                "to_interface": "any",
                "to_ip": "0.0.0.0",
                "to_ip_prefix": 0,
                "to_ports": [
                    22
                ],
                "to_service": null,
                "to_transport": "tcp"
            }
        ],
        "status": "active"
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions