docs(api): use mintlify for API specs

This commit is contained in:
pedrooot
2025-10-30 18:58:05 +01:00
parent f831171a21
commit 77089eba57
136 changed files with 23969 additions and 0 deletions
@@ -0,0 +1,27 @@
---
title: "Check Provider Connection"
api: "POST /api/v1/providers/{id}/connection"
description: "Test the connection to a cloud provider."
---
Verify that Prowler can successfully connect to the cloud provider using the configured credentials.
## Path Parameters
- `id` (required) - UUID of the provider to test
## Example Request
```bash
curl -X POST "https://api.prowler.com/api/v1/providers/{id}/connection" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/vnd.api+json"
```
## Response
Returns a task object. The connection test is performed asynchronously.
<Note>
Use this endpoint after creating or updating a provider to verify the credentials are correct.
</Note>
+293
View File
@@ -0,0 +1,293 @@
---
title: "Create Provider"
api: "POST /api/v1/providers"
description: "Register a new cloud provider with Prowler."
---
Add a new cloud provider (AWS, Azure, GCP, etc.) to your Prowler tenant. This allows Prowler to scan the provider for security findings and compliance violations.
## Use Cases
- **Multi-Cloud Management**: Add multiple cloud accounts to centralize security monitoring
- **Account Onboarding**: Quickly onboard new cloud accounts for security scanning
- **Organization-Wide Coverage**: Add all accounts from AWS Organizations, Azure subscriptions, or GCP projects
- **DevOps Integration**: Automatically register new cloud accounts via CI/CD pipelines
## Request Body
The request follows the JSON:API specification:
```json
{
"data": {
"type": "providers",
"attributes": {
"provider": "aws",
"alias": "Production AWS Account",
"uid": "123456789012"
}
}
}
```
### Attributes
- `provider` (required, string) - Type of cloud provider:
- `aws` - Amazon Web Services
- `azure` - Microsoft Azure
- `gcp` - Google Cloud Platform
- `kubernetes` - Kubernetes clusters
- `m365` - Microsoft 365
- `github` - GitHub organizations
- `oci` - Oracle Cloud Infrastructure
- `alias` (optional, string) - Human-readable name to identify the provider (3-100 characters)
- Examples: "Production AWS Account", "Dev Environment", "Azure Subscription - US"
- `uid` (required, string) - Unique identifier for the provider (3-250 characters):
- AWS: Account ID (12 digits, e.g., "123456789012")
- Azure: Subscription ID (UUID format)
- GCP: Project ID (string)
- Kubernetes: Cluster name
- M365: Tenant ID
- GitHub: Organization name
- OCI: Tenancy OCID
<Note>
**Important:** Provider-specific configuration (credentials, connection details) is managed separately after provider creation. The initial provider creation only requires the `provider`, `alias`, and `uid` fields. Use the provider update endpoint or UI to configure authentication credentials.
</Note>
## Example Requests
### AWS Provider
```bash
curl -X POST "https://api.prowler.com/api/v1/providers" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/vnd.api+json" \
-d '{
"data": {
"type": "providers",
"attributes": {
"provider": "aws",
"alias": "Production AWS - US",
"uid": "123456789012"
}
}
}'
```
### Azure Provider
```bash
curl -X POST "https://api.prowler.com/api/v1/providers" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/vnd.api+json" \
-d '{
"data": {
"type": "providers",
"attributes": {
"provider": "azure",
"alias": "Production Azure Subscription",
"uid": "aaaabbbb-cccc-dddd-eeee-ffff00001111"
}
}
}'
```
### GCP Provider
```bash
curl -X POST "https://api.prowler.com/api/v1/providers" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/vnd.api+json" \
-d '{
"data": {
"type": "providers",
"attributes": {
"provider": "gcp",
"alias": "Production GCP Project",
"uid": "my-gcp-project-id"
}
}
}'
```
## Response
### Success Response (201 Created)
Returns the created provider with full configuration:
```json
{
"data": {
"type": "providers",
"id": "provider-uuid-here",
"attributes": {
"provider": "aws",
"uid": "123456789012",
"alias": "Production AWS - US",
"connection": {
"connected": false,
"last_checked_at": null
},
"inserted_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
"relationships": {
"secret": {
"data": {
"type": "provider-secrets",
"id": "secret-uuid"
}
},
"provider_groups": {
"data": []
},
"scans": {
"data": []
}
}
}
}
```
### Response Fields
- `id` (UUID) - Unique identifier for the provider
- `provider` (enum) - Type of cloud provider: `aws`, `azure`, `gcp`, `kubernetes`, `m365`, `github`, `oci`
- `uid` (string) - Cloud provider account/subscription ID (3-250 characters)
- `alias` (string, nullable) - Human-readable name (3-100 characters)
- `connection` (object, read-only) - Connection status information:
- `connected` (boolean) - Whether provider is connected (initially `false`)
- `last_checked_at` (datetime, nullable) - Last connection verification time
- `inserted_at` (datetime, read-only) - When provider was created
- `updated_at` (datetime, read-only) - Last modification time
### Error Responses
**400 Bad Request** - Invalid configuration
```json
{
"errors": [
{
"status": "400",
"title": "Invalid Configuration",
"detail": "IAM role ARN format is invalid",
"source": {
"pointer": "/data/attributes/configuration/role_arn"
}
}
]
}
```
**409 Conflict** - Provider already exists
```json
{
"errors": [
{
"status": "409",
"title": "Provider Already Exists",
"detail": "A provider with UID '123456789012' already exists in this tenant"
}
]
}
```
**422 Unprocessable Entity** - Validation error
```json
{
"errors": [
{
"status": "422",
"title": "Validation Error",
"detail": "Provider must be one of: aws, azure, gcp, kubernetes, m365, github, oci",
"source": {
"pointer": "/data/attributes/provider"
}
}
]
}
```
**422 Unprocessable Entity** - Invalid UID format
```json
{
"errors": [
{
"status": "422",
"title": "Validation Error",
"detail": "UID must be between 3 and 250 characters",
"source": {
"pointer": "/data/attributes/uid"
}
}
]
}
```
## Next Steps
After creating a provider:
1. **Verify Connection**: Test the provider connection
```bash
curl -X POST "https://api.prowler.com/api/v1/providers/{provider_id}/connection" \
-H "Authorization: Bearer YOUR_API_KEY"
```
2. **Run First Scan**: Initiate a security scan
```bash
curl -X POST "https://api.prowler.com/api/v1/scans" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"data": {"type": "scans", "attributes": {"provider_id": "provider-uuid"}}}'
```
3. **View Findings**: Check security findings from the scan
```bash
curl -X GET "https://api.prowler.com/api/v1/findings/latest?filter[provider]=provider-uuid" \
-H "Authorization: Bearer YOUR_API_KEY"
```
## Prerequisites by Provider Type
### AWS
1. Create an IAM role in your AWS account
2. Attach the `SecurityAudit` managed policy (or custom policy)
3. Configure trust relationship to allow Prowler to assume the role
4. Note the Role ARN
[AWS Setup Guide →](/user-guide/providers/aws/getting-started-aws)
### Azure
1. Create an App Registration in Azure AD
2. Grant `Reader` and `Security Reader` roles at subscription level
3. Create a client secret
4. Note tenant ID, client ID, and subscription ID
[Azure Setup Guide →](/user-guide/providers/azure/getting-started-azure)
### GCP
1. Create a service account in your GCP project
2. Grant necessary IAM roles (Viewer, Security Reviewer)
3. Generate and download a JSON key file
4. Use the key file contents in the configuration
[GCP Setup Guide →](/user-guide/providers/gcp/getting-started-gcp)
<Warning>
**Security Considerations:**
- Use least-privilege IAM policies
- Rotate credentials regularly
- Use external IDs for AWS role assumption
- Store credentials securely (never in code)
- Enable audit logging for all provider access
- Use read-only permissions only
</Warning>
<Note>
After creating a provider, it will show `connected: false` until you verify the connection using the `/providers/{id}/connection` endpoint.
</Note>
<Tip>
**Best Practice:** Use descriptive aliases that include the environment and region (e.g., "Production AWS US-East", "Dev Azure West Europe") to easily identify providers in your dashboard.
</Tip>
+27
View File
@@ -0,0 +1,27 @@
---
title: "Delete Provider"
api: "DELETE /api/v1/providers/{id}"
description: "Remove a provider from the system."
---
Delete a cloud provider permanently. This will also delete all associated scans and findings.
## Path Parameters
- `id` (required) - UUID of the provider to delete
## Example Request
```bash
curl -X DELETE "https://api.prowler.com/api/v1/providers/{id}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/vnd.api+json"
```
## Response
Returns `204 No Content` on successful deletion.
<Warning>
Deleting a provider will permanently remove all associated scans, findings, and historical data. This action cannot be undone.
</Warning>
+120
View File
@@ -0,0 +1,120 @@
---
title: "List Providers"
api: "GET /api/v1/providers"
description: "Retrieve a list of all configured cloud providers with options for filtering."
---
Retrieve all configured cloud providers in your tenant. Providers represent your cloud accounts (AWS, Azure, GCP, etc.) that Prowler scans for security findings.
## Query Parameters
### Filtering Options
**By Type:**
- `filter[provider]`, `filter[provider__in]` - Filter by provider type: `aws`, `azure`, `gcp`, `kubernetes`, `m365`, `github`, `oci`
**By Status:**
- `filter[connected]` - Filter by connection status (boolean)
**By Alias:**
- `filter[alias]`, `filter[alias__icontains]` - Filter by provider alias
**By UID:**
- `filter[uid]`, `filter[uid__icontains]` - Filter by provider UID
**By Date:**
- `filter[inserted_at]`, `filter[inserted_at__date]` - Filter by creation date
- `filter[inserted_at__gte]`, `filter[inserted_at__lte]` - Filter by date range
### Pagination
- `page[number]` - Page number to retrieve
- `page[size]` - Number of results per page
### Sorting
- `sort` - Field to sort by: `id`, `-id`, `alias`, `-alias`, `inserted_at`, `-inserted_at`, `updated_at`, `-updated_at`
### Field Selection
- `fields[providers]` - Specify which fields to return
## Example Request
```bash
curl -X GET "https://api.prowler.com/api/v1/providers?filter[provider]=aws&filter[connected]=true" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/vnd.api+json"
```
## Response
### Success Response (200 OK)
Returns a paginated list of providers with their configuration and connection status:
```json
{
"data": [
{
"type": "providers",
"id": "provider-uuid",
"attributes": {
"provider": "aws",
"uid": "123456789012",
"alias": "Production AWS - US",
"connection": {
"connected": true,
"last_checked_at": "2024-01-20T10:30:00Z"
},
"inserted_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-20T10:30:00Z"
},
"relationships": {
"secret": {
"data": {
"type": "provider-secrets",
"id": "secret-uuid"
}
},
"provider_groups": {
"data": []
},
"scans": {
"data": [
{
"type": "scans",
"id": "scan-uuid"
}
]
}
}
}
],
"meta": {
"page": {
"number": 1,
"size": 20,
"total": 1,
"total_pages": 1
}
},
"links": {
"self": "https://api.prowler.com/api/v1/providers?page[number]=1",
"first": "https://api.prowler.com/api/v1/providers?page[number]=1",
"last": "https://api.prowler.com/api/v1/providers?page[number]=1"
}
}
```
### Response Fields
- `id` (UUID) - Unique identifier for the provider
- `provider` (enum) - Type of cloud provider: `aws`, `azure`, `gcp`, `kubernetes`, `m365`, `github`, `oci`
- `uid` (string) - Provider's unique identifier (3-250 characters)
- `alias` (string, nullable) - Human-readable name (3-100 characters)
- `connection` (object, read-only) - Connection status information:
- `connected` (boolean) - Whether provider is connected
- `last_checked_at` (datetime) - Last connection verification time
- `inserted_at` (datetime, read-only) - When provider was created
- `updated_at` (datetime, read-only) - Last modification time
+101
View File
@@ -0,0 +1,101 @@
---
title: "Retrieve Provider"
api: "GET /api/v1/providers/{id}"
description: "Fetch detailed information about a specific provider by its ID."
---
Retrieve detailed information about a specific cloud provider.
## Path Parameters
- `id` (required) - UUID of the provider to retrieve
## Query Parameters
### Field Selection
- `fields[providers]` - Specify which fields to return
## Example Request
```bash
curl -X GET "https://api.prowler.com/api/v1/providers/{id}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/vnd.api+json"
```
## Response
### Success Response (200 OK)
Returns detailed provider information:
```json
{
"data": {
"type": "providers",
"id": "provider-uuid",
"attributes": {
"provider": "aws",
"uid": "123456789012",
"alias": "Production AWS - US",
"connection": {
"connected": true,
"last_checked_at": "2024-01-20T10:30:00Z"
},
"inserted_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-20T10:30:00Z"
},
"relationships": {
"secret": {
"data": {
"type": "provider-secrets",
"id": "secret-uuid"
}
},
"provider_groups": {
"data": []
},
"scans": {
"data": [
{
"type": "scans",
"id": "scan-uuid-1"
},
{
"type": "scans",
"id": "scan-uuid-2"
}
]
}
}
}
}
```
### Response Fields
- `id` (UUID) - Unique identifier for the provider
- `provider` (enum) - Type of cloud provider: `aws`, `azure`, `gcp`, `kubernetes`, `m365`, `github`, `oci`
- `uid` (string) - Provider's unique identifier (3-250 characters)
- `alias` (string, nullable) - Human-readable name (3-100 characters)
- `connection` (object, read-only) - Connection status information:
- `connected` (boolean) - Whether provider is connected
- `last_checked_at` (datetime) - Last connection verification time
- `inserted_at` (datetime, read-only) - When provider was created
- `updated_at` (datetime, read-only) - Last modification time
### Error Responses
**404 Not Found** - Provider does not exist
```json
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Provider not found"
}
]
}
```
@@ -0,0 +1,266 @@
---
title: "Create Provider Secret"
api: "POST /api/v1/providers/secrets"
description: "Add credentials/secrets to authenticate with a cloud provider."
---
Configure authentication credentials for a cloud provider. This endpoint stores the necessary secrets (API keys, role ARNs, service account keys) to allow Prowler to scan your cloud infrastructure.
## Use Cases
- **AWS Role Assumption**: Configure IAM role ARN for cross-account access
- **Azure Service Principal**: Store client ID, client secret, and tenant ID
- **GCP Service Account**: Upload service account JSON key
- **Static Credentials**: Store API keys or access keys (not recommended for production)
## Request Body
The request follows the JSON:API specification:
```json
{
"data": {
"type": "provider-secrets",
"attributes": {
"name": "Production AWS Credentials",
"secret_type": "role",
"secret": {
"role_arn": "arn:aws:iam::123456789012:role/ProwlerRole",
"external_id": "unique-external-id"
}
},
"relationships": {
"provider": {
"data": {
"type": "providers",
"id": "provider-uuid"
}
}
}
}
}
```
### Attributes
- `name` (optional, string, nullable) - Descriptive name for the secret (3-100 characters)
- `secret_type` (required, enum) - Type of secret:
- `role` - IAM role assumption (AWS)
- `service_account` - Service account key (GCP)
- `static` - Static key-value pairs (API keys, credentials)
- `secret` (required, object) - The actual secret data (varies by secret_type)
### Secret Types and Formats
**AWS Role (`role`):**
```json
{
"secret": {
"role_arn": "arn:aws:iam::123456789012:role/ProwlerRole",
"external_id": "your-external-id"
}
}
```
**GCP Service Account (`service_account`):**
```json
{
"secret": {
"service_account_key": "{\"type\":\"service_account\",\"project_id\":\"my-project\",...}"
}
}
```
**Azure Service Principal (`static`):**
```json
{
"secret": {
"client_id": "aaaabbbb-cccc-dddd-eeee-ffff00001111",
"client_secret": "your-client-secret",
"tenant_id": "tenant-uuid"
}
}
```
**Static Credentials (`static`):**
```json
{
"secret": {
"access_key_id": "AKIAIOSFODNN7EXAMPLE",
"secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
}
}
```
## Example Requests
### AWS Role Assumption
```bash
curl -X POST "https://api.prowler.com/api/v1/providers/secrets" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/vnd.api+json" \
-d '{
"data": {
"type": "provider-secrets",
"attributes": {
"name": "Production AWS Role",
"secret_type": "role",
"secret": {
"role_arn": "arn:aws:iam::123456789012:role/ProwlerRole",
"external_id": "prowler-external-id-12345"
}
},
"relationships": {
"provider": {
"data": {
"type": "providers",
"id": "provider-uuid"
}
}
}
}
}'
```
### GCP Service Account
```bash
curl -X POST "https://api.prowler.com/api/v1/providers/secrets" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/vnd.api+json" \
-d '{
"data": {
"type": "provider-secrets",
"attributes": {
"name": "GCP Service Account",
"secret_type": "service_account",
"secret": {
"service_account_key": "{\"type\":\"service_account\",\"project_id\":\"my-project-123\",\"private_key_id\":\"key-id\",\"private_key\":\"-----BEGIN PRIVATE KEY-----\\n...\\n-----END PRIVATE KEY-----\\n\",\"client_email\":\"prowler@my-project.iam.gserviceaccount.com\",\"client_id\":\"123456789\",\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"token_uri\":\"https://oauth2.googleapis.com/token\"}"
}
},
"relationships": {
"provider": {
"data": {
"type": "providers",
"id": "provider-uuid"
}
}
}
}
}'
```
## Response
### Success Response (201 Created)
Returns the created secret metadata (sensitive data is not returned):
```json
{
"data": {
"type": "provider-secrets",
"id": "secret-uuid",
"attributes": {
"name": "Production AWS Role",
"secret_type": "role",
"inserted_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
"relationships": {
"provider": {
"data": {
"type": "providers",
"id": "provider-uuid"
}
}
}
}
}
```
### Response Fields
- `id` (UUID) - Unique identifier for the secret
- `name` (string, nullable) - Descriptive name (3-100 characters)
- `secret_type` (enum) - Type: `role`, `service_account`, or `static`
- `inserted_at` (datetime, read-only) - Creation timestamp
- `updated_at` (datetime, read-only) - Last modification timestamp
### Error Responses
**400 Bad Request** - Invalid secret format
```json
{
"errors": [
{
"status": "400",
"title": "Invalid Secret Format",
"detail": "Role ARN format is invalid"
}
]
}
```
**404 Not Found** - Provider does not exist
```json
{
"errors": [
{
"status": "404",
"title": "Provider Not Found",
"detail": "Provider with ID 'provider-uuid' not found"
}
]
}
```
**422 Unprocessable Entity** - Validation error
```json
{
"errors": [
{
"status": "422",
"title": "Validation Error",
"detail": "secret_type is required",
"source": {
"pointer": "/data/attributes/secret_type"
}
}
]
}
```
## Next Steps
After creating a secret:
1. **Test Connection**: Verify the credentials work
```bash
curl -X POST "https://api.prowler.com/api/v1/providers/{provider_id}/connection" \
-H "Authorization: Bearer YOUR_API_KEY"
```
2. **Run First Scan**: Execute a security scan
```bash
curl -X POST "https://api.prowler.com/api/v1/scans" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"data": {"type": "scans", "attributes": {"provider_id": "provider-uuid"}}}'
```
<Warning>
**Security Critical:**
- Secrets are encrypted at rest in Prowler's database
- Use role assumption (AWS) or service accounts (GCP) instead of static credentials
- Never log or expose secret values
- Rotate credentials regularly
- Use least-privilege IAM policies
- For AWS, always use an external ID for role assumption
</Warning>
<Note>
The secret data itself is never returned in API responses after creation. Only metadata about the secret is accessible via the API.
</Note>
<Tip>
**AWS Best Practice:** Create a dedicated IAM role with the `SecurityAudit` managed policy and a trust relationship allowing Prowler to assume it. Use an external ID for additional security.
</Tip>
@@ -0,0 +1,73 @@
---
title: "Delete Provider Secret"
api: "DELETE /api/v1/providers/secrets/{id}"
description: "Remove a provider secret permanently."
---
Delete a provider secret. This removes the credentials used to authenticate with a cloud provider.
## Path Parameters
- `id` (required) - UUID of the secret to delete
## Example Request
```bash
curl -X DELETE "https://api.prowler.com/api/v1/providers/secrets/{id}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/vnd.api+json"
```
## Response
### Success Response (204 No Content)
Returns no content on successful deletion.
### Error Responses
**404 Not Found** - Secret does not exist
```json
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Secret not found"
}
]
}
```
**409 Conflict** - Secret is in use
```json
{
"errors": [
{
"status": "409",
"title": "Secret In Use",
"detail": "Cannot delete secret that is currently associated with an active provider. Remove the provider first or update it to use different credentials."
}
]
}
```
<Warning>
**Deleting a secret will:**
- Immediately prevent Prowler from accessing the cloud provider
- Stop all scheduled scans for the associated provider
- Make it impossible to run new scans until new credentials are added
This action cannot be undone.
</Warning>
<Note>
Before deleting a secret, ensure:
- The provider is no longer needed, OR
- New credentials have been added and tested, OR
- The provider has been deleted or updated to use different credentials
</Note>
<Tip>
Instead of deleting a secret when rotating credentials, use the update endpoint to replace the old credentials with new ones. This ensures zero downtime.
</Tip>
@@ -0,0 +1,133 @@
---
title: "List Provider Secrets"
api: "GET /api/v1/providers/secrets"
description: "Retrieve a list of all provider secrets with filtering options."
---
Retrieve metadata about all provider secrets. Note that the actual secret values are never returned - only metadata such as names, types, and timestamps.
## Query Parameters
### Filtering
- `filter[provider]`, `filter[provider__in]` - Filter by provider UUID(s)
- `filter[secret_type]`, `filter[secret_type__in]` - Filter by type: `static`, `role`, `service_account`
- `filter[name]`, `filter[name__icontains]` - Filter by secret name
### Pagination
- `page[number]` - Page number to retrieve (default: 1)
- `page[size]` - Number of results per page (default: 20, max: 100)
### Sorting
- `sort` - Field to sort by:
- `inserted_at` - Oldest first
- `-inserted_at` - Newest first (default)
- `name` - Alphabetically
- `-name` - Reverse alphabetically
### Field Selection
- `fields[provider-secrets]` - Specify which fields to return: `inserted_at`, `updated_at`, `name`, `secret_type`, `provider`
### Include Related Resources
- `include` - Include related resources: `provider`
## Example Request
```bash
curl -X GET "https://api.prowler.com/api/v1/providers/secrets?filter[secret_type]=role&include=provider" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/vnd.api+json"
```
## Response
### Success Response (200 OK)
Returns a paginated list of secret metadata:
```json
{
"data": [
{
"type": "provider-secrets",
"id": "secret-uuid-1",
"attributes": {
"name": "Production AWS Role",
"secret_type": "role",
"inserted_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
"relationships": {
"provider": {
"data": {
"type": "providers",
"id": "provider-uuid"
}
}
}
},
{
"type": "provider-secrets",
"id": "secret-uuid-2",
"attributes": {
"name": "GCP Service Account",
"secret_type": "service_account",
"inserted_at": "2024-01-10T08:15:00Z",
"updated_at": "2024-01-10T08:15:00Z"
},
"relationships": {
"provider": {
"data": {
"type": "providers",
"id": "provider-uuid-2"
}
}
}
}
],
"meta": {
"page": {
"number": 1,
"size": 20,
"total": 2,
"total_pages": 1
}
},
"links": {
"self": "https://api.prowler.com/api/v1/providers/secrets?page[number]=1",
"first": "https://api.prowler.com/api/v1/providers/secrets?page[number]=1",
"last": "https://api.prowler.com/api/v1/providers/secrets?page[number]=1"
},
"included": [
{
"type": "providers",
"id": "provider-uuid",
"attributes": {
"provider": "aws",
"uid": "123456789012",
"alias": "Production AWS - US"
}
}
]
}
```
### Response Fields
- `id` (UUID) - Unique identifier for the secret
- `name` (string, nullable) - Descriptive name (3-100 characters)
- `secret_type` (enum) - Type: `role`, `service_account`, or `static`
- `inserted_at` (datetime, read-only) - When secret was created
- `updated_at` (datetime, read-only) - Last modification time
<Note>
Secret values are never returned via the API. Only metadata about secrets is accessible.
</Note>
<Warning>
Regularly audit your secrets list to identify and remove unused credentials.
</Warning>
@@ -0,0 +1,96 @@
---
title: "Retrieve Provider Secret"
api: "GET /api/v1/providers/secrets/{id}"
description: "Fetch metadata about a specific provider secret by its ID."
---
Retrieve metadata about a specific provider secret. The actual secret values are never returned - only information about the secret.
## Path Parameters
- `id` (required) - The UUID of the secret to retrieve
## Query Parameters
### Field Selection
- `fields[provider-secrets]` - Specify which fields to return: `inserted_at`, `updated_at`, `name`, `secret_type`, `provider`
### Include Related Resources
- `include` - Include related resources: `provider`
## Example Request
```bash
curl -X GET "https://api.prowler.com/api/v1/providers/secrets/{id}?include=provider" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/vnd.api+json"
```
## Response
### Success Response (200 OK)
Returns secret metadata:
```json
{
"data": {
"type": "provider-secrets",
"id": "secret-uuid",
"attributes": {
"name": "Production AWS Role",
"secret_type": "role",
"inserted_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
"relationships": {
"provider": {
"data": {
"type": "providers",
"id": "provider-uuid"
}
}
}
},
"included": [
{
"type": "providers",
"id": "provider-uuid",
"attributes": {
"provider": "aws",
"uid": "123456789012",
"alias": "Production AWS - US"
}
}
]
}
```
### Response Fields
- `id` (UUID) - Unique identifier for the secret
- `name` (string, nullable) - Descriptive name (3-100 characters)
- `secret_type` (enum) - Type: `role`, `service_account`, or `static`
- `inserted_at` (datetime, read-only) - When secret was created
- `updated_at` (datetime, read-only) - Last modification time
### Error Responses
**404 Not Found** - Secret does not exist
```json
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Secret not found"
}
]
}
```
<Note>
Secret values are never returned via the API. If you need to update credentials, use the update endpoint with new secret data.
</Note>
@@ -0,0 +1,168 @@
---
title: "Update Provider Secret"
api: "PATCH /api/v1/providers/secrets/{id}"
description: "Update a provider secret's credentials or metadata."
---
Update an existing provider secret. This is typically used to rotate credentials or update the secret name.
## Path Parameters
- `id` (required) - UUID of the secret to update
## Request Body
```json
{
"data": {
"type": "provider-secrets",
"id": "secret-uuid",
"attributes": {
"name": "Updated Secret Name",
"secret": {
"role_arn": "arn:aws:iam::123456789012:role/NewProwlerRole",
"external_id": "new-external-id"
}
}
}
}
```
### Attributes
- `name` (optional, string, nullable) - Update the secret name (3-100 characters)
- `secret` (optional, object) - Update the secret data (format depends on secret_type)
- `secret_type` (read-only) - Cannot be changed after creation
<Note>
The `secret_type` cannot be changed. If you need a different secret type, create a new secret and delete the old one.
</Note>
## Example Requests
### Update AWS Role ARN
```bash
curl -X PATCH "https://api.prowler.com/api/v1/providers/secrets/{id}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/vnd.api+json" \
-d '{
"data": {
"type": "provider-secrets",
"id": "secret-uuid",
"attributes": {
"name": "Production AWS Role - Rotated",
"secret": {
"role_arn": "arn:aws:iam::123456789012:role/ProwlerRoleV2",
"external_id": "prowler-external-id-67890"
}
}
}
}'
```
### Update Azure Credentials
```bash
curl -X PATCH "https://api.prowler.com/api/v1/providers/secrets/{id}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/vnd.api+json" \
-d '{
"data": {
"type": "provider-secrets",
"id": "secret-uuid",
"attributes": {
"secret": {
"client_id": "aaaabbbb-cccc-dddd-eeee-ffff00001111",
"client_secret": "new-rotated-client-secret",
"tenant_id": "tenant-uuid"
}
}
}
}'
```
## Response
### Success Response (200 OK)
Returns the updated secret metadata:
```json
{
"data": {
"type": "provider-secrets",
"id": "secret-uuid",
"attributes": {
"name": "Production AWS Role - Rotated",
"secret_type": "role",
"inserted_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-20T14:45:00Z"
},
"relationships": {
"provider": {
"data": {
"type": "providers",
"id": "provider-uuid"
}
}
}
}
}
```
### Error Responses
**400 Bad Request** - Invalid secret format
```json
{
"errors": [
{
"status": "400",
"title": "Invalid Secret Format",
"detail": "Role ARN format is invalid"
}
]
}
```
**404 Not Found** - Secret does not exist
```json
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Secret not found"
}
]
}
```
## Next Steps
After updating credentials:
1. **Test Connection**: Verify the new credentials work
```bash
curl -X POST "https://api.prowler.com/api/v1/providers/{provider_id}/connection" \
-H "Authorization: Bearer YOUR_API_KEY"
```
2. **Run Scan**: Confirm scanning works with new credentials
```bash
curl -X POST "https://api.prowler.com/api/v1/scans" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{"data": {"type": "scans", "attributes": {"provider_id": "provider-uuid"}}}'
```
<Warning>
**Credential Rotation Best Practices:**
- Test new credentials before updating in production
- Keep old credentials valid until confirming new ones work
- Update secrets during maintenance windows
- Verify connection status after updates
- Monitor for authentication failures in scans
</Warning>
<Tip>
When rotating AWS roles, create the new role first, update the secret, test it, then delete the old role to ensure zero downtime.
</Tip>
+123
View File
@@ -0,0 +1,123 @@
---
title: "Update Provider"
api: "PATCH /api/v1/providers/{id}"
description: "Modify certain fields of an existing provider."
---
Update an existing cloud provider's configuration or settings.
## Path Parameters
- `id` (required) - UUID of the provider to update
## Request Body
The request follows the JSON:API specification:
```json
{
"data": {
"type": "providers",
"id": "provider-uuid",
"attributes": {
"alias": "Updated Provider Name"
}
}
}
```
### Attributes
- `alias` (optional, string, nullable) - Human-readable name to identify the provider (3-100 characters)
<Note>
Only the `alias` field can be updated. Other fields like `provider`, `uid`, and `connection` are read-only. Provider credentials and configuration are managed separately via the Provider Secrets endpoints.
</Note>
## Example Request
```bash
curl -X PATCH "https://api.prowler.com/api/v1/providers/{id}" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/vnd.api+json" \
-d '{
"data": {
"type": "providers",
"id": "provider-uuid",
"attributes": {
"alias": "Production AWS - Updated"
}
}
}'
```
## Response
### Success Response (200 OK)
Returns the updated provider with modified alias:
```json
{
"data": {
"type": "providers",
"id": "provider-uuid",
"attributes": {
"provider": "aws",
"uid": "123456789012",
"alias": "Production AWS - Updated",
"connection": {
"connected": true,
"last_checked_at": "2024-01-20T10:30:00Z"
},
"inserted_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-20T14:45:00Z"
},
"relationships": {
"secret": {
"data": {
"type": "provider-secrets",
"id": "secret-uuid"
}
},
"provider_groups": {
"data": []
},
"scans": {
"data": []
}
}
}
}
```
### Error Responses
**404 Not Found** - Provider does not exist
```json
{
"errors": [
{
"status": "404",
"title": "Not Found",
"detail": "Provider not found"
}
]
}
```
**422 Unprocessable Entity** - Invalid alias
```json
{
"errors": [
{
"status": "422",
"title": "Validation Error",
"detail": "Alias must be between 3 and 100 characters",
"source": {
"pointer": "/data/attributes/alias"
}
}
]
}
```