Audit Logs
Audit logs provide a detailed record of actions taken within your organization. Use them for security monitoring, compliance, and troubleshooting.
Overview
Teabar logs administrative and operational events:
- Authentication Events - Logins, logouts, failed attempts
- Member Actions - Invites, role changes, removals
- Environment Operations - Create, start, stop, delete
- API Key Usage - Creation, revocation, API calls
- Configuration Changes - Organization and project settings
- Blueprint Operations - Create, update, publish
Viewing Audit Logs
Via Web Console
- Go to Organization Settings > Audit Logs
- Use filters to narrow results:
- Date range
- Actor (who performed the action)
- Action type
- Resource type
- Click entries for details
Via CLI
# List recent events
teactl activity list --type audit
# Filter by actor
teactl activity list --type audit --actor [email protected]
# Filter by action
teactl activity list --type audit --action member.invite
# Filter by date range
teactl activity list --type audit --since 2024-03-01 --until 2024-03-10
# Export to JSON
teactl activity list --type audit -o json > audit-log.json Event Types
Authentication Events
| Event | Description |
|---|---|
auth.login | Successful login |
auth.logout | User logged out |
auth.login_failed | Failed login attempt |
auth.token_created | API key created |
auth.token_revoked | API key revoked |
Member Events
| Event | Description |
|---|---|
member.invited | Member invitation sent |
member.joined | Member accepted invitation |
member.role_changed | Member role updated |
member.removed | Member removed from organization |
Environment Events
| Event | Description |
|---|---|
environment.created | Environment created |
environment.started | Environment started |
environment.stopped | Environment stopped |
environment.deleted | Environment deleted |
environment.checkpoint_created | Checkpoint created |
Organization Events
| Event | Description |
|---|---|
organization.settings_updated | Org settings changed |
project.created | Project created |
project.deleted | Project deleted |
blueprint.created | Blueprint uploaded |
blueprint.published | Blueprint published to catalog |
Event Details
Each audit event includes:
| Field | Description |
|---|---|
timestamp | When the event occurred |
actor | Who performed the action |
action | Type of action |
resource | What was affected |
details | Additional context |
ip_address | Source IP (when available) |
user_agent | Client information |
Example Event
{
"id": "evt_abc123",
"timestamp": "2024-03-10T14:30:00Z",
"actor": {
"type": "user",
"id": "user_xyz",
"email": "[email protected]"
},
"action": "member.invited",
"resource": {
"type": "invitation",
"id": "inv_def456"
},
"details": {
"invitee_email": "[email protected]",
"role": "member"
},
"ip_address": "192.168.1.100",
"user_agent": "teactl/1.2.0"
} Log Retention
Retention periods vary by plan:
| Plan | Retention |
|---|---|
| Free | 30 days |
| Pro | 1 year |
| Enterprise | 7 years (configurable) |
Note
Tamper-Evident Security
Teabar audit logs are cryptographically secured to ensure integrity and support compliance requirements.
How It Works
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Entry N-1 │────►│ Entry N │────►│ Entry N+1 │
│ │ │ │ │ │
│ hash: abc.. │ │ prev: abc.. │ │ prev: def.. │
│ signature │ │ signature │ │ signature │
└─────────────┘ └─────────────┘ └─────────────┘ Security guarantees:
- Each entry includes hash of previous entry (chain)
- Each entry is individually signed with Ed25519
- Chain breaks are detectable
- Signatures prevent modification
Verify Log Integrity
# Verify recent logs
teactl audit verify --since 7d
# Full verification with report
teactl audit verify --from 2024-01-01 --to 2024-03-31 --full
# Output:
# Verifying audit log integrity for my-company
#
# Entries verified: 15,234
# Chain integrity: ✓ Valid
# Signatures: ✓ All valid (3 signing keys used)
# Gaps detected: 0
#
# Verification completed successfully. Signing Keys
Audit logs are signed with Ed25519 keys stored in OpenBao:
- Keys rotated monthly by default
- Old keys retained for verification
- Key ceremony required for initial setup (Enterprise)
Legal Hold
Prevent deletion of logs for legal/compliance purposes:
# Set legal hold
teactl audit legal-hold set --reason "Investigation 2024-001" --until 2024-12-31
# View active holds
teactl audit legal-hold list
# Remove hold (requires admin)
teactl audit legal-hold remove --id hold_abc123 Exporting Audit Logs
Single Export
# Export last 30 days to JSON
teactl activity list --type audit --since 30d -o json > audit-30d.json
# Export as CSV
teactl activity list --type audit -o csv > audit-log.csv Continuous Export
For compliance requirements, set up continuous export to external systems:
Webhook Integration:
Configure a webhook to receive events in real-time:
- Go to Organization Settings > Integrations
- Click “Add Webhook”
- Enter your endpoint URL
- Select event types to receive
- Save
Events are sent as CloudEvents format:
{
"specversion": "1.0",
"type": "dev.teabar.audit.member.invited",
"source": "teabar.dev/org/acme-corp",
"id": "evt_abc123",
"time": "2024-03-10T14:30:00Z",
"data": {
// Event details
}
} Monitoring and Alerts
Setting Up Alerts
Configure alerts for sensitive actions:
- Go to Organization Settings > Alerts
- Click “Create Alert”
- Select trigger conditions:
- Action type (e.g.,
member.removed) - Actor filters
- Frequency thresholds
- Action type (e.g.,
- Choose notification method:
- Slack
- Webhook
- Save
Common Alert Configurations
| Alert | Condition |
|---|---|
| Admin login from new IP | auth.login + admin + new IP |
| Multiple failed logins | auth.login_failed > 5 in 10 min |
| Member removal | Any member.removed event |
| API key created | Any auth.token_created event |
| Organization settings changed | organization.settings_updated |
Compliance Use Cases
SOC 2
Audit logs support SOC 2 compliance by providing:
- Access logging (who accessed what)
- Change management records
- Security event tracking
GDPR
For data subject requests:
- Export user activity records
- Document data access history
- Track data deletion events
Internal Audits
Regular audit reviews should check:
- Unusual login patterns
- Privilege escalations
- Resource access patterns
- API key usage
Best Practices
Regular Reviews
- Weekly - Review failed login attempts
- Monthly - Audit member access and roles
- Quarterly - Full access review
Monitoring Setup
- Enable alerts for critical actions
- Export logs to SIEM for correlation
- Set up dashboards for visibility
Investigation Process
When investigating incidents:
- Identify the timeframe
- Filter logs by actor or resource
- Build timeline of events
- Correlate with other sources
- Document findings
Troubleshooting
Missing Events
- Check retention period
- Verify filter criteria
- Ensure events fall within date range
Export Failures
- Check API key permissions
- Verify network connectivity
- Try smaller date ranges
Webhook Not Receiving
- Verify endpoint URL
- Check webhook secret
- Review endpoint logs for errors
See Also
- API Keys - API key management
- Members - Member management
- Activity Tracking - Participant activity