Skip to content

Firewall tests add information about nftables in console not just in logs #1674

@teoberi

Description

@teoberi

Is your feature request related to a problem? Please describe.
Considering that nftables is becoming more and more widely used:
https://wiki.nftables.org/wiki-nftables/index.php/What_is_nftables%3F#Adoption
https://wiki.nftables.org/wiki-nftables/index.php/Nftables_from_distributions
it would be appropriate to also display the test results in console, just like in the case of iptables.

Describe the solution you'd like
The necessary lines can be added:
before the line

Report "firewall_software[]=nftables"

will be added
Display --indent 2 --text "- Checking nftables kernel module" --result "${STATUS_FOUND}" --color GREEN
after the line
LogText "Result: this firewall set has 3 rules or less and is considered to be empty"

will be added

            Display --indent 4 --text "- Checking for empty ruleset" --result "${STATUS_WARNING}" --color RED
            ReportWarning "${TEST_NO}" "nftables module(s) loaded, but no rules active"

after the line

LogText "Result: found ${NFT_RULES_LENGTH} rules in nftables configuration"

will be added
Display --indent 4 --text "- Checking for empty ruleset" --result "${STATUS_OK}" --color GREEN

Required changes
Changes to the include/tests-firewalls file

Additional context
The result looks like this:

[+] Software: firewalls

  • Checking iptables kernel module [ NOT FOUND ]
  • Checking nftables kernel module [ FOUND ]
    • Checking for empty ruleset [ OK ]
  • Checking host based firewall [ ACTIVE ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions