apt_guard
apt_guard · Query event collection for an external behavioral-security analysis pipeline
Overview
PostgreSQL · 15
Usage
Sources:
apt_guard 1.0 records database activity for a research behavioral-security pipeline. The upstream container uses PostgreSQL 15. The native module collects events; external Python and machine-learning services provide the surrounding analysis and mitigation workflow. This is not an independently validated database firewall.
Collect Events
Configure the shared library and restart PostgreSQL:
Install as a superuser in the monitored database and inspect collected events:
The extension installs tables for users, sessions, events, sequence patterns and alerts. Executor and utility hooks collect command text, timing, outcomes and relation information. The external agent and dashboard require their own deployment; creating the extension does not start them.
Boundaries and Maintenance
Query text can contain sensitive values. Restrict access to collection tables and to the external services, configure retention, and measure collection overhead before using a busy database. Internal collection-table queries are deliberately skipped, so recorded events are not a complete independent audit trail. Errors and transaction behavior can affect persistence; test the failure paths relevant to the workload.
The container example’s credentials are development examples, not production defaults to adopt. The reviewed repository has no license file; no reuse license is assumed. Upgrade the library and SQL objects together, and restart backends that already loaded the old module.