WikiCommand guide
Command guide
Everyday work, ready commands.
Common tasks, from installing packages to the security platform, with copyable examples. Run the commands as root, on the console or in an SSH session.
Installing and upgrading packages
priente-fetch installs, upgrades and removes packages from the signed repository. Before each operation it shows what it will do and asks for confirmation; -y skips the question, --dry-run only shows the plan.
Refresh the package lists
priente-fetch updateSearch and inspect
priente-fetch search 'postgres*' # names and descriptions; * and ? allowed
priente-fetch info suricata # versions, channel, services
priente-fetch list --upgradable # packages that can be upgradedInstall
priente-fetch install nginx
priente-fetch install suricata --dry-run # show the plan only
priente-fetch install postgresql-16 redis -yRequirements are installed first; the new package’s services are started.
Upgrade
priente-fetch upgrade # every package
priente-fetch upgrade --security # security releases only
priente-fetch upgrade nginx # one packageOnly the upgraded package’s services that were running before the upgrade are restarted.
Remove
priente-fetch remove nginxThe package’s settings under /etc and its data in directories such as /var/lib and /var/www are kept; reinstall it and it carries on where it left off. A package another one needs cannot be removed.
Choose a channel
priente-fetch channel # show the channels
priente-fetch install suricata --channel feature # install and follow this package from feature
priente-fetch channel stable suricata # put the package back on stable
priente-fetch channel feature # move the whole system to featureA package that returns to stable stays on its current version until the stable release passes it; nothing is downgraded.
Automatic updates
priente-fetch auto on # every update, at regular intervals
priente-fetch auto security # security releases only
priente-fetch auto status
priente-fetch auto offTo have the system image installed automatically as well, add the line auto_system="yes" to /etc/priente/fetch.conf; updates then include a restart.
Mirrors
priente-fetch mirrorsEach mirror is listed with its state and the serial it serves. The mirror list is the mirror line in /etc/priente/fetch.conf.
Install from the installation medium (offline)
priente-pkg list --available # packages on the medium
priente-pkg install samba --from /dev/sr0
priente-pkg list # installed optional packages
priente-pkg remove sambaAttach the installation ISO to the virtual machine’s CD/DVD drive. Without --from, the drives are scanned and the first medium with packages is used. An unsigned or modified archive is refused.
Exit codes for scripts
| Code | Meaning |
|---|---|
0 | Success |
3 | Another priente-fetch is running |
4 | Network: no mirror could supply the file |
5 | Verification: signature, serial, expiry, channel, size or SHA-256 did not match |
6 | Package or package list not found |
7 | Dependency problem |
8 | The kernel refused the archive (unsigned or corrupt) |
System updates and rollback
The kernel and the base system update as one signed image. The new version is written to the idle slot, starts with a trial boot and becomes permanent once it passes the health check. How it works
Is there a new version?
priente-fetch system-upgrade --checkUpdate
priente-fetch system-upgrade # download, verify, write and restart
priente-fetch system-upgrade --no-reboot # write; the new version is tried at the next bootSee the state
priente-sysupdate statusThe active slot, the versions in both slots and any pending trial. After an update the new slot first shows as a trial, then as the active slot once the health check passes.
Go back to the previous version
priente-sysupdate rollbackA pending trial is cancelled; otherwise the version in the other slot becomes active and the machine restarts with it.
Add conditions to the health check
A trial boot expects the base services to run and the configured network interfaces to get their addresses. You can add your own services: if the services in the file below are not running, the update is rolled back by itself.
require_units=nginx.service postgresql.servicePick a slot at boot
Press a key at the very start of the boot: the slot you pick from the menu boots once, and the permanent setting does not change.
Verify the version and the identity
priente-kernel --verify # exits 0 when every check passes
priente-sysupdate statusNetwork configuration
The network, host name, time zone, DNS, NTP, routes, services and the firewall are kept in one file: /etc/priente/system.conf. The same settings are changed from the menu, from the command line or by editing the file; prienteconf apply makes the running system match the file. It also runs at boot.
With the menu
prienteconfScreens for the network interfaces, name, time zone, NTP, services, sysctl and the firewall. Preview the changes, then save. In the psh shell, configure opens the same menu.
Current settings
prienteconf show # the settings in the file
prienteconf show --running # the running system, in the same syntax
prienteconf get ifconfig_eth0
prienteconf keys # every key, with examplesStatic address
prienteconf set ifconfig_eth0="inet 192.168.1.10/24" defaultrouter=192.168.1.1
prienteconf set dns_servers="192.168.1.1 192.168.1.2" dns_search=example.com
prienteconf apply --dry-run # what will change?
prienteconf applyDHCP
prienteconf set ifconfig_eth0=dhcp
prienteconf unset defaultrouter
prienteconf applyIPv6 and MTU
prienteconf set ifconfig_eth0="inet 192.168.1.10/24 inet6 fd00::10/64"
prienteconf set ipv6_defaultrouter=fd00::1
prienteconf set ifconfig_eth0_mtu=9000
prienteconf applyName, domain, time and NTP
prienteconf set hostname=fw-istanbul-01 domain=example.com
prienteconf set timezone=Europe/Istanbul
prienteconf set ntp_servers="ntp1.example.com ntp2.example.com"
prienteconf applyNTP needs the chrony package, which is selected by default at installation.
Static route
prienteconf set static_routes="lab" route_lab="10.20.0.0/16 via 192.168.1.254"
prienteconf applyFirewall
Inbound traffic is dropped by default: only SSH is open, and new SSH connections are rate-limited. The rules are loaded before the network interfaces come up.
prienteconf set firewall_allow_tcp="22 443" # TCP ports open to everyone
prienteconf set firewall_allow_udp="53"
prienteconf set firewall_allow_tcp_db="5432" firewall_allow_tcp_db_from="10.0.0.0/24"
prienteconf set firewall_trusted_interfaces="eth1" # accept everything from this interface
prienteconf show --firewall # the rules that will be loaded
prienteconf applyA key ending in _from opens the port list of the same name to those sources only. The menu’s firewall screen opens or closes the ports of common services such as SSH, HTTP, HTTPS, DNS and NTP with one key.
SSH
prienteconf set ssh_port=2222 # SSH on another port
prienteconf set ssh_root_login=prohibit-password # root logs in with a key only
prienteconf applyThe default firewall opens the new SSH port by itself. If you wrote your own firewall_allow_tcp list, add the new port to it.
Validate
prienteconf checkUnknown keys are errors; after a typo the closest key is suggested. Extra settings files are read from /etc/priente/system.conf.d/*.conf, in name order.
Services
pinit manages the services; the systemctl commands you know work.
State and control
systemctl status nginx
systemctl restart nginx
systemctl stop nginx
systemctl start nginx
systemctl list-units --failed # failed services
systemctl list-timers # scheduled jobsStart at boot (permanently)
Because the system files come from the image at every boot, permanent enabling is done with prienteconf. services_enable is a list: look at the current value first, then write the whole list.
prienteconf get services_enable
prienteconf set services_enable="nginx postgresql"
prienteconf set services_disable="haproxy"
prienteconf applyPackages’ own services are enabled when they are installed and start at every boot; these lists are for extra services and the ones you want off.
From the security platform
psp services
psp service restart nginxLogs
Service logs
journalctl -u nginx -n 100 # last 100 lines
journalctl -u nginx -f # follow live
journalctl -p err -b # errors in this boot
journalctl --since "1 hour ago"
journalctl -g "timeout" # search the text
journalctl -k -n 50 # kernel logJournal size
journalctl --disk-usage
prienteconf set journal_max_size=64M journal_max_files=8
systemctl daemon-reloadThe total is file size × number of files. The setting is read at boot; systemctl daemon-reload applies it at once.
Audit and security logs
psp logs -u nginx -n 50
psp logs audit --failed # failed logins and permission attempts
psp logs kernel -n 50
psp radar events -n 50Update logs
tail -n 50 /var/log/priente-fetch.log
priente-fetch job # update jobs started from panels and productsSecurity platform (psp)
psp does everything the web panel does, from the command line; it works with the panel off too. Every command gives machine-readable output with --json.
Overview and alarms
psp status
psp alarms # unacknowledged alarms
psp alarms ack --allWeb panel
psp web on # https://<address>:7143
psp web # state, certificate fingerprint, allowed networks
psp web offThe panel makes its own certificate the first time; its SHA-256 fingerprint is shown on the console and by psp web. Sign in with root or a user given a panel role.
Attack Radar
psp radar # state, rules, top sources
psp radar events -f # live event stream
psp mode prevent # block above the threshold (default: log)
psp radar allow 10.0.0.0/8 # management network: never blocked
psp radar block 203.0.113.47 --for 2h
psp radar blocked
psp radar unblock 203.0.113.47
psp radar preset strict # standard | strict | paranoid
psp radar lockdown on # only the allowlist may connectDecoys
psp deception add 2222 ssh
psp deception add 3389 rdp
psp deception contacts # who touched a decoy
psp deception autoblock on # block decoy contacts in Log mode too
psp deception remove 2222Profiles: ssh, telnet, http, https, rdp, smb, mysql, postgres, redis and raw. A port a real service uses is refused; the decoy’s port is opened in the firewall by itself.
Integrity
psp integrity # kernel, boot and process integrity
psp integrity processes --unverified # processes that belong to no signed package
psp integrity verify
priente-kernel --verifyMail notifications
psp mail set server=smtp.example.com port=587 security=starttls \
user=alarm@example.com from=alarm@example.com to=soc@example.com \
min_severity=warning
psp mail testWith user, the password is asked for and kept where only root can read it. security: starttls, tls or none; min_severity: info, warning or critical. For a daily summary, daily_summary=yes.
Users and two-factor sign-in
psp users # accounts and panel roles
psp users add analyst --role viewer # asks for the password
psp users 2fa-on analyst # QR code in the terminal
psp users lock analyst
psp sessions # panel sessionsSSH access
psp ssh # state
psp ssh on --root-login prohibit-password
psp ssh offTurning SSH off while the panel is off too is refused, since only the console would remain; --force overrides it.
Fleet: many servers, one panel
psp serve manager # on the manager: this machine runs the fleet
psp serve token # on the manager: a one-time join line
psp serve join manager.example.com:7144 PSP1-... # on the member: the line the token printed
psp serve list # on the manager: the members
psp --node web-1 status # run any command on a memberOnly the manager listens, on 7144/tcp; members connect to it and need no open port. The join line works once and expires soon.
Product setup
Priente products can be picked on the installer’s screen or installed later with one command; the packages they need come with them.
| Product | Package |
|---|---|
| NameDefence Manager | namedefence-manager |
| NameDefence Defender | namedefence-defender |
| AccessVerifier | accessverifier |
| Priente Hub | priente-hub |
| Siem Verifier | siemverifier |
| MobileITM MDM | mobileitm |
| Guardpot | guardpot-manager |
| Guardpot Standalone sensor | guardpot-standalone |
| Guardpot Pool | guardpot-pool |
| Guardpot GHost | guardpot-ghost |
Install
priente-fetch update
priente-fetch install namedefence-managerEach product runs on a machine of its own: AccessVerifier, NameDefence and Priente Hub use the DNS and web ports. Siem Verifier can share a machine with them.
The first setup form
Products with a setup form (MobileITM, Priente Hub, NameDefence Defender, Guardpot, Guardpot Standalone) ask for their first settings on the installer’s screen; at the first boot the product’s own setup program applies the answers. If something goes wrong, the console and the login message say which product could not be set up, and every boot tries again.
journalctl -u priente-product-setup # what happened?
systemctl start priente-product-setup # try again once the cause is fixedProduct setup tools
mobileitm-setup --status
mobileitm-setup --domain mdm.example.com --cert /root/fullchain.pem --key /root/privkey.pem
guardpot-setup --email admin@example.com --password-stdin # reads the password from standard input
guardpot-agent-setup --manager 10.0.0.5 --ssh-port 2222
journalctl -u priente-hub-firstboot # Priente Hub first setup
systemctl start priente-hub-firstbootProduct accounts
cat /etc/priente/accounts # package, account, uid, gid
priente-pkg accounts # make the accounts again, as at boot
priente-fetch job # update jobs started from product panelsUpdate a product
priente-fetch upgrade guardpot-managerProducts are updated with signed packages; a product’s own updater cannot download an unsigned program. Only the product’s services are restarted.
Maintenance and psh shortcuts
psh shortcuts
| Command | What it does |
|---|---|
show system | System summary |
show interfaces, show routes | Network interfaces and routes |
show services, show logs | Services and recent logs |
show packages, show firewall, show users | Packages, firewall, users |
show hardware | The hardware compatibility report |
configure | The settings menu (prienteconf) |
pkg install nginx | Shortcut to priente-fetch and priente-pkg |
lock | Locks the terminal; only the user’s password opens it |
For a one-line status bar set PSH_BAR=1; to turn it off, PSH_BAR=off.
Restart and power off
reboot
poweroff
psp power rebootResetting the device
priente-installer # explains, asks you to type RESET, returns to the installer
priente-installer --no-reboot # arm the reset for the next boot
priente-installer --cancel # take an armed reset backVerifying the installation image
The commands to verify a downloaded image with SHA-256 are on the Download page.