all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Hannes Laimer <h.laimer@proxmox.com>
To: Proxmox VE development discussion <pve-devel@lists.proxmox.com>,
	Stefan Hanreich <s.hanreich@proxmox.com>
Subject: Re: [pve-devel] [PATCH proxmox-firewall 3/3] tests: add Ping macro to tests
Date: Thu, 13 Mar 2025 16:04:23 +0100	[thread overview]
Message-ID: <f7a37ee8-2975-445b-9999-c3a231500cf7@proxmox.com> (raw)
In-Reply-To: <20250204095733.55146-3-s.hanreich@proxmox.com>

Tested these changes, I could reproduce the described problem, and
after applying the patches the macros only matches the correct ICMP
packets, not all.

so consider this:
Tested-by: Hannes Laimer <h.laimer@proxmox.com>

On 04.02.25 10:57, Stefan Hanreich wrote:
> Rules using the Ping macro were wrongly generated due to the ICMP
> macros using the wrong format for specifying ICMP type. The test cases
> did not include any macros utilizing the ICMP protocol. Add them to
> catch any errors related to ICMP parsing in the future.
> 
> Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
> ---
> Depends on bumped proxmox-ve-config to work.
> 
>   proxmox-firewall/tests/input/host.fw          |  1 +
>   .../integration_tests__firewall.snap          | 57 ++++++++++++++++++-
>   2 files changed, 57 insertions(+), 1 deletion(-)
> 
> diff --git a/proxmox-firewall/tests/input/host.fw b/proxmox-firewall/tests/input/host.fw
> index a61b0bd..ddfcb1c 100644
> --- a/proxmox-firewall/tests/input/host.fw
> +++ b/proxmox-firewall/tests/input/host.fw
> @@ -20,6 +20,7 @@ nf_conntrack_helpers: amanda,ftp,irc,netbios-ns,pptp,sane,sip,snmp,tftp
>   IN DNS(ACCEPT) -source dc/network1 -log nolog
>   IN DHCPv6(ACCEPT) -log nolog
>   IN DHCPfwd(ACCEPT) -log nolog
> +IN Ping(REJECT)
>   IN REJECT -p udp --dport 443
>   OUT REJECT -p udp --dport 443
>   
> diff --git a/proxmox-firewall/tests/snapshots/integration_tests__firewall.snap b/proxmox-firewall/tests/snapshots/integration_tests__firewall.snap
> index 9194fc6..d25ece8 100644
> --- a/proxmox-firewall/tests/snapshots/integration_tests__firewall.snap
> +++ b/proxmox-firewall/tests/snapshots/integration_tests__firewall.snap
> @@ -1,7 +1,6 @@
>   ---
>   source: proxmox-firewall/tests/integration_tests.rs
>   expression: "firewall.full_host_fw().expect(\"firewall can be generated\")"
> -snapshot_kind: text
>   ---
>   {
>     "nftables": [
> @@ -3533,6 +3532,62 @@ snapshot_kind: text
>           }
>         }
>       },
> +    {
> +      "add": {
> +        "rule": {
> +          "family": "inet",
> +          "table": "proxmox-firewall",
> +          "chain": "host-in",
> +          "expr": [
> +            {
> +              "match": {
> +                "op": "==",
> +                "left": {
> +                  "payload": {
> +                    "protocol": "icmp",
> +                    "field": "type"
> +                  }
> +                },
> +                "right": "echo-request"
> +              }
> +            },
> +            {
> +              "jump": {
> +                "target": "do-reject"
> +              }
> +            }
> +          ]
> +        }
> +      }
> +    },
> +    {
> +      "add": {
> +        "rule": {
> +          "family": "inet",
> +          "table": "proxmox-firewall",
> +          "chain": "host-in",
> +          "expr": [
> +            {
> +              "match": {
> +                "op": "==",
> +                "left": {
> +                  "payload": {
> +                    "protocol": "icmpv6",
> +                    "field": "type"
> +                  }
> +                },
> +                "right": "echo-request"
> +              }
> +            },
> +            {
> +              "jump": {
> +                "target": "do-reject"
> +              }
> +            }
> +          ]
> +        }
> +      }
> +    },
>       {
>         "add": {
>           "rule": {



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  reply	other threads:[~2025-03-13 15:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-04  9:57 [pve-devel] [PATCH proxmox-ve-rs 1/3] firewall macros: fix macros using icmp protocol Stefan Hanreich
2025-02-04  9:57 ` [pve-devel] [PATCH proxmox-ve-rs 2/3] fix #6108: firewall macros: Add missing ICMPv6 statements Stefan Hanreich
2025-02-04  9:57 ` [pve-devel] [PATCH proxmox-firewall 3/3] tests: add Ping macro to tests Stefan Hanreich
2025-03-13 15:04   ` Hannes Laimer [this message]
2025-04-07 11:51 ` [pve-devel] [PATCH proxmox-ve-rs 1/3] firewall macros: fix macros using icmp protocol Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7a37ee8-2975-445b-9999-c3a231500cf7@proxmox.com \
    --to=h.laimer@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=s.hanreich@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal