Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Shadow Logger Bundle Laravel Package

aubes/shadow-logger-bundle

Symfony bundle adding a Monolog processor to transform/anonymize sensitive log data for GDPR compliance. Supports IP anonymization, hashing, encryption, and field removal via configurable mappings for context/extra, with strict and debug modes.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • GDPR/Compliance Roadmap: Enables pseudonymization and anonymization of PII (Personally Identifiable Information) in logs, aligning with EU GDPR, CCPA, or other privacy regulations. Critical for SaaS platforms handling user data across regions.
  • Security Hardening: Reduces exposure of sensitive data in logs (e.g., IPs, tokens, PII) to developers, admins, or third-party log analysis tools. Mitigates risks from log leaks or unauthorized access.
  • Build vs. Buy: Avoids reinventing log anonymization wheels. Leverages a battle-tested Monolog processor (used in Symfony) with configurable transformers (hashing, encryption, truncation) instead of custom scripts or ad-hoc solutions.
  • Use Cases:
    • Debugging: Safely log user sessions without exposing PII in production environments.
    • Audit Trails: Correlate user activity via hashed identifiers while complying with data retention policies.
    • Third-Party Integrations: Share logs with partners/vendors without disclosing sensitive fields.
    • Incident Response: Encrypt logs for forensic analysis while preserving reversibility for GDPR requests.
  • Performance Optimization: Scope the processor to specific log handlers/channels (e.g., app handler) to minimize overhead in high-throughput systems.
  • Extensibility: Custom transformers or encryptors allow tailoring to niche requirements (e.g., HIPAA-compliant PHI handling).

When to Consider This Package

  • Adopt When:

    • Your application logs contain sensitive data (IPs, emails, tokens, payment details) that must comply with privacy laws.
    • You use Symfony 6/7/8 or Laravel with Monolog and need a lightweight, configurable solution.
    • Your team lacks dedicated cryptography expertise but requires reversible encryption (for GDPR right-of-access) or hashing (for pseudonymization).
    • You prioritize log integrity over minimal performance impact (transformers add ~5–15ms per log entry, depending on complexity).
    • You want to future-proof against regulatory changes (e.g., easy to add new transformers or rotate encryption keys).
  • Look Elsewhere If:

    • You need real-time log processing (e.g., ELK stack with Logstash filters) and prefer centralized anonymization over application-level.
    • Your logs are extremely high-volume (e.g., >10K logs/sec), and the overhead of per-entry transformation is prohibitive. Consider sampling or edge-side anonymization.
    • You require quantum-resistant encryption (this package uses AES-256-CBC, not post-quantum algorithms).
    • Your stack is non-PHP (e.g., Node.js, Python) or uses a different logging library (e.g., Log4j, Winston).
    • You need dynamic anonymization rules (e.g., based on user role or request context) that can’t be statically configured in YAML.
    • Your compliance requirements mandate on-premise log storage with no cloud-based encryption keys (this package assumes key management via .env).

How to Pitch It (Stakeholders)

For Executives:

"This package lets us log user activity for debugging and analytics without storing or exposing sensitive data—critical for GDPR compliance and reducing legal risk. For example, we can trace a user’s session across requests using a hashed ID instead of their email, while still being able to correlate events. It’s a lightweight, maintainable solution that avoids custom code and integrates seamlessly with our existing logging infrastructure. The cost? Minimal development effort and a one-time setup for encryption keys. The payoff? Peace of mind that our logs won’t accidentally leak PII, and the flexibility to adapt to future privacy regulations."

Key Metrics to Track:

  • Reduction in PII exposure risk (qualitative).
  • Compliance audit pass rates (e.g., GDPR assessments).
  • Developer time saved (no reinventing log anonymization).

For Engineering/DevOps:

*"The Shadow Logger Bundle is a Symfony-compatible Monolog processor that anonymizes sensitive log data using configurable transformers (hashing, encryption, IP masking, etc.). Here’s why it’s a win:

  • GDPR-Ready: Hashes PII for pseudonymization or encrypts it for reversibility (e.g., to fulfill right-of-access requests).
  • Performance: Lightweight (~5–15ms overhead per log entry) and scoped to specific handlers/channels (e.g., only app handler) to avoid global slowdowns.
  • Flexible: Supports chaining transformers (e.g., ['string', 'hash']) and custom implementations for edge cases.
  • Secure by Default: Uses OpenSSL encryption with environment-variable keys and fails securely (configurable strict mode).
  • Easy to Deploy: Drop-in YAML config for Symfony/Laravel; no complex setup.

Trade-offs:

  • Not real-time (transforms logs at write time, not during analysis).
  • Encryption keys must be managed securely (use Laravel’s .env or a secrets manager).

Next Steps:

  1. Pilot: Enable for a non-critical handler (e.g., audit) and validate log quality.
  2. Key Management: Store SHADOW_LOGGER_ENCODER_SALT and SHADOW_LOGGER_ENCRYPTOR_KEY in our secrets vault.
  3. Monitor: Check for transformer failures in shadow-debug mode (dev-only).

Alternatives Considered:

  • Custom Monolog processors (higher maintenance).
  • Third-party SIEM tools (overkill for app-level anonymization).
  • No solution (higher compliance risk)."*

For Legal/Compliance: *"This tool addresses two core GDPR requirements:

  1. Pseudonymization (Article 4.5): Hashing user identifiers (e.g., emails, IPs) ensures logs can’t be linked to individuals without additional context.
  2. Right of Access (Article 15): Encrypted fields can be decrypted for authorized requests while keeping logs secure.

Limitations to Note:

  • Hashed data cannot be reversed (use encryption for GDPR right-of-access).
  • Keys must be rotated securely (document this in your key management policy).
  • Logs remain on-disk—ensure your storage meets retention/deletion policies.

Recommendation: Approve for production use with the condition that we audit log samples post-deployment to confirm anonymization effectiveness."*

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route