Authentication event logging
Track successful logins with IP address, user agent, timestamp and location — the auditable events OWASP A09 expects you to record.
Why it matters
Every login your app accepts is invisible until you record it. This bundle logs each one — IP, device, location — and alerts the user the moment a context looks new.
The #1 symptom of OWASP A09:2021
“Auditable events, such as logins, failed logins, and high-value transactions, are not logged.”
An attacker with a stolen password doesn’t fail to log in — they succeed, silently. Recording every login context is the only way to see it, and this bundle closes that gap.
Read the security rationale →Track successful logins with IP address, user agent, timestamp and location — the auditable events OWASP A09 expects you to record.
Why it matters
Enrich logs with a city and country from a local GeoIP2 database — no outbound call, nothing to leak.
Pick a provider
Alert users when a login from an unknown context is detected, with an overridable Twig template.
Customize the email
Move geolocation lookups and email sending out of the request, so logins stay fast.
Go async
No factory or listener boilerplate — implement two interfaces in your repository and you are done.
See the repository
Replace email with Slack, SMS or anything else through a single interface, and react to events.
Plug your own transport
One command, four lines of YAML, two interfaces to implement — the rest is automatic.
composer require spiriitlabs/auth-log-bundle# config/packages/spiriit_auth_log.yaml
spiriit_auth_log:
transports:
sender_email: 'no-reply@yourdomain.com'
sender_name: 'Security'
location:
provider: 'geoip2'
geoip2_database_path: '%kernel.project_dir%/var/GeoLite2-City.mmdb'