Key concepts

This chapter explains the ideas Argos rests on: the zones, the two kinds of traffic, policies and exceptions, NAT, gateways, and above all the difference between saving and applying, with the…

This chapter explains the ideas Argos rests on: the zones, the two kinds of traffic, policies and exceptions, NAT, gateways, and above all the difference between saving and applying, with the confirmation window and the protections that stop you from locking yourself out. The examples use the John Smith Ltd network described in What Argos is.

The zones

A zone is a group of interfaces that you trust in the same way. The firewall does not reason by single network port but by zone: the rules say what the traffic that enters through a zone’s interfaces may do.

John Smith Ltd has five zones:

Zone Interfaces Level of trust
wan eth0 (fibre), later eth2 (FWA) the internet: no trust
lan eth1 the offices: full trust
guests eth1.20 the guest Wi-Fi: internet only
production eth1.30 the department’s machines: isolated, with a few exceptions
sites wg0 (the tunnel to the branch) the other sites: they reach the offices, not the other networks
Zones and rules → Zones: the list of John Smith Ltd's zonesZones and rules → Zones: the list of John Smith Ltd's zones
Zones and rules → Zones: the list of John Smith Ltd's zones

wan and lan, the two fixed zones

Every appliance has two zones that cannot be renamed or deleted: wan, the internet side, and lan, the local network. Their name is their role: from it Argos knows which interfaces are on the internet (and there it never offers DHCP and always asks for the second factor to sign in to the console) and on which network SSH and the console always answer. You create, rename and delete the other zones as you like, from Zones and rules → Zones.

On a new appliance:

  • wan drops the traffic addressed to the appliance and the traffic to be forwarded, and does masquerade (see below);
  • lan accepts the traffic addressed to the appliance and the traffic to be forwarded, and already has the DNS services (UDP and TCP 53) open.

The two zones start without interfaces: assigning them is the first job after installation.

What a zone can hold

A zone holds interfaces of four kinds: network cards (eth0, eth1…), VLANs (eth1.20), VPN tunnels (a WireGuard profile such as wg0, an IPsec tunnel such as ipsec0) and PPPoE links (ppp0). An interface belongs to one zone at most: assigning it to a zone takes it out of the one it was in.

An interface that is in no zone is closed: it does not reach the appliance’s services (it only answers ping) and its traffic is not forwarded, except for the replies to connections opened from the other side. A zone without interfaces produces no rule.

Tip Put a VPN tunnel in a zone of its own (for example sites) rather than in the lan: that way you decide with that zone’s policies what the remote site can reach.

Inbound traffic and forwarded traffic

For the firewall there are two kinds of traffic, and every zone has a rule for each.

  • Inbound traffic is addressed to the appliance itself: a lan PC that asks the appliance’s DNS for a name, that pings it, that opens the console. It is governed by the inbound policy and the inbound services of the zone it comes from; some features (SSH and the console, DHCP, the VPNs) open the ports they need by themselves, as explained further on.
  • Forwarded traffic crosses the appliance: a lan PC browsing the internet, a guest’s laptop opening a website, an office PC reaching a machine in production. It is governed by the forward policy, the forwarding matrix and the forward rules of the zone it enters from.

The zone that counts is always the ingress one. The traffic from the lan to the internet is decided by the forward rules of the lan, not by those of the wan; the traffic from the internet to the lan is decided by those of the wan.

Replies need no rules: once a connection has been admitted, the return packets pass by themselves. That is why the wan can drop everything that arrives from the internet and the lan PCs still browse: the pages they receive are replies to connections they opened.

The policies

A policy is the decision for everything that no more precise rule has already decided. There are three choices:

Policy What happens
“Accept” the traffic passes
“Drop” the traffic is silently thrown away: the sender gets no reply and waits until the timeout
“Reject” the traffic is turned away at once with an ICMP port-unreachable message: the sender knows immediately that it cannot pass

Use “Drop” towards the internet (you give no information to whoever is probing) and “Reject” inside, where an immediate error saves users and technicians time.

A new zone starts with the inbound policy and the forward policy on “Drop”: you open what is needed, rather than close what is left over.

The inbound services

The inbound services are the openings towards the appliance from a zone that would otherwise drop: a protocol (TCP, UDP or any), one or more ports (53, 137-139, 80,443) and, if you wish, the only sources allowed (IPv4 addresses or CIDR). They can be rate limited: under the threshold the service accepts, and the excess connections follow the zone’s inbound policy.

Example: the guests zone, for the guests, has the inbound policy “Drop” and two services, UDP 53 and TCP 53, so the guests’ laptops use the appliance’s filtered DNS and see nothing else of it.

Some things need no service, because the feature itself opens them: SSH and the console (opened by System → Management access), DHCP on the interfaces it serves, the port of a VPN tunnel (towards the address of its peer or, when that is not known, towards any address: only those who hold the key get in anyway), ports 80 and 443 of a reverse proxy in its zones. Conversely, an inbound service does not open SSH or the console: for those only the management access counts.

Forwarding matrix and forward rules

The forward policy applies towards every zone. When you need a different decision towards a specific zone, there are two tools.

The forwarding matrix changes the decision for a destination zone: for every other zone with interfaces you choose “Accept”, “Drop”, “Reject” or “Zone default”, which leaves the decision to the forward policy.

Example: the guests zone has the forward policy “Drop” and, in the matrix, the WAN row on “Accept”. The guests go out to the internet and reach neither the lan nor production.

Zones and rules → Zones: the forwarding matrix of the GUESTS zoneZones and rules → Zones: the forwarding matrix of the GUESTS zone
Zones and rules → Zones: the forwarding matrix of the GUESTS zone

The forward rules are finer exceptions, by port and by address: a destination zone, an action (“Accept”, “Drop”, “Reject”), a protocol with its ports, and an optional source and destination. They are read in order, before the matrix: the first that matches decides, and the traffic no rule describes moves on to the matrix and then to the policy.

Example: the lan accepts everything in forwarding, but production must be protected. In the lan zone you set the PRODUCTION row of the matrix to “Drop”, then add a forward rule: destination zone PRODUCTION, action “Accept”, TCP 443, source 192.168.10.50 (the production manager’s PC), destination 10.30.0.20 (the production line’s panel). That one PC reaches that one panel over HTTPS; the rest of the lan does not get into production.

The full order in which the firewall decides the traffic that enters from a zone is this:

  1. replies to connections already admitted always pass;
  2. for the traffic addressed to the appliance, SSH and the console answer where the management access says so (see the protection against lockout further on);
  3. the addresses in Protection → Blocklist are dropped;
  4. for the traffic to be forwarded, the port publications pass (see below);
  5. the ingress zone decides: for the traffic to the appliance the inbound services and then the inbound policy; for the traffic to be forwarded the forward rules, then the matrix, then the forward policy.

For the technician Every zone with interfaces becomes two chains of the inet argos_filter table: zone_<name>_in and zone_<name>_fwd. The base chains input and forward (policy drop) first accept loopback and established connections, then apply the management baseline, the blocklist and the features’ rules (DHCP, VPN, IPsec), and finally jump to the zone’s chain with iifname. The matrix and the forward rules are oifname lines inside zone_<name>_fwd; a rule that points to a deleted zone or to one without interfaces matches nothing. In front of every drop there is a rate-limited log line: you see it in Events and diagnostics → Firewall.

Masquerade

Masquerade (SNAT) rewrites the source address of the traffic that leaves through a zone’s interfaces with the interface’s address. It is needed towards the internet: the provider cannot route your private networks, and without masquerade the replies would never come back.

Masquerade is switched on on the zone the traffic leaves through, not on the one it enters from: you switch it on on the wan, and on a new appliance it is already on. On an internal zone leave it off, unless a device on that network cannot find its way back (for example a production machine with no gateway configured).

The publications

A publication makes an internal service reachable from outside: an external port of the appliance, on an ingress zone, is translated (DNAT) towards an internal host and port.

Example: the CCTV NVR, 192.168.10.30, must be reachable only by the security company, which connects from the network 198.51.100.0/28. In Published services → Port publication you create a publication with “Ingress zone” WAN, protocol TCP, “External port” 8443, “Internal host” 192.168.10.30, “Internal port” 443 and “Allowed remote sources” 198.51.100.0/28. Whoever opens https://203.0.113.10:8443 from that network sees the NVR; from any other address the port stays closed.

Things to know:

  • a publication opens the way by itself: no forward rule is needed on the wan, and the wan’s forward policy does not block it. What limits it is its allowed sources and its per-source limit;
  • a source that is not allowed is not translated and meets the zone’s inbound policy, like any other traffic towards the appliance;
  • a publication answers only on the appliance’s addresses, never on the traffic that crosses it towards other hosts;
  • a zone without interfaces publishes nothing, and deleting a zone switches off its publications;
  • the internal host must use the appliance as its gateway, because the replies must pass back through it;
  • from inside, a publication cannot be reached by the public address, unless you switch on Published services → Hairpin NAT (or have the name resolve to the internal address with DNS and DHCP → Local DNS).

The gateways

A gateway is an interface’s default route: the way to the internet. You define one for each line in Network and uplinks → Gateways, with the address of the provider’s router and a priority from 0 to 999. The lowest priority carries the traffic and is the “Primary” gateway; the others stay on “Standby” and take over when the primary fails. It is failover, not load balancing.

Example: the fibre on eth0 has the gateway 203.0.113.9 with priority 10; the FWA line on eth2 takes its address via DHCP and its gateway is left empty (Argos uses the lease’s router, 192.168.8.1), with priority 20. If the fibre loses its link, the traffic moves to the FWA. With a probe host (9.9.9.9 for the fibre, 1.1.1.1 for the FWA) the gateway is also checked with a ping through its interface: after 3 missed replies it is withdrawn, provided another gateway carries a default route, and at the first reply it comes back.

With two or more active gateways, a connection that came in on a line is answered from that same line: a publication on the fibre answers from the fibre even while the traffic goes out through the FWA.

A policy route (Network and uplinks → Routing) sends a destination, a client or an internal network over a chosen gateway instead of the primary: for John Smith Ltd the FWA provider’s VoIP PBX (198.51.100.50) and the guest network (192.168.20.0/24) go out through the FWA. If that gateway is withdrawn, the traffic of its policy routes follows the default route until the line comes back.

Gateways are saved like the firewall: saving writes the configuration, and only “Apply” loads them into the kernel, under the same confirmation window as the rules.

Saving and applying

In Argos saving and applying are two different things, and the difference is the most important thing to understand.

  • Saving writes the configuration. On many pages saving also updates the service concerned straight away (the DNS resolver, the VPN tunnel, the network).
  • Applying loads into the kernel the firewall rules and the gateways that the saved configuration describes. It is done with “Apply”, from the firewall status button in the console’s header (or from Zones and rules → Overview), and opens the 60-second confirmation window.

Until you apply, the firewall goes on with the previous rules, and the button in the header says “Unapplied changes”. So you can prepare several changes (a zone, two publications, a gateway) and apply them all together.

At the bottom of every detail, above the save button, the “Effect of saving” box says what saving will do on that page. In short:

Where What saving does Is “Apply” needed?
Zones and rules → Zones, Published services → Port publication, Published services → Hairpin NAT, Protection → Blocklist writes the configuration yes
Network and uplinks → Gateways writes the configuration yes: gateways and rules take effect together
Network and uplinks → Interfaces, Network and uplinks → VLANs rewrites the network and restarts it at once (a changed PPPoE link re-establishes its session) no, and it is immediate: no confirmation window
Network and uplinks → Routing, Network and uplinks → Quality of Service updates the kernel at once no
VPN → VPN WireGuard, VPN → VPN IPsec starts or updates the tunnel at once yes, to open the tunnel’s port to the peer
Published services → Reverse proxy updates nginx at once if the zones change, the page starts “Apply” by itself: you confirm
Protection → Exemptions updates the resolver (the DNS lists) at once yes, for forced DNS and inspection
Protection → Inspector updates the engines at once yes, because the hand-off to the engine for the inspected zones is in the rules
DNS and DHCP → DNS protection, DNS and DHCP → Forwarded domains updates the resolver at once yes, for forced DNS and its exceptions
DNS and DHCP → DHCP updates the DHCP service at once yes, when you switch the server or the relay on or off on an interface: the firewall opens DHCP only where it is on
System → Management access the console and the second factor take effect at once yes, for SSH and to open the console’s port on a zone
System → Atlas, System → Remote Support and Monitoring links or unlinks at once yes, for the link’s zone
System → Users updates the account at once no
all the others (Host identity, HTTPS certificate, E-mail notifications, Updates, Local DNS, Application control…) applies at once no

Warning Changes to Interfaces and VLANs have no confirmation window: the interfaces file is rewritten and the network restarted when you save. If you change the address of the interface you are working from, your connection drops and you have to reconnect to the new address. Check twice before saving.

The 60-second confirmation window

Every “Apply” follows the same cycle:

  1. Argos takes a snapshot of the rules and the gateways in service;
  2. it loads the new rules and the new gateways, in one go;
  3. it opens the “Keep the new ruleset?” window with a 60-second countdown;
  4. if you press “Confirm”, the new rules stay and become the ones the appliance reloads at every boot;
  5. if you press “Revert”, or if the 60 seconds pass without a confirmation, Argos puts back exactly the rules and gateways it took a snapshot of in step 1.

The reason is simple: if the new configuration cuts you off (you closed the port you are working from by mistake, you moved the wrong line), you can no longer press “Confirm”, and the appliance goes back to the previous situation by itself. The countdown is kept by the appliance, not by the browser: even if you close the page or lose the connection, when the time runs out the previous rules come back.

How to use the window, step by step, is explained in First sign-in and using the console.

Tip Before pressing “Confirm”, really test the change: open a website, the published service, the console itself from another browser tab. You have a minute.

The protection against lockout

A firewall managed remotely has an obvious risk: a wrong rule can lock out the very person who manages it. Argos has several defences, one inside the other.

The management ports

SSH (port 22) and the console (port 443, plus 80, which redirects to 443, and 8000, which also redirects to 443) are the management ports. The firewall handles them before any zone rule:

  • they always answer on the lan zone, whatever the lan’s policies and rules say;
  • on the other zones they answer only if you switch them on in System → Management access, one switch for SSH and one for the console for each zone;
  • as long as the lan zone has no interfaces, they answer on every interface: a freshly installed appliance stays reachable.

That is why no lan policy, no forward rule and no blocklisted address can take SSH and the console away from you on the lan.

System → Management access: SSH, console and second factor zone by zoneSystem → Management access: SSH, console and second factor zone by zone
System → Management access: SSH, console and second factor zone by zone

On a zone where the console is not switched on, 443 can still serve a reverse proxy: there the console answers with a refusal page, “The console does not answer from this network zone.”.

The saves that would cut you off

The console decides which zones to answer from by reading the saved configuration, at once, without waiting for “Apply”. That is why Argos checks the saves that change where the console answers (saving or deleting a zone, a VLAN or a PPPoE link, the interfaces, the gateways, the management access switches and the restore of a backup) and refuses those that would take the console away from the interface you are working from:

You would lose the console on the interface you are using: do this from another zone, or with argos-cli

If you see this message, make the change while connected from another zone (typically from the lan), or from a shell on the appliance with the argos command. In the same way, System → Management access refuses to ask for the second factor on the network you are connected from if your account does not have one yet.

The confirmation window

The last defence is the one described above: everything that goes through “Apply” rolls back by itself if you do not confirm it.

For the technician The anti-lockout baseline is in the input chain, before the blocklist and the per-zone dispatch: it accepts the management ports from the interfaces of the lan and of the zones switched on, then drops SSH and 8000 on every other interface. 443 and 80 are not dropped there, because the reverse proxies share them: on the zones without the switch the refusal comes from the application (403). A request that does not go through nginx (an SSH tunnel to the console’s local port) and a session opened from EDON Citadel are never refused by the check on saves.

What happens at reboot

At boot the appliance reloads the confirmed rules, that is, those of the last “Confirm” (the argos-firewall service), and then puts back the static routes, the confirmed gateways, the policy routes and the traffic priority (the argos-network service).

Three practical consequences follow:

  • changes saved but not applied stay saved, and after the reboot the button still says “Unapplied changes”;
  • an apply that was waiting for confirmation does not survive: after the reboot the rules confirmed before come back. The same happens if only the console’s service restarts during the window;
  • a freshly installed appliance, which has never confirmed anything, boots without Argos rules.

If the file of the confirmed rules cannot be loaded (unreadable, empty, gone or refused by nftables after an update), Argos does not boot the appliance without a firewall: it loads an emergency ruleset that drops everything except the management ports, on every interface, so you can get in and put things right. In that case the System status → Status page reports “Firewall at boot is not running”, the button in the header says “Unapplied changes”, and the solution is to apply again and confirm.

Warning Until you press “Apply” and “Confirm” for the first time, a new appliance filters nothing and does not route between the networks. The Status page says so: “The firewall is not filtering: no ruleset is loaded”. Assign the interfaces to the zones and apply straight away.

Forwarding on only under an Argos filter

For the appliance to act as a router, the kernel’s IPv4 forwarding is needed. Argos manages it by itself, with one rule: the appliance routes only while it filters.

  • Forwarding is switched on as soon as an apply has loaded the rules, and becomes permanent at “Confirm”.
  • If a rollback leaves the appliance without Argos’s rules, forwarding goes back to how it was before.
  • A boot that has no confirmed rules to load switches it off.

If in System status → Status you read “IPv4 forwarding is off: nothing is routed between the zones — apply the firewall to switch it on”, that is exactly what you have to do.

For the technician The forwarding state persists in /etc/sysctl.d/60-argos-forwarding.conf, applied by systemd-sysctl before argos-firewall.service loads the rules. While it routes, Argos also switches off the sending of ICMP redirects (all, default and every interface): a redirect would teach a host on the same network a way around the firewall. IPv4 only.

LET’S TALK INFRASTRUCTURE

Control starts with a conversation.

Tell us about your infrastructure. Let’s start with what you actually need.

Talk to an engineer