Repository navigation
Releases
Releases · majestrate/procmon
v0.4.1
Changes since v0.4.0.
API socket:
procmon-api.servicesetsRuntimeDirectory=procmon, so systemd creates/run/procmonand the service can create its socket there.MemoryMaxis1G.
Token endpoint:
- Concurrent Argon2 secret checks on
POST /oauth/tokenshare one process-wide limit, including across a configuration reload. A request that arrives while that limit is full receives503withRetry-After: 1and errortemporarily_unavailable.
LXC discovery:
- A cgroup directory that disappears during the scan is skipped. Discovery continues with the payload directories that are still present.
Build:
- The dev package workflow runs when commits land on
dev. The release package workflow runs on a tag push. This release attachesprocmon_0.4.1-1_amd64.debandprocmon_0.4.1-1_arm64.deb.
v0.4.0
Changes since v0.3.1.
Process and thread identity:
- Each aggregate is keyed by the thread-group id, the thread id, and the comm captured when the call starts. A rename does not merge two names.
- Those three values are stored in
pid_comm.syscall_statsreferences that row. The collector applies the schema migrations when it opens the database, including a database written by 0.3.1. - A row recorded before process ids has a null
pid. A row recorded before thread ids has a nulltid. GET /v1/syscall-statsreturnspidandtidand accepts those names as query parameters. One comm can now be several rows. Summingcallsacross those rows is the previous total.- A query that read
commfromsyscall_statsnow joinspid_comm. The schema is documented in procmon(5).
aarch64:
- The collector and the API are built for x86-64 and aarch64. Go and Debian call the aarch64 machine arm64. This release attaches
procmon_0.4.0-1_amd64.debandprocmon_0.4.0-1_arm64.deb. GET /v1/syscallsreturns the syscall numbers for the ABI of the binary that is serving them. The aarch64 numbers are not the x86-64 numbers.- Authenticated
GET /v1/archreturnsmachine(x86_64oraarch64) andgoarch(amd64orarm64). procmon.serviceandprocmon-api.servicestart on either machine.
Manuals:
- procmon-api(1) is the command. procmon-api(8) is the HTTP service. procmon(5) is the metrics database. procmon-agents(7) is the agent-facing description. procmon(8) remains the collector.
Build:
- A tag push runs the unit tests on x86_64 and aarch64, then builds both packages and attaches them here.
v0.3.1
Changes since the initial commit.
procmon 0.3.1 monitors system calls made by processes inside LXC containers for audit purposes and writes the totals to SQLite. The package is x86-64 and expects cgroup v2.
Collector:
- An eBPF program attaches to the raw syscall tracepoint. A task is counted when a cgroup v2 ancestor is a directory named
lxc.payload.<name>. The innermost match wins, so nested LXC is attributed to the inner container. Docker containers andlxc.monitor.*are omitted. - Aggregates stay in a per-CPU kernel map keyed by container cgroup, process comm, and syscall number. Each flush writes that window to SQLite.
callscounts entries,errorscounts returns in [-4095, -1], andtotal_nsis the time spent in the call. - Configuration is TOML,
/etc/procmon/procmon.tomlby default.retainof0keeps every row. A duration such as168hdeletes older samples. The installed file sets0. When the key is omitted, the default is168h. - The systemd unit runs as root with
CAP_BPF,CAP_PERFMON,CAP_SYS_ADMIN, andCAP_SYS_RESOURCE.CAP_SYS_ADMINis what lets tracepoint attach succeed on Debian kernels. SIGINTandSIGTERMflush the current window and exit.SIGHUPrereads the TOML file and applies it. If the file cannot be read or the configuration is invalid, the running configuration is left unchanged. After a successful reload, payload cgroups are rescanned and the current window is flushed.vacuum_intervalrewrites the database on that interval and returns pages freed by retention to the OS.0disables it. The default is0.vacuum_on_startrewrites the database once, after it is opened and before cgroup discovery or tracepoint attach. A failure stops the process. The default is false. A reload does not vacuum again.
API:
procmon-apireads the metrics database and serves it over HTTP on a unix socket,/run/procmon/api.sockby default. It does not terminate TLS.procmon.targetstarts the collector and the API. tmpfiles creates/run/procmonfor the socket.- The process is its own OAuth authorization server. The grant is
client_credentials, and tokens are RS256 JWTs. Client ids and Argon2i secret hashes live in a separate SQLite database.client addprints the secret once. base_urlis the publichttpsURL, including an optional path prefix. Withhttps://procmon.example/procmon, data routes are under/procmon/v1/and the discovery document isGET /.well-known/oauth-authorization-server/procmon.- Authenticated routes are
GET /v1/syscall-stats,GET /v1/flushes, andGET /v1/syscalls. The syscall route returns the assigned x86-64 syscall numbers and names.GET /openapi.json, the JWKS document, and token request are unauthenticated.sinceanduntilare RFC3339 timestamps or a Go duration such as1h. SIGHUPrereads the API configuration. A read or validation error leaves the running configuration unchanged.SIGINTandSIGTERMclose the socket and exit.systemctl reload procmon-apisendsSIGHUP.
Build and release:
make buildgenerates the eBPF object, builds both binaries, and writesdist/procmon_<version>-1_amd64.deb.- The package version can be injected at build time. A branch push builds a dev package whose version is
<version>-dev.gplus the 12-character git hash, so it sorts before the release package of the same version. - A tag push runs the unit tests and, after they pass, attaches the release package here.
- eBPF generation on Debian and Ubuntu installs
llvmforllvm-stripand passes the multiarch include directory soasm/types.his found.