This documentation provides detailed information about each module in the Darktrace SDK and how to use them.
from darktrace import DarktraceClient
# Initialize the client
client = DarktraceClient(
host="https://your-darktrace-instance",
public_token="YOUR_PUBLIC_TOKEN",
private_token="YOUR_PRIVATE_TOKEN",
debug=False # Set to True for verbose output
)The Darktrace SDK provides access to all Darktrace API endpoints through the following modules:
- Advanced Search - Complex search operations across the Darktrace platform
- AI Analyst - AI Analyst incidents and investigations
- Antigena - Antigena actions and configurations
- Model Breaches - Model breach alerts and information
- Components - Darktrace component information
- CVEs - CVE information related to devices
- Details - Detailed information about specific entities
- Device Info - Detailed device information
- Devices - Device management and information
- Device Search - Search for devices with specific criteria
- Device Summary - Summarized device information
- Email - Darktrace Email security features
- Endpoint Details - Endpoint-specific information
- Enums - Enumeration values used in the Darktrace platform
- Filter Types - Available filter types for searches
- Intel Feed - Threat intelligence feed information
- Model Breach Comments - Comments on model breaches
- Metric Data - Time-series metric data
- Metrics - Available metrics and their information
- Models - Darktrace models and their configurations
- Network - Network information and statistics
- PCAPs - Packet capture functionality
- Similar Devices - Find devices similar to a given device
- Status - System status information
- Subnets - Subnet information and management
- Summary Statistics - Overall system statistics
- Tags - Tag management for devices and entities
The SDK handles authentication automatically using the provided public and private tokens. See Authentication for more details.
try:
devices = client.devices.get()
except Exception as e:
print(f"Error: {e}")Enable debug mode to see detailed API requests and responses:
client = DarktraceClient(
host="https://your-darktrace-instance",
public_token="YOUR_PUBLIC_TOKEN",
private_token="YOUR_PRIVATE_TOKEN",
debug=True # Enable debug output
)