API Architecture
Control Plane
Configuration, reporting, and management operations
Data Plane
Package insights, scanning data, and tool integrations
All APIs for security tools integration are part of the Data Plane. These APIs require an API key for authentication and may enforce rate limits under a fair usage policy.
API Endpoints and Authentication
Plane | API Endpoint | Supported Authentication |
---|---|---|
Data Plane | api.safedep.io | JWT and API Key |
Control Plane | cloud.safedep.io | JWT |
Data Plane Authentication
API Key Authentication
The most common method for tool integrations and automated access:1
Generate API Key
Create an API key in your SafeDep Cloud tenant settings
2
Configure Environment
Set the API key in your environment:
3
Use with vet
Configure vet to use the API key:
JWT Authentication
For programmatic access requiring higher privileges:Control Plane Authentication
OAuth2/OIDC Integration
SafeDep Cloud Identity Service is hosted athttps://auth.safedep.io
and provides OAuth2/OIDC compatible authentication.
OpenID Configuration Endpoint:
Device Code Flow
For command-line tools, use the OAuth2 Device Code flow:Programmatic Integration
For custom applications, implement OAuth2 Device Code flow. Reference implementation available in the vet OAuth2 client.Authentication Examples
Basic API Key Usage
JWT-Based Access
GitHub Actions Integration
Authentication Headers
API Key Authentication
JWT Authentication
Rate Limiting
Data Plane Limits
- API Key Authentication: Fair usage policy applies
- Rate limits: 1000 requests per hour per API key
- Burst capacity: 50 requests per minute
Control Plane Limits
- JWT Authentication: Higher limits for authenticated users
- Rate limits: 5000 requests per hour per user
- Burst capacity: 100 requests per minute
Security Best Practices
API Key Management
API Key Management
- Store API keys securely using environment variables or secret management systems
- Rotate API keys regularly (recommended: every 90 days)
- Use different API keys for different environments (dev, staging, prod)
- Never commit API keys to version control
JWT Token Handling
JWT Token Handling
- JWT tokens have limited lifetime (typically 24 hours)
- Implement automatic token refresh in long-running applications
- Store tokens securely in the OS keychain when possible
- Clear tokens on logout or application termination
Network Security
Network Security
- Always use HTTPS for API communications
- Implement proper certificate validation
- Consider IP allowlisting for production environments
- Monitor authentication logs for suspicious activity