Commit Graph

295 Commits

Author SHA1 Message Date
Alexandr Stelnykovych 4a161ed718 fix(observation-hub): honor --spn-map
The observer always watched the map "main", whatever --spn-map said.
2026-11-19 12:27:02 +02:00
Alexandr Stelnykovych eb3bf5448a build(observation-hub): update the Dockerfile
Use Go 1.26, as go.mod requires, and the module path of the merged
repository.
2026-11-19 12:21:44 +02:00
Alexandr Stelnykovych f61db859a9 fix(observation-hub): stay compatible with existing deployments
The production deployment runs a build from the former stand-alone
safing/spn repository (v0.7.4). Its job passes --data and reads the log
from stdout.

- Accept --data as a second name of --data-dir.
- Log to stdout unless --log-dir is given.
2026-11-19 11:56:56 +02:00
Alexandr Stelnykovych eaa9fc84c7 fix(observation-hub): run on an instance of its own
The observation hub has been broken since November 2024 and could not
report anything:

- Since commit 706ce222d (2024-11-27, first in the repository tag
  v2.0.20) it used Portmaster's full instance. There the SPN modules only
  start for an integrated client, so the tool never connected and the
  observer waited forever. A failed instance creation also ended in a
  nil-pointer panic, because the error was ignored.
- Since commit 80664d1a2 (2024-08-09, first in the repository tag
  v1.6.19) the Apprise module was never added and the observer was added
  twice instead. Nothing was sent to the chat rooms, without any error
  message.

The hub's instance is no better fit: it installs binary updates by
itself, which here would install Portmaster's binaries, and it lacks the
notifications module. The SPN client's connection loop reports failures
as notifications and panics without that module; the hub never runs
that loop.

- Add a small instance with only the modules the tool uses: the SPN
  client, intel updates and notifications, but no binary updater and no
  core module. The tool is updated by replacing its container image.
- Add the Apprise module once and before the observer.
- Return the errors of the instance creation instead of ignoring them.
- Require a data directory, so that the data of an installed Portmaster
  is never used.
- Remove --bin-dir and the update command: there are no binaries to
  manage, and the command would install Portmaster's.
- Add a VS Code debug entry for the observation hub.
2026-11-19 11:49:42 +02:00
Alexandr Stelnykovych 5ee8e28391 feat(updates): require a signed intel index
Portmaster, the SPN hub and the observation hub now verify the intel
index the way they verify the binary index: VerifyIntelUpdates is set
to a new trust store with two dedicated intel signing keys. An intel
index that is unsigned, signed with another key or changed after
signing is refused, and the intel files in use stay as they are.

The intel keys are kept apart from the code signing keys, so that an
intel key can only ever forge intel data, not binaries. A test makes
sure that no code signing key is in the intel trust store, and another
one that ParseIndex accepts exactly an index signed with a trusted key.
2026-11-04 15:22:00 +02:00
Alexandr Stelnykovych cfffa7f43e fix(core): stop interception when the shutdown times out
When the shutdown did not complete within three minutes, the process
exited without stopping the interception. The kext then kept holding
every new connection for a verdict that never came, and the network
stayed dead until a reboot.

Add a shutdown-timeout hook to cmdbase and let portmaster-core use it
to stop the interception, bounded by ten seconds, before the exit.
2026-10-27 16:11:09 +02:00
Alexandr Stelnykovych 24f9d7dfc7 fix(windows): fix logging regression by preserving service ImagePath expansion
- fix Windows logging regression where %PROGRAMDATA% in service args stopped resolving
- keep quoted + EXPAND_SZ ImagePath unchanged
- convert quoted REG_SZ ImagePath to EXPAND_SZ without altering command text
- keep unquoted-path self-heal and executable ownership guard
- write repaired ImagePath as EXPAND_SZ so SCM expands environment variables consistently
2026-08-07 14:42:30 +03:00
Alexandr Stelnykovych f93e5a7d38 fix(windows): mitigate CWE-428 unquoted service path for PortmasterCore
- Update NSIS installer to register service with properly quoted executable path
- Add runtime self-heal in portmaster-core on Windows service startup to protect users who update via in-app updater without re-running the installer

https://github.com/safing/portmaster-shadow/issues/43
2026-05-11 15:09:47 +03:00
Alexandr Stelnykovych af6a1623cc fix: improve error handling in recoverIPTables by filtering chain not exist errors
https://github.com/safing/portmaster/issues/1949
2025-10-03 12:43:04 +03:00
Alexandr Stelnykovych 70da66b120 Build script for updatemgr 2025-06-13 13:21:54 +03:00
Natanael Rodriguez Ramos e25871d513 fix(spn-hub): Disable duplicated logging 2025-05-29 12:04:09 +01:00
Natanael Rodriguez Ramos 4271475039 fix(spn-hub): Updated wrong log level 2025-05-29 11:14:08 +01:00
Natanael Rodriguez Ramos a9bb6d1c0d Updated spn-hub install script to remove portmaster-start dependency. 2025-05-28 11:49:32 +01:00
Natanael Rodriguez Ramos ec749b6be7 Merge branch 'v2.0' into task/refactor-spn 2025-05-18 20:59:38 +01:00
Alexandr Stelnykovych 93e4449b00 (Windows) fix: UI restart – do not send "shutdown" event during restart 2025-04-30 12:33:18 +03:00
Natanael Rodriguez Ramos 1ed4cba1e1 SPN: Set SPN binary path 2025-04-24 17:54:19 +01:00
Daniel 9801aae3e7 Fix SPN intel updates 2025-04-15 11:26:59 +02:00
Natanael Rodriguez Ramos c41d8221ff Merge branch 'v2.0' into task/refactor-spn 2025-04-14 09:44:09 +01:00
Natanael Rodriguez Ramos ecce583296 task(spn): Update SPN binary index url 2025-04-11 12:38:34 +01:00
Natanael Rodriguez Ramos 2e9a125a78 Merge branch 'v2.0' into task/refactor-spn 2025-04-11 11:50:59 +01:00
Natanael Rodriguez Ramos fc04975722 Added logs 2025-04-11 11:50:09 +01:00
Natanael Rodriguez Ramos 38d49f43c9 Fixed SPN HUB using wrong instance 2025-04-10 17:12:06 +01:00
Daniel 438f43156f Add upgrade locking mechanism to core ui serving module 2025-04-07 15:26:35 +02:00
Alexandr Stelnykovych 776b4860ef [updates] fix: use correct binaries index name 2025-03-26 17:35:27 +02:00
Alexandr Stelnykovych 5c38035f14 Merge branch 'v2.0' into feature/installer-migration 2025-03-13 16:37:13 +02:00
Alexandr Stelnykovych 0a7c5f9306 [cmds] fix: Enable SPN client mode 2025-03-12 19:20:32 +02:00
Vladimir Stoilov 3b5556b7bb [cmds] Trigger instance shutdown on external events 2025-03-12 15:07:54 +02:00
Daniel ac3f0599b6 Disable Intel Index signatures for now 2025-03-10 15:26:27 +01:00
Daniel f26e61ed15 Improve updatemgr mirror cmd 2025-02-04 14:25:08 +01:00
Daniel aa1bd0679c Improve updatemgr and updates module 2025-01-21 09:21:56 +01:00
Vladimir Stoilov 5039e9efca Merge branch 'develop' into feature/new-installer 2025-01-14 16:59:21 +02:00
Daniel Hååvi 3ee214abaf Merge pull request #1766 from safing/fix/windows-permission2
Fix windows permissions
2025-01-13 13:41:28 +01:00
Daniel 96209c28cf Fix SPN build 2025-01-13 10:09:11 +01:00
Vladimir Stoilov fed64e6fbd Fix loggin dir 2024-12-12 16:33:02 +02:00
Vladimir Stoilov 05a5d5e350 [service] Fix unit tests 2024-12-06 14:47:24 +02:00
Vladimir Stoilov 22253c4e9e [service] Fix windows permissions 2024-12-06 12:00:20 +02:00
Daniel 706ce222d0 WIP 2024-11-27 16:16:15 +01:00
Vladimir Stoilov 943b9b7859 Fix file permissions on windows (#1758)
* [service] Set file permissions on windows

* [service] Fix minor windows permission bugs

* [service] Fix permission bugs

* [service] Fix windows non admin user start
2024-11-26 17:00:01 +02:00
Daniel f91003d077 [service] Move logging to the core, remove pkg level logs 2024-11-14 17:33:27 +01:00
Daniel 8b1bdc7eb1 WIP 2024-11-13 15:18:32 +01:00
Daniel ddf7ba170e Fix tests and issues 2024-11-08 14:39:58 +01:00
Daniel 2d0d711938 Improve starting and stopping 2024-11-08 14:39:28 +01:00
Daniel 34894ea7d6 Add sign command to updatemgr 2024-11-08 14:38:36 +01:00
Daniel c22814e6e1 Improve start and shutdown controls and flow 2024-11-07 16:20:58 +01:00
Daniel 7bc1c3b764 Replace dataroot module with BinDir and DataDir on instance, adapt modules 2024-11-06 10:48:02 +01:00
Daniel 0f3f3c360f [WIP] Simplify update system 2024-10-31 16:38:12 +01:00
Daniel d6669ff8f5 Remove unpack suffixes when generating an index bundle 2024-10-16 13:51:38 +02:00
Daniel a1a4bf6325 [WIP] Use cobra for updatemgr 2024-10-10 08:58:02 +02:00
Daniel 5d9088f27e [WIP] Improve bundle generation 2024-10-09 16:50:46 +02:00
Vladimir Stoilov a874ec9412 [WIP] Fix unit tests 2024-10-08 14:13:08 +03:00