Appendix A — Argos from the shell

The argos command brings the Argos web console to the shell. Every page of the console becomes a group of commands: with argos you list the zones, add a publication, apply the firewall, read the…

The argos command brings the Argos web console to the shell. Every page of the console becomes a group of commands: with argos you list the zones, add a publication, apply the firewall, read the logs, without opening the browser. It is there for working over SSH, for scripts and for automated tools.

The command has no rules of its own: on the appliance it runs the loading or the saving of the very page it ports. What the page checks, refuses or warns about, the command checks, refuses and warns about, with the same words and in the shell’s language. The write queues, the firewall’s apply cycle with its confirmation within 60 seconds and every validation are the console’s.

The command belongs to the argos-cli package, installed together with Argos.

Who can use it, and from where

argos must be run as root, or with sudo. It talks to the console through a local socket, /run/argos/cli.sock, in a directory only root can enter: there is no key to configure and no network port. Whoever reaches the socket is root; any other user gets a refusal (exit status 5).

You can use it:

  • over SSH: log in as root, or with an administrator account and sudo:

    ssh root@192.168.10.1
    argos firewall status
  • from the console’s Shell (System → Shell): if you signed in as root the shell is already root’s; with a personal account the shell runs as that account, so type sudo argos … (the console’s accounts are in the sudo group);

  • from the appliance’s local console (keyboard and screen), as root.

The command works only while the console is running (argos.service): if it does not answer, the command exits with status 7.

Warning The command runs on the appliance itself, so the console treats it as a local request: a save that would take the console away from the interface you are using, and that the web page would refuse, is carried out from argos. That is exactly what you need to fix a mistake over SSH, but take care not to lock yourself out, for example by switching SSH off on the zone you are connected from. The firewall’s guards (the 60-second confirmation window) remain.

How the commands are built

The general form is:

argos <section> <page> <verb> [arguments] [options]

There are four sections, plus one for special cases:

Section What it holds
argos system The appliance: status, services, power, settings, users, diagnostics.
argos firewall The firewall: apply and confirm, overview, zones, publications, reverse proxies, inspection, applications.
argos network The network: interfaces, PPPoE, gateways, VLANs, routing, QoS, DNS allowlist, DHCP, VPN, IPsec.
argos logs The logs: detections, TLS clients, behavioural analysis, DNS protection, firewall, system, an address’s details.
argos raw The bridge to any page, for what no command covers yet.

The verbs always follow the same pattern:

  • a page’s records are handled with list, show, add, set and delete;
  • a list inside a record (a zone’s services, a DHCP server’s reservations) is a group of its own, and its items are named by their number;
  • a settings block is a group with show and set;
  • a button of the page is a verb named after it (issue, test, run, identify…).

set changes only what its options name: the rest of the record is sent as the page’s form holds it. A group with no verb lists its records, or shows the page if it has no records: argos firewall zones is the same as argos firewall zones list.

Where to find the console’s areas

The console has ten areas, the command four sections. Every command, in its help, names the console page it ports (“Console page: Network and uplinks → Gateways”). This table maps one to the other:

Console area → tab Commands
Header: firewall status (apply, confirm, cancel) argos firewall status, apply, confirm, cancel
Header: power menu argos system power reboot, shutdown
System status → Status argos system status show, findings; the Services card is argos system services
Zones and rules → Zones argos firewall zones (with services, the forward rules rules and the matrix matrix)
Zones and rules → Overview argos firewall overview, argos firewall ruleset
Network and uplinks → Gateways argos network gateways
Network and uplinks → Interfaces argos network interfaces, argos network pppoe
Network and uplinks → VLANs argos network vlans
Network and uplinks → Routing argos network routing (with routes for the static routes and policies for policy routing)
Network and uplinks → Quality of Service argos network qos
Published services → Port publication argos firewall publications
Published services → Reverse proxy argos firewall proxies (the WAF with set --waf, --waf-profile; the rules left out with waf-exclude and waf-include)
Published services → Hairpin NAT argos system settings hairpin
VPN → VPN WireGuard argos network vpn
VPN → VPN IPsec argos network ipsec
Protection → Inspector argos firewall dpi
Protection → Intelligence argos firewall intel (with sources, exceptions, hits, bans)
Protection → Decoys argos firewall decoys (with list, add, set, delete, propose, contacts, quarantine)
Protection → Blocklist argos system settings blocklist
Protection → Exemptions argos system settings exemptions
Applications → Applications, Application control, Network visibility argos firewall applications, app-control, visibility
Applications → App-ID options argos system settings applications
DNS and DHCP → DNS protection argos system settings dns (with lists)
DNS and DHCP → DNS allowlist argos network dns
DNS and DHCP → Local DNS argos system settings local-dns
DNS and DHCP → Forwarded domains argos system settings forwarded
DNS and DHCP → DHCP argos network dhcp (with scopes, relays, leases)
Events and diagnostics → the log pages argos logs events, tls, crowdsec, waf, dns, firewall, system; an IP’s details are argos logs ip
Events and diagnostics → Operations log argos system audit (list, show, export)
Events and diagnostics → Diagnostics argos system diagnostics
Events and diagnostics → Shodan argos system settings shodan
System → Host identity argos system settings identity
System → Users argos system users (with mfa)
System → Management access argos system settings access
System → HTTPS certificate argos system settings tls
System → E-mail notifications argos system settings mail
System → Updates argos system settings updates
System → Atlas argos system settings atlas, argos system settings backup
System → Product registration argos system settings registration
System → EDON Krios argos system settings krios
System → Assistant argos system settings assistant (show, set, key, key-remove, refresh, accept-terms, topup)
First-run setup (license, registration, Network step of an Argos Krios created) argos system setup (with network)
System → Remote Support and Monitoring argos system settings citadel
System → Shell none: argos is a shell already

Global options

They hold for every command and go before or after the command.

Option What it does
--json Prints the page’s data, or its answer to an action, as one JSON document on stdout, and nothing else there. Notes and warnings go to stderr.
-y, --yes Does not ask for confirmation before a destructive step (deleting, powering off). Without a terminal it is required for those steps.
-q, --quiet Leaves out the notes on stderr.
--lang <en|it> The language of the messages. Without it, the shell’s environment chooses (ARGOS_CLI_LANG, then LC_ALL, LC_MESSAGES and LANG): Italian when it says Italian, English otherwise.
--no-color No colours, even on a terminal.
-h, --help The help of the group or of the command.
--version The versions of the command and of the console.

Saving and applying

As in the console, a change is saved at once, but the firewall changes only when you apply it. After a change that needs it, the command reminds you that the firewall holds changes that are not running yet.

  • argos firewall apply loads the saved configuration and keeps the previous ruleset aside. On a terminal it asks for the confirmation straight away and, depending on the answer, confirms or cancels. Without a terminal (a script) it leaves the 60-second window open.
  • argos firewall confirm confirms an apply that is waiting.
  • argos firewall cancel cancels it: the previous ruleset comes back at once.
  • If nobody confirms within 60 seconds, the previous ruleset comes back by itself: that is the guard against locking yourself out.

argos firewall apply --confirm confirms right after the load and gives the guard up. Use it only where losing the connection you work on does not matter, for example in a script on the appliance’s local console.

Secrets

A password, a pre-shared key or any other secret must never be written on the command line, where any user of the appliance can read it in the process list. An option that takes a secret takes its source instead:

Value Where the secret is read from
- from standard input
@path from a file
ask asked on the terminal, without echo

A secret written out in full is refused.

Scripts and exit status

Read-only commands change nothing and can run anywhere. Commands that delete or power off ask for confirmation; without a terminal they need --yes. The exit status tells how it went:

Status Meaning
0 Done.
1 Failed: the page could not do it, or the console answered with an error.
2 Usage: unknown command or option, missing argument, value of the wrong kind.
3 Refused by the page: the fields it names are wrong (the messages say why).
4 Not found: no record by that name.
5 Unauthorized: you are not root.
6 Declined: no --yes without a terminal, a negative answer, no answer in time.
7 The console does not answer: check argos.service.

Practical examples

The examples use John Smith Ltd’s configuration.

1. The appliance’s status, as on the Status page: host, “Attention” strip, hardware, firewall, interfaces, services, updates.

argos system status show

2. Only what deserves a look, the “Attention” strip. With --json it suits a monitoring script.

argos system status findings
argos --json system status findings > /root/findings.json

3. Does the firewall have changes to apply?

argos firewall status

4. The zones and their interfaces.

argos firewall zones list
argos firewall zones show guests

5. Opening a service to the appliance from a zone: the DNS resolver for the guests.

argos firewall zones services add guests --protocol udp --ports 53 --comment "Guest DNS"
argos firewall zones services add guests --protocol tcp --ports 53 --comment "Guest DNS"

6. Publishing the NVR on port 8443 of the fibre line, only for the security company: external port 8443 goes to port 443 of the NVR.

argos firewall publications add --zone wan --interface eth0 --port 8443 \
  --destination 192.168.10.30 --dest-port 443 --source 198.51.100.0/28 --comment "NVR for the security company"

7. Applying and confirming. On a terminal the command asks for the confirmation; from another session you can also confirm or cancel by hand.

argos firewall apply
argos firewall confirm    # from another session, within 60 seconds
argos firewall cancel     # or: go back to the previous ruleset at once

8. A backup gateway on the second line, following the router of the DHCP lease, with a reachability check. The gateways reach the kernel with the firewall’s apply.

argos network gateways list
argos network gateways add eth2 --metric 20 --check-host 1.1.1.1 --comment "FWA (backup line)"
argos firewall apply

9. The guests on the backup line (policy routing by source): everything the guest network sends to the internet leaves through the FWA. The policy route holds from the save, with no firewall apply.

argos network routing policies add --source 192.168.20.0/24 --uplink eth2 --comment "Guests on the backup line"
argos network routing policies list

10. Moving the listen port of the tunnel to the branch. The command passes on the console’s warning: on the other side the Endpoint’s port becomes 51830, then the firewall must be applied to open it.

argos network vpn set wg0 --listen-port 51830
argos firewall apply

11. What the firewall dropped in the last hour for the NAS.

argos logs firewall show --range 1h --action blocked --filter 192.168.10.20

12. What the DNS filter blocked for the administration PC in the last 24 hours.

argos logs dns show --range 24h --filter 192.168.10.57

13. Who is behind an address seen in the logs: reverse DNS and registries for a public address, the appliance’s tables for a local one.

argos logs ip show 198.51.100.77
argos logs ip show 192.168.10.142 --scan   # adds an nmap scan of the local host

14. Diagnostics from the appliance: a ping to the branch through the VPN, and who holds a DHCP address on the lan.

argos system diagnostics ping 192.168.50.1 --count 2
argos network dhcp leases eth1

15. A new administrator, with the password typed without echo.

argos system users add lwhite --full-name "Laura White" --password ask

16. Lost phone: removing a colleague’s second factor.

argos system users mfa remove lwhite --yes

17. The console from the wan too, with the second factor the wan always asks for. --console replaces the list of zones besides the lan; the console answers on the wan once the firewall’s apply opens the port to it.

argos system settings access show
argos system settings access set --console wan
argos firewall apply

18. Exempting two hosts from the protection: the NAS from inspection (the nightly backups), the production manager’s PC from DNS protection. A new entry has DNS protection, inspection and “Enabled” on, as in the console’s dialog: --no-dns and --no-dpi switch off the part you do not need. The entry is named by its address. Forced DNS and inspection follow the firewall’s apply.

argos system settings exemptions add 192.168.10.20 --no-dns --comment "NAS (nightly backups)"
argos system settings exemptions add 192.168.10.50 --no-dpi --comment "Production manager's PC"
argos system settings exemptions list
argos firewall apply

Help and manual

  • argos --help lists the sections; argos <group> --help a group’s commands; argos <group> <command> --help a command’s options, with examples and the console page it ports.
  • man argos is the complete manual, in Italian when the shell is in Italian; every section has its own page (man argos-firewall-zones, man argos-network-gateways…).
  • Command completion with the Tab key works in bash.

The bridge: argos raw

For a page the command tree does not cover yet:

argos raw routes                                   # the pages it can reach
argos raw get /logs/firewall --query range=1h      # a page's data, as JSON
argos raw post /api/firewall _op=cancel --yes      # a page's action

The answers are the page’s, as JSON, and nothing is checked before the page checks it: use raw only when you know which fields the page expects.

For the technician Every call reaches the console as a request from a root session created for it (with the second factor counted as done) and runs the page’s loader or action in the console’s process. Every call is written to the journal ([argos] cli: … as root), readable with journalctl -u argos. The socket takes one request per connection, at most 32 MiB, to be sent within 30 seconds. The messages’ texts come from the console’s dictionary, the same as the web page’s.

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