NethServer / nethsecurity

NethSecurity image and build environment
https://www.nethsecurity.org/
Other
82 stars 6 forks source link

Firewall objects #567

Open gsanchietti opened 1 month ago

gsanchietti commented 1 month ago

Why is this feature being requested?

  1. The need for enhanced firewall management through organized and structured IP and domain sets.
  2. To simplify and automate the handling of firewall rules, port forwards, multiwan rules, and DPI rules by using predefined objects.
  3. To improve security and ease of administration by using object-based configurations that expand dynamically based on their definitions.

Proposed Solution Implement firewall objects as described in the documentation. This includes two main types of objects: host set and domain set, with each supporting both IPv4 and IPv6 addresses. These objects will be used within firewall rules and other configurations to reference sets of IP addresses or DNS names. DHCP reservations, DNS records and OpenVPN users with a reservation are parts of the objects.

Key Elements:

  1. Host Sets:

    • Represent sets of IP addresses.
    • Can include single IPs, CIDR networks, ranges, DHCP reservations, domain names, and VPN users.
    • Support both IPv4 and IPv6.
  2. Domain Sets:

    • Represent sets of DNS names resolved to IP addresses.
    • Include a timeout for DNS resolution.
    • Support both IPv4 and IPv6.
  3. Usage in Rules:

    • Firewall rules, port forwards, multiwan rules, and DPI rules can reference these objects.
    • Fields such as ns_src and ns_dst will be used to specify source and destination objects.
    • Automatically update and manage IP sets based on object definitions. Additional Context
    • Known limitations of fw4:
      1. A rule can only use one ipset for either source or destination, not both.
      2. Ipsets cannot contain entries with different timeouts.
      3. Rules cannot match both an IP address and a MAC address simultaneously.
gsanchietti commented 1 week ago

1. Cron Job for Domain Sets

2. Manage Objects APIs

3. Validate Nested Host-Set

4. MultiWAN and Redirects Regressions

5. Prevent Deletion if Used

6. Host Set

7. Domain Set

8. Rules and Objects

github-actions[bot] commented 2 days ago

Testing image version: 8-23.05.3-ns.1.1.0-25-g5158b54