Authentication overview
Escape provides an API security platform designed to automate the detection and remediation of vulnerabilities in APIs. Access to the Escape platform and its functionalities, including automated API penetration testing and API discovery, is secured through authentication. This process verifies the identity of users and applications making requests to the API, ensuring that only authorized entities can interact with Escape's services and retrieve sensitive security insights. All programmatic interactions with the Escape API require proper authentication to maintain the integrity and confidentiality of security analyses and configurations.
The core principle behind Escape's authentication mechanisms is to enable secure and auditable access for continuous integration/continuous deployment (CI/CD) pipelines, developer tools, and security teams. By integrating authentication directly into these workflows, Escape allows for seamless automation of API security posture management without compromising on security. The API key approach provides a balance between ease of use for developers and the necessary security controls for enterprise environments.
Supported authentication methods
Escape primarily supports API key authentication for programmatic access to its platform. This method is suitable for server-to-server communication, CI/CD pipeline integrations, and scripting where a user or application needs to interact with the Escape API without direct human intervention.
An API key is a unique token that identifies the calling application or user. When making a request to the Escape API, this key is included in the request headers, allowing the API to verify the sender's identity and permissions. The Escape documentation provides detailed steps for using API keys, including how to generate and manage them securely within the platform's interface. For general guidance on API key security, refer to the Google Cloud API keys documentation which describes best practices for protecting API keys.
The following table summarizes the primary authentication method supported by Escape for API interactions:
| Method | When to Use | Security Level |
|---|---|---|
| API Key | Programmatic access, CI/CD integrations, scripts, server-to-server communication | Moderate (requires secure storage and transmission) |
For user interface access, Escape typically relies on standard web authentication flows, which may include username/password combinations, multi-factor authentication (MFA), and potentially single sign-on (SSO) integrations, depending on enterprise configurations. However, for direct API consumption, API keys are the established method.
Getting your credentials
To obtain your API key for Escape, you will need to access the Escape web application and navigate to the appropriate settings section. The process typically involves:
- Logging into the Escape Platform: Use your established organizational credentials to log into the Escape web interface at escape.tech homepage.
- Navigating to API Settings: Look for a section related to 'API Settings', 'Integrations', or 'User Profile' where API keys can be managed. This is usually found in the administrative or account management areas of the dashboard.
- Generating an API Key: Within the API settings, there will be an option to generate a new API key. When generating a key, you may be prompted to provide a name or description for the key, which helps in identifying its purpose later.
- Copying and Securing the Key: Once generated, the API key will be displayed. It is crucial to copy this key immediately and store it securely, as it may only be shown once for security reasons. Treat your API key with the same level of confidentiality as you would a password.
For specific, step-by-step instructions with screenshots, always refer to the official Escape documentation on API key management. The documentation will provide the most current and accurate guidance for your version of the Escape platform.
Authenticated request example
Once you have obtained your API key, you can use it to make authenticated requests to the Escape API. The API key is typically sent in the Authorization header of your HTTP requests, usually prefixed with Bearer. The official Escape API Reference provides detailed endpoints and request formats.
Here's an example of how to make an authenticated request using cURL, a common command-line tool, to fetch a list of your projects within Escape:
curl -X GET \
'https://api.escape.tech/v1/projects' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json'
In this example:
YOUR_API_KEYshould be replaced with the actual API key you generated from the Escape platform.-X GETspecifies the HTTP method, which is GET for retrieving data.'https://api.escape.tech/v1/projects'is the API endpoint to list projects.-H 'Authorization: Bearer YOUR_API_KEY'sets the Authorization header with your API key.-H 'Content-Type: application/json'indicates that the request expects a JSON response.
Similar patterns apply when using the official SDKs (Python, Go, Java, Node.js) provided by Escape. For instance, in Python, you might configure the client with your API key:
import os
from escape_sdk import EscapeClient
# It's recommended to load API keys from environment variables or a secure configuration system
api_key = os.environ.get("ESCAPE_API_KEY")
if api_key:
client = EscapeClient(api_key=api_key)
projects = client.projects.list()
for project in projects:
print(f"Project ID: {project.id}, Name: {project.name}")
else:
print("ESCAPE_API_KEY environment variable not set.")
This Python snippet demonstrates initializing the Escape SDK client with an API key (preferably loaded from an environment variable for security) and then using it to list projects. Always consult the specific SDK documentation for the most accurate and up-to-date usage examples and best practices.
Security best practices
Securing your API keys and authentication credentials is paramount to maintaining the security of your API testing and data within Escape. Adhering to these best practices will help prevent unauthorized access and potential breaches:
- Store API Keys Securely: Never hardcode API keys directly into your source code. Instead, use environment variables, secret management services (like AWS Secrets Manager, Azure Key Vault, Google Secret Manager), or secure configuration files. This prevents keys from being exposed in version control systems or publicly accessible repositories. For guidance on environment variables, refer to the MDN Web Docs definition of environment variables.
- Rotate API Keys Regularly: Periodically generate new API keys and revoke old ones. This practice limits the window of exposure for any compromised key and is a standard security measure. Establish a rotation policy that aligns with your organization's security requirements.
- Limit API Key Permissions (Least Privilege): If Escape offers granular permissions for API keys, configure them to have only the minimum necessary permissions required for their intended function. For example, a key used for reading project status should not have permissions to delete projects.
- Monitor API Key Usage: Regularly review access logs and audit trails provided by Escape to detect any unusual or unauthorized use of your API keys. Anomalous usage patterns can indicate a compromised key.
- Use HTTPS for All API Calls: Ensure all communications with the Escape API happen over HTTPS. This encrypts data in transit, protecting your API key and other sensitive information from interception. Escape's API endpoints are designed to enforce HTTPS.
- Implement IP Whitelisting (if available): If Escape allows, restrict API key usage to specific IP addresses or ranges. This ensures that even if a key is stolen, it can only be used from trusted network locations.
- Avoid Sharing API Keys: API keys should be treated as personal or application-specific credentials. Avoid sharing them unnecessarily among team members or across different applications.
- Secure Your Build and Deployment Environments: Ensure that your CI/CD pipelines and deployment environments, where API keys might be used or configured, are themselves secured and follow best practices for secret management.
By diligently following these security best practices, you can significantly reduce the risk associated with API key management and ensure that your integration with Escape remains secure.