Overview
The Audit Log API provides endpoints for retrieving audit logs to track user activities, system changes, and assessment modifications. This is essential for compliance, security auditing, and understanding historical changes within the Faction platform. All endpoints require Admin role permissions and authentication via theFACTION-API-KEY header.
Get Audit Log by Date Range
Authentication
API authentication key (requires Admin role)
Form Parameters
Start date for audit log retrieval (YYYY-MM-DD format)
End date for audit log retrieval (YYYY-MM-DD format)
Response
Returns an array ofAuditLog objects ordered by timestamp.
Audit log entry ID
When the action occurred
Username who performed the action
Component name (e.g., “Assessment”, “Vulnerability”, “User”)
Component ID (e.g., assessment ID, vulnerability ID)
Action performed (e.g., “CREATE”, “UPDATE”, “DELETE”)
Additional details about the action
Status Codes
200- Success: Audit log returned401- Not authorized (requires Admin role)
Get Assessment Audit Logs
Authentication
API authentication key (requires Admin role)
Form Parameters
Start date for audit log retrieval (YYYY-MM-DD format)
End date for audit log retrieval (YYYY-MM-DD format)
Response
Returns an array ofAuditLog objects filtered to assessment-related events, ordered by timestamp.
Included Activities
- Assessment creation
- Assessment updates (notes, summary, status changes)
- Assessment assignments
- Assessment completions
- Assessment deletions
Status Codes
200- Success: Audit log returned401- Not authorized (requires Admin role)
Get Audit Log for Specific Assessment
Path Parameters
Assessment ID
Authentication
API authentication key (requires Admin role)
Form Parameters
Start date for audit log retrieval (YYYY-MM-DD format)
End date for audit log retrieval (YYYY-MM-DD format)
Response
Returns an array ofAuditLog objects for the specified assessment, ordered by timestamp.
Use Cases
- Compliance: Track all changes to a specific assessment
- Troubleshooting: Investigate issues with a particular assessment
- Audit Trail: Provide evidence of assessment lifecycle for reports
- Change History: Review who made what changes and when
Status Codes
200- Success: Audit log returned401- Not authorized (requires Admin role)
Get User Activity Log
Authentication
API authentication key (requires Admin role)
Form Parameters
Username to retrieve activity for
Start date for audit log retrieval (YYYY-MM-DD format)
End date for audit log retrieval (YYYY-MM-DD format)
Response
Returns an array ofAuditLog objects for the specified user, ordered by timestamp.
Tracked Activities
- Login/logout events
- Assessment access and modifications
- Vulnerability creation and updates
- Report generation
- Configuration changes
- User management actions
Use Cases
- User Productivity: Track assessor activity and output
- Security Investigation: Investigate suspicious user behavior
- Performance Review: Review user contributions and activity
- Compliance: Demonstrate user actions for audit purposes
Status Codes
200- Success: User activity log returned401- Not authorized (requires Admin role)
Audit Log Entry Structure
Component Names
Common values for thecompname field:
Assessment- Assessment-related activitiesVulnerability- Vulnerability changesUser- User account modificationsTeam- Team managementCampaign- Campaign changesSettings- System configurationReport- Report generation
Action Types
Common values for theaction field:
CREATE- New entity createdUPDATE- Entity modifiedDELETE- Entity removedLOGIN- User loginLOGOUT- User logoutACCESS- Entity accessed/viewedEXPORT- Data exportedIMPORT- Data imported
Example Entry
Filtering and Analysis
Date Range Queries
All endpoints support date range filtering to limit results:Analyzing Results
Common analysis patterns: Activity by UserCompliance and Reporting
Compliance Requirements
The Audit Log API helps meet compliance requirements for:- SOC 2: Demonstrating access controls and change tracking
- ISO 27001: Evidence of security monitoring and logging
- PCI DSS: Tracking access to sensitive data
- HIPAA: Healthcare data access auditing
- GDPR: Data processing activity records
Generating Compliance Reports
Best Practices
Regular Exports
- Export audit logs regularly for long-term retention
- Store exported logs in immutable storage
- Maintain logs according to compliance requirements (typically 7 years)
Monitoring
- Set up alerts for suspicious activities
- Monitor failed access attempts
- Track unusual patterns in user behavior
Integration
Access Control
- Limit audit log access to administrators only
- Use separate API keys for audit log access
- Monitor who accesses the audit logs themselves
Authorization Requirements
All Audit Log API endpoints require:- Valid
FACTION-API-KEYheader - Admin role permissions
- Date range parameters
Limitations
- Results are ordered by timestamp (ascending)
- Date range is required for all queries
- Large date ranges may return substantial data
- Consider pagination for very large result sets
Security Considerations
- Audit logs contain sensitive information about system usage
- Ensure audit log API keys are stored securely
- Never expose audit logs to non-administrative users
- Audit logs themselves should be monitored for unauthorized access
- Export logs regularly to prevent data loss
