Security Best Practices
This guide covers security best practices for deploying TealTiger in production environments.Audit Redaction
Use Security-by-Default Configuration
Always configure TealAudit with strong redaction in production:Redaction Levels
Choose appropriate redaction levels based on your security requirements:| Level | Description | Use Case |
|---|---|---|
NONE | No redaction | ❌ Never use in production |
PARTIAL | Redact known PII patterns | ⚠️ Use only if you need partial visibility |
HASH | One-way hash of content | ✅ Recommended for production |
REMOVE | Remove content entirely | ✅ Maximum security |
HASH for inputs/outputs you may need to correlate, and REMOVE for highly sensitive fields.
PII Detection
Enable automatic PII detection to catch sensitive data:- Social Security Numbers (SSN)
- Credit card numbers
- Email addresses
- Phone numbers
- IP addresses
- Custom patterns (regex)
Debug Mode Warning
⚠️ CRITICAL: Never enable debug mode in production:Credential Management
Never Hardcode Secrets
❌ Bad:Use Environment Variables
Store sensitive configuration in environment variables:Rotate Credentials Regularly
Implement credential rotation:- Generate new credentials
- Update environment variables
- Restart application
- Revoke old credentials after grace period
Audit Log Security
Secure Storage
Store audit logs in a secure location with appropriate access controls:Log Rotation
Implement log rotation to prevent disk space issues:Centralized Logging
Send audit logs to a centralized logging system:Audit Log Retention
Define retention policies based on compliance requirements:| Compliance | Minimum Retention | Recommended |
|---|---|---|
| GDPR | 30 days | 90 days |
| HIPAA | 6 years | 7 years |
| SOC 2 | 1 year | 2 years |
| PCI DSS | 1 year | 3 years |
Policy Security
Principle of Least Privilege
Start with deny-all and explicitly allow only what’s needed:Policy Validation
Validate policies before deployment:Policy Testing
Test policies with a comprehensive corpus:Network Security
TLS/SSL for External Connections
Always use TLS for external connections:Firewall Rules
Restrict network access to TealTiger components:Multi-Tenancy Security
Tenant Isolation
Ensure proper tenant isolation:Tenant-Specific Policies
Apply different policies per tenant:Audit Log Segregation
Segregate audit logs by tenant:Access Control
Role-Based Access Control (RBAC)
Implement RBAC for policy management:Audit Access Logs
Log all access to policies and audit logs:Incident Response
Monitoring and Alerting
Set up monitoring for security events:Incident Investigation
Use correlation IDs to investigate incidents:Breach Response
In case of a security breach:-
Immediate Actions:
- Rotate all credentials
- Enable maximum redaction (
RedactionLevel.REMOVE) - Switch all policies to
PolicyMode.ENFORCE - Review audit logs for suspicious activity
-
Investigation:
- Use correlation IDs to trace request flows
- Identify affected tenants/users
- Determine scope of breach
-
Remediation:
- Patch vulnerabilities
- Update policies
- Notify affected parties
- Document lessons learned
Compliance Considerations
GDPR
For GDPR compliance:- Enable PII detection and redaction
- Implement data retention policies
- Provide audit log export for data subject requests
- Document data processing activities
HIPAA
For HIPAA compliance:- Encrypt audit logs at rest and in transit
- Implement access controls and audit trails
- Use strong redaction for PHI
- Maintain audit logs for 6+ years
SOC 2
For SOC 2 compliance:- Implement comprehensive audit logging
- Enable correlation IDs for traceability
- Document security controls
- Regular security reviews
Security Checklist
Before deploying to production:- Audit redaction configured (
HASHorREMOVE) - PII detection enabled
- Debug mode disabled
- Credentials stored in environment variables
- Audit logs stored securely with restricted access
- Log rotation configured
- Policies follow least privilege principle
- Policy tests passing
- TLS enabled for external connections
- Tenant isolation implemented
- Access controls configured
- Monitoring and alerting set up
- Incident response plan documented
- Compliance requirements reviewed

