Scaleway logo
Audit Trail API

Audit Trail API

Scaleway Audit Trail is a tool that holds a record of events and changes performed within a Scaleway Organization. It helps you ensure accountability and security by recording activity across all your resources (identity of the principal, date of activity, source IP address, API method used, and status of the request).

You can use Audit Trail for troubleshooting, compliance verification, and analysis in the event of a breach.

Concepts

Refer to our dedicated concepts pageOpen in new context to find definitions of the different terms referring to Audit Trail.

Quickstart

To start using Audit Trail you need to configure the AuditTrailReadOnly or the OrganizationManager permission sets in IAMOpen in new context. The OrganizationManager permission set is included in the Administrator group which is created by default whenever a new Organization is created. The scopeOpen in new context of these permission sets is at OrganizationOpen in new context level.

  1. Configure your environment variables.

    Note

    This is an optional step that seeks to simplify your usage of the Audit Trail API.

    TerminalCode
    export ACCESS_KEY="<access-key>" export SECRET_KEY="<secret-key>" export REGION="<region>"
  2. Create an IAM policy. Replace the parameter values in the request payload with the details of your principal.

    TerminalCode
    curl -X POST \ -H "Content-Type: application/json" \ -H "X-Auth-Token: $SCW_SECRET_KEY" https://api.scaleway.com/iam/v1alpha1/policies \ -d '{ "name": "policy-audit-trail", "description": "This policy grants read access to Audit Trail in my Organization to the user matching the userID defined below", "organization_id": "123e4567-e89b-12d3-a456-426614174000", "rules": [ { "permission_set_names": [ "AuditTrailReadOnly" ], "organization_id": "123e4567-e89b-12d3-a456-426614174000" } ], "user_id": "987f6543-21ba-43dc-b678-567812345678" }'
    ParameterDescription
    nameREQUIRED The name of your new policy
    descriptionThe description of your policy
    organization_idThe ID of your Scaleway Organization
    rulesThe rulesOpen in new context of your policy
    permission_set_namesThe permission sets you want to grant. You can either list all permission sets using the IAM APIOpen in new context or find a complete list in the permission sets documentation pageOpen in new context
    organization_idThe ID of the Scaleway Organization where you want your permission sets to apply. You can add one as the scopeOpen in new context of your policy
    user_idThe ID of the user you are granting access to

    Note

    To learn more about IAM policies, refer to our dedicated IAM policies reference pageOpen in new context.

  3. Run the following command to retrieve the list of Scaleway products for which you have Audit Trail events.

    Code
    ```bash curl --request GET \ --url https://api.scaleway.com/audit-trail/v1alpha1/$REGION/fr-par/products \ --header "X-Auth-Token: $SCW_SECRET_KEY" ```
  4. Run the following command to list your Audit Trail events.

    Code
    ```bash curl --request GET \ --url "https://api.scaleway.com/audit-trail/v1alpha1/regions/$REGION/events?organization_id=123e4567-e89b-12d3-a456-426614174000" \ --header "X-Auth-Token: $SCW_SECRET_KEY" ```

    Note

    If no events appear, make sure that you have created Scaleway resources in the targeted region. Find out more about troubleshooting Audit Trail issuesOpen in new context in our dedidcated documentation.

Requirement

Technical information

Regions

Scaleway's infrastructure spans different regions and Availability ZonesOpen in new context.

Audit Trail is available in the Paris, Amsterdam, and Warsaw regions, which are represented by the following path parameters:

  • fr-par
  • nl-ams
  • pl-waw

Technical limitations

Find out about product integration with Audit Trail in our dedicated documentationOpen in new context.

Going further

For more information about Audit Trail, you can check out the following pages: