iq2i / vigie-bundle
Emits who did what, when and from where in your Symfony application as ECS-formatted NDJSON, ready for a SIEM — an opt-in, GDPR-aware activity log
Package info
Type:symfony-bundle
pkg:composer/iq2i/vigie-bundle
Requires
- php: >=8.3
- monolog/monolog: ^3.0
- psr/cache: ^2.0|^3.0
- psr/event-dispatcher: ^1.0
- psr/log: ^2.0|^3.0
- symfony/clock: ^6.4|^7.4|^8.0
- symfony/config: ^6.4|^7.4|^8.0
- symfony/dependency-injection: ^6.4|^7.4|^8.0
- symfony/event-dispatcher: ^6.4|^7.4|^8.0
- symfony/http-foundation: ^6.4|^7.4|^8.0
- symfony/http-kernel: ^6.4|^7.4|^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.52
- masterminds/html5: ^2.7.5
- phpstan/phpstan: ^2.2.2
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^10.5
- symfony/browser-kit: ^6.4|^7.4|^8.0
- symfony/cache: ^6.4|^7.4|^8.0
- symfony/console: ^6.4|^7.4|^8.0
- symfony/framework-bundle: ^6.4|^7.4|^8.0
- symfony/http-client: ^6.4|^7.4|^8.0
- symfony/phpunit-bridge: ^7.4|^8.0
- symfony/routing: ^6.4|^7.4|^8.0
- symfony/security-bundle: ^6.4|^7.4|^8.0
- symfony/twig-bundle: ^6.4|^7.4|^8.0
- symfony/uid: ^6.4|^7.4|^8.0
- symfony/web-profiler-bundle: ^6.4|^7.4|^8.0
- twig/twig: ^3.4
Suggests
- phpunit/phpunit: To use the assertions shipped in IQ2i\VigieBundle\Test (see doc/testing.md)
- symfony/console: To use the vigie:* console commands
- symfony/http-client: To poll a SIEM's decisions with the built-in CrowdSec provider (see doc/threat.md)
- symfony/monolog-bundle: To configure a custom Monolog handler for iq2i_vigie.output.handlers (see doc/storage.md)
- symfony/routing: To redirect to a route from iq2i_vigie.threat.enforce.remediations, or to expose the threat ingest endpoint by importing @IQ2iVigieBundle/config/routes.php (see doc/threat.md)
- symfony/security-csrf: To record CSRF token failures outside the login form (see doc/recording.md)
- symfony/security-http: To track login, logout and switch user events
- symfony/uid: To generate RFC 4122 request ids for correlation instead of falling back to random bytes
- symfony/web-profiler-bundle: To show the Vigie panel in the debug toolbar
Provides
None
Conflicts
None
Replaces
None
README
Emits who did what, when and from where in your Symfony application: an opt-in, GDPR-aware activity log, written as ECS (Elastic Common Schema) NDJSON for a SIEM to consume — never queried back from the application itself.
- Records HTTP requests (opt-in), security events (login, logout, switch user) and your own business
events, as a stream of
Activityobjects, immediately written out — see doc/recording.md. - Reads back the decisions a SIEM (CrowdSec today) makes about suspicious IPs, ranges, sessions, users,
countries and AS numbers, through
ThreatCheckerInterface, an opt-in enforcement listener, and a signed push endpoint for a SIEM that can't be polled — the return path for whatever consumed the activity stream above. Nothing here is on unless you turn it on; see doc/threat.md. - Ships no HTML dashboard, no read API, and no entity-change auditing — the ECS output is the interface; see doc/siem.md for consuming it, or damienharper/auditor-bundle for entity diffs.
- Requires PHP 8.3+ and Symfony 6.4/7.4/8.x. No database: activities are written through Monolog to a plain NDJSON file (the default) or a stdout stream for containers.
Quickstart
composer require iq2i/vigie-bundle
// config/bundles.php return [ // ... IQ2i\VigieBundle\IQ2iVigieBundle::class => ['all' => true], ];
That's it — activities start flowing to %kernel.logs_dir%/vigie.jsonl as ECS documents. See
doc/storage.md to point it at stdout or a custom Monolog handler instead.
Security events (login, logout, switch user) are recorded automatically. Opt an HTTP controller in with
#[Track]:
use IQ2i\VigieBundle\Attribute as Vigie; #[Vigie\Track] // opts every action of this controller into recording class AdminDashboardController { // ... }
Record a business event in one line:
$this->recorder->custom('export.completed', ['rows' => 42]); // ActivityRecorderInterface
See doc/recording.md for the rest: processors, the Subject, vetoing a recording.
Documentation
- doc/recording.md — the
Activitymodel, what's recorded automatically, your own activities, processors - doc/storage.md — the default Monolog/ECS storage, writing to stdout or a custom handler, writing your own storage
- doc/siem.md — the ECS field mapping, CrowdSec acquisition, Elastic/Wazuh ingestion
- doc/threat.md — reading back a SIEM's decisions,
ThreatCheckerInterface, opt-in enforcement, the signed push endpoint,vigie:threat:sync/vigie:threat:list, the CrowdSec provider, writing your own - doc/remediation.md — recipes reacting to a decision: revoking a session, locking an account, disabling it, notifying
- doc/configuration.md — full
iq2i_vigie.*reference, optional dependencies - doc/testing.md — testing your own code against vigie, without a database
- doc/recipes.md — listeners for scheb/2fa, symfony/login-link, symfonycasts/reset-password
Versioning and security
Classes marked @internal and final are implementation details and are not covered by
semver; everything else is.
Please do not open a public GitHub issue for a suspected security vulnerability. Instead, report it privately by emailing loic@sapone.fr with a description, steps to reproduce, and the affected commit. You should get an initial response within a few business days.