SEK SystemsDocs Open console

Agent reference

Local policy

Every host has a small text file, the local policy, that sets the upper limit of what SEK Systems may do on that host. The agent reads it again for every job, at the moment the job runs. A job that the file does not allow is refused by the agent, whatever the console, the approvers or SEK Systems itself asked for.

Security

SEK Systems can never widen the local policy. Only someone with root or Administrator rights on the host can change it. That is why the host has the last word: even if a SEK Systems account or SEK Systems itself were misused, a job can do no more than this file allows.

System Location
Linux /etc/sec/policy.toml
Windows C:\ProgramData\SEC\policy.toml (only Administrators and SYSTEM can change it)

Show the effective policy with sudo sec-agent policy (see Command reference). The console shows the policy each host reports under Agents → host → Local policy.

How it is created

  • The installer writes the file only when there is none, with the profile chosen in the console (default patch). It never overwrites an existing policy, also not when you run the installer again or when the agent updates itself.
  • No file at all means observe: the agent reports, but accepts no jobs.

Warning

A file without a profile line means patch, not observe. If a host may only report, write profile = "observe" explicitly, or remove the file.

Changing it

  1. Edit the file as root or Administrator (for roles you can also use sec-agent role allow|deny).
  2. Check the result with sudo sec-agent policy. An unknown setting or a wrong value makes the whole file invalid: the agent then refuses every job (policy:unreadable) until you fix it. It keeps reporting.
  3. The running agent notices the change within seconds. It reports the new policy (the parsed settings and the hash, never the file itself) to SEK Systems, with the cause, such as a manual edit or the installer. You can be notified of local policy changes (Settings → Notifications).

Profiles

Profile Allows
observe Nothing. The agent only reports.
patch Package upgrades and repairs, service restart and stop, Windows updates and applications, and reversible temporary fixes. See the table below.
full Everything in patch, plus host.reboot and host.quarantine (network isolation).

Per action:

Action What it does observe patch full
package.upgrade Upgrade a package with the system package manager yes yes
package.repair Repair the package database (for example an interrupted dpkg) yes yes
service.restart Restart a service yes yes
service.stop Stop (and optionally disable) a service yes yes
config.set Write a small configuration file of its own, as a temporary fix yes yes
sysctl.set Set a kernel parameter, as a temporary fix yes yes
module.blacklist Stop a kernel module from loading yes yes
firewall.restrict Allow a port only from given sources yes yes
firewall.block_public Block a port for public sources yes yes
registry.set Set a registry value (Windows) yes yes
os.update_kb Install a Windows update yes yes
os.install_msu Install a Windows update package (.msu) yes yes
app.upgrade Upgrade a Windows application (winget) yes yes
app.install_msi Install a signed MSI from the SEK Systems catalogue (Windows) yes yes
host.reboot Reboot the host yes
host.quarantine Isolate the host on the network (with an automatic release if the agent loses contact) yes
custombuild.update Update a DirectAdmin CustomBuild component
  • custombuild.update is in no profile. Allow it only by naming it in allowed_actions.
  • Undo (revert of a temporary fix or isolation) is allowed whenever the original action is allowed.
  • A Windows update that needs a restart only restarts the host if host.reboot is also allowed. Otherwise it is installed without the restart and marked as such.
  • Actions that do not exist on the platform are refused (unsupported_on_platform).
  • There is no script or shell action at all. allow_script = true is refused as an error.

All settings

profile           = "patch"            # observe | patch | full
# allowed_actions = ["package.upgrade", "service.restart"]   # replaces the list of the profile
deny_packages     = ["postgresql*", "linux-image*"]          # never upgrade these (glob patterns)
deny_units        = ["sec-agent*", "sek-agent*"]             # never restart or stop these services
local_windows     = ["Sat 02:00-05:00", "Mon-Fri 22:00-06:00"]
timezone          = "local"            # local | utc
max_jobs_per_hour = 10
dry_run_only      = false
allow_script      = false              # must stay false
allowed_roles     = ["agent"]          # agent | probe | relay | connector
relay_listen_any  = false
self_update       = true
allow_snapshots   = true
snapshot_min_free_pct = 15

[collect]
exec_version_probes = true

[egress]
discover = true

[probe]
allow_cidrs = []
internal = true

[discovery]
active = true

Jobs

Setting Default Meaning
profile patch (no file: observe) Which actions are allowed, see Profiles.
allowed_actions from the profile An explicit list of actions. Replaces the profile's list; use it to narrow down (or to add host.reboot or custombuild.update).
deny_packages [] Glob patterns of packages that are never upgraded, for example ["postgresql*"].
deny_units ["sec-agent*", "sek-agent*"] Glob patterns of services that are never restarted or stopped. The agent's own services are always protected.
local_windows [] (any time) When real (not dry-run) jobs may run. Formats: "Sat 02:00-05:00", "Mon-Fri 22:00-06:00", "Mon,Wed 01:00-02:00", "daily 03:00-04:00", "* 00:00-24:00". A window may cross midnight. These apply on top of the maintenance windows in the console.
timezone local local or utc, for local_windows.
max_jobs_per_hour 10 At most this many real jobs per hour on this host. The Windows installer writes 4.
dry_run_only false true: only dry runs; every real job is refused. Useful to try SEK Systems on a critical host.
allow_script false Must stay false. There is no script action; true makes the file invalid.

Agent and updates

Setting Default Meaning
self_update true Accept agent updates (always signature-checked). false: the agent stays on its version until you reinstall.
allow_snapshots true Take a snapshot of the root volume (LVM, ZFS, btrfs, Windows VSS) before a change, where possible.
snapshot_min_free_pct 15 No snapshot if less free space than this (5 to 90 percent).
allowed_roles ["agent"] Extra roles this host may take: probe, relay, connector. Use sec-agent role allow.
relay_listen_any false Allow a relay to listen on all addresses or a public address (normally only on an internal address).

Collection

Setting Default Meaning
[collect] exec_version_probes true For software outside the package manager that listens on the network, the agent may run its version flag (from a fixed list, for example exim -bV), as an unprivileged user with an empty environment and a 2-second limit. false: never; the version is then read from the file only.
[egress] discover true Ask ip4.sek.systems / ip6.sek.systems once an hour for the public address of this host. false: never.
[egress] echo_urls the two above Other HTTPS addresses to ask instead (at most 4).

Network probes and discovery

Setting Default Meaning
[probe] allow_cidrs [] Network segments this host may test when it has the probe role (at most 32, /8 or narrower). Without segments the probe role does nothing.
[probe] max_targets 64 At most this many targets per run (maximum 256).
[probe] rate_per_s 10 At most this many connection attempts per second (maximum 10).
[probe] external false This host is an internet-facing probe that tests your public addresses from outside.
[probe] fingerprint true (external only) An external probe may read one identifying fact after the handshake (SSH host key, TLS certificate, HTTP Server header) when the signed plan asks for it.
[probe] internal follows [discovery] active Peer probes: another host of your environment may test with one handshake whether a service of this host is reachable from there, and this host may do the same. false switches it off.
[discovery] active true This host may run an active discovery of its own directly connected private network when SEK Systems sends a signed request: TCP connects to a fixed list of 40 ports, private subnets of /22 or smaller only. false: never (passive collection continues).
[discovery] allow_cidrs, deny_cidrs [] Only these subnets; never these addresses. A Linux Wi-Fi network is only scanned if it is in allow_cidrs.
[discovery] rate_pps 50 New connections per second (1 to 100).
[discovery] min_interval_s 3600 At least this many seconds between two runs on the same subnet (minimum 1800).
[discovery] snmp true false: never send SNMP, whatever the environment enabled.
[discovery] listen true false: no short listening window for mDNS, SSDP and LLMNR.

See External and internal probes for what these tests do.

Refusals

When the agent refuses a job, the job in the console shows the reason. The most common:

Reason Cause
policy:allowed_actions The action is not allowed by the profile or allowed_actions.
policy:deny_packages <pattern> The package matches a pattern in deny_packages.
policy:deny_units <pattern> The service matches a pattern in deny_units.
policy:local_windows The job came outside the local windows.
policy:max_jobs_per_hour The hourly limit is reached.
policy:dry_run_only The host accepts only dry runs.
policy:allowed_roles <role> The role is not allowed locally.
policy:self_update Agent updates are switched off on this host.
policy:unreadable The policy file is invalid. Run sudo sec-agent policy to see the error.
wrong_target, expired, clock_skew The job was not signed for this host, has expired, or the host clock is off.
killed The kill switch of your environment is active.
unsupported_on_platform The action does not exist on this operating system.

Examples

Report only:

profile = "observe"

Patch, but never the database and never the kernel, only at night:

profile = "patch"
deny_packages = ["postgresql*", "mariadb*", "mysql*", "linux-image*", "kernel*"]
local_windows = ["Mon-Fri 01:00-05:00", "Sat,Sun 00:00-24:00"]
max_jobs_per_hour = 4

Only package upgrades, also reboots, Saturday morning:

allowed_actions = ["package.upgrade", "host.reboot"]
local_windows = ["Sat 06:00-09:00"]

Try it out safely:

profile = "patch"
dry_run_only = true