Skip to main content
Export scan data generated by Endor Labs to an AWS S3 storage bucket. This enables long-term data retention for compliance requirements, integration with security information and event management (SIEM) systems, and custom analytics workflows. The export framework supports exporting findings in JSON or SARIF format, allowing flexible integration with your existing toolchain. Amazon S3 is an object storage service provided by Amazon Web Services (AWS). It offers high durability, availability, and scalability for storing and retrieving any amount of data. S3 integrates with other AWS services and third-party tools, making it ideal for data archival, backup, and analytics workflows.

Prerequisites

Ensure that you meet the following prerequisites before exporting data to S3:

Create an S3 bucket

An S3 bucket is a container for storing objects in Amazon S3. Each bucket has a globally unique name, and you create it in a specific AWS region. You can create a general purpose S3 bucket or reuse an existing bucket to store the exported data. Disable access control lists (ACLs) on the bucket so IAM policies and bucket policies control access, preventing unintended public access. Refer to Creating a bucket for detailed instructions on creating an S3 bucket. S3 buckets

Configure bucket lifecycle

You can configure S3 lifecycle rules to automatically delete exported data after a specified retention period. Exported objects do not expire unless you configure lifecycle rules.
  1. In the AWS management console, navigate to Amazon S3 > Buckets.
  2. Select your bucket.
  3. Select Management and click Create lifecycle rule.
  4. Enter a Lifecycle rule name, for example, endor-exports-expiry.
  5. Under Filter type, select Limit the scope of this rule using one or more filters and enter endor/ as the prefix to apply the rule only to exported data.
  6. Under Lifecycle rule actions, select Expire current versions of objects.
  7. Under Expire current versions of objects, enter the number of days after which S3 deletes objects.
  8. Review the rule and click Create rule.

Configure access for Endor Labs

Endor Labs uses OIDC federation to assume an IAM role in your AWS account to access the S3 bucket. To allow Endor Labs to write to the bucket, configure OIDC and IAM using one of the following methods:
  • Use the CFT template to create the OIDC identity provider, IAM role, and S3 write policy.
  • Use the AWS Management console to create access by adding the OIDC identity provider and IAM role.

Create AWS resources using a CFT template

Use an AWS CloudFormation Template (CFT) to create the IAM role and S3 PutObject policy for the S3 exporter. The template can create a new OIDC identity provider for Endor Labs or reuse an existing provider in your account. The following table lists the parameters you can set when deploying the CFT template.
If you use Endor Labs with an EU tenant, use https://api.eu.endorlabs.com instead of https://api.endorlabs.com.
  1. Create a .cft file with the following template. You can use the following template and set the parameters according to your OIDC audience, tenant namespace, bucket name, role name, and optionally an existing OIDC provider ARN.
  2. Save this file with an appropriate name such as endorlabs-s3-export.cft.
  3. Sign into AWS CloudFormation and search for Stacks.
  4. Click Create Stack and select With new resources.
  5. From Template source, select Upload a template file.
  6. Click Choose file, select the file you saved, and click Next.
  7. In Specify stack details, enter a Stack name, verify the Parameters you entered in the script and click Next.
  8. Select the acknowledgement from Configure stack options and click Next.
  9. From Review and Create, review the details and click Submit.
Check the progress of the creation of your resources from Stacks. After AWS creates the stack, you can see the status as CREATE_COMPLETE.

Create access through the Console

Create the OIDC identity provider and IAM role manually in the AWS Management Console. The IAM role is what Endor Labs assumes to write to your S3 bucket.
1

Add an OIDC identity provider

OpenID Connect (OIDC) federation allows Endor Labs to access AWS resources without requiring long-lived credentials. This reduces the risk of credential exposure and simplifies secret rotation.
  1. In the AWS management console, navigate to IAM > Access Management > Identity providers.
  2. Click Add provider.
  3. Under Provider details, select OpenID Connect.
  4. For Provider URL, enter https://api.endorlabs.com.
    If you use Endor Labs with an EU tenant, use https://api.eu.endorlabs.com instead of https://api.endorlabs.com.
  5. For Audience, specify a unique identifier to validate incoming OIDC tokens from Endor Labs.
  6. Optionally, add tags to help identify the provider.
  7. Click Add provider.
Create identity provider
2

Create a permissions policy

  1. In the AWS management console, navigate to IAM > Access Management > Policies.
  2. Click Create policy.
  3. Under Specify permissions, toggle the Policy editor to JSON.
  4. Enter the following policy:
    Replace <your-bucket-name> with the name of your S3 bucket.
  5. Click Next.
  6. Under Review and create, enter a Policy name. For example, EndorLabsS3ExportPolicy.
  7. Review the Permissions defined in this policy section to confirm that this policy lists the expected Amazon S3 write actions.
  8. Optionally, add a description and tags to your policy.
  9. Click Create policy.
Policy permissions
3

Create the IAM role

  1. In the AWS management console, navigate to IAM > Access Management > Roles.
  2. Click Create role.
  3. Under Select trusted entity, select Custom trust policy.
  4. Enter the following trust policy:
    If you use Endor Labs with an EU tenant, use https://api.eu.endorlabs.com instead of https://api.endorlabs.com.
    Replace the placeholders with your values:
    • <aws-account-id>: Your AWS account ID
    • <oidc-audience>: The audience value you configured in the OIDC provider
    • <your-namespace>: Your Endor Labs namespace
    Create IAM role
  5. Click Next.
  6. Under Add permissions, search for and select the IAM policy you created. IAM role permissions
  7. Click Next.
  8. Under Name, review, and create, enter a Role name for the S3 exporter role. For example, EndorLabsS3ExporterRole. IAM role name
  9. Optionally, add tags to help identify the role.
  10. Click Create role.

Create an S3 exporter

Create an S3 exporter to configure the export destination and data types. An S3 exporter always exports all findings. Scan data type shows this value and you cannot change it.
  1. Select User menu > Integrations from the left sidebar.
  2. Under Exporters, click Add on the AWS S3 card. If you already created S3 exporters, click Manage instead.
  3. Click Add AWS S3 Exporter.
  4. Enter an Exporter name.
  5. Review Scan context and Scan data type. By default, an S3 exporter sends all findings from default branches, monitored branches, and pull request scans.
  6. Choose a Format and a Compression format for the exported data, and click Next. By default, an S3 exporter writes JSON data to ZIP files. Add an AWS S3 exporter
  7. Choose the AWS region that hosts your bucket.
  8. Enter the S3 bucket name.
  9. Enter the IAM role ARN of the IAM role you created.
  10. Enter the Allowed audience that you configured in the OIDC provider, and click Create Exporter. AWS S3 configuration of an exporter
The exporter does not export any data until you add it to a scan profile.

Choose a compression format

Endor Labs compresses every exported object with gzip to reduce storage and transfer costs. The Compression format of the exporter sets the key suffix and content type that Endor Labs writes to your bucket. Both formats produce the same gzip payload. Only the key suffix and the content type differ. An object written under a .zip key is a gzip stream and not a zip archive, so decompress it with a gzip tool such as gunzip. Choose GZIP when the tools in your pipeline rely on the file extension or the content type to decompress the object. Each exported object holds one document. A JSON export is a single array of findings, and a SARIF export is a single SARIF document. Neither is line-delimited, so query engines such as Amazon Athena cannot read an object as rows until you reshape the payload into a line-delimited format. Existing exporters continue to write .zip objects, so your current exports and any downstream processing remain unchanged. Optionally, to write .gz objects instead, edit the exporter and change its Compression format. The new format applies to subsequent scans. Objects already in your bucket keep the format they were written with.

Configure scan profile to use the S3 exporter

After creating the exporter, associate it with your scan profile. You can also set the scan profile as the default for your namespace so all projects use it automatically. See Scan profiles for more information.

Configure the scan profile

  1. Select User menu > Settings from the left sidebar.
  2. Select Scan Profiles.
  3. Select the scan profile you want to configure and click Edit Scan Profile.
  4. Select your exporter under Exporters and click Save Scan Profile.

Configure the project to use the scan profile

Associate your project with a scan profile to enable automatic export of scan data.
  1. Select Projects from the left sidebar and select the project you want to configure.
  2. Select Settings and select the scan profile you want to use under Scan Profile.

Scan projects to export data

After configuration, subsequent scans automatically export data to your S3 bucket. You can trigger a rescan immediately. See Rescan projects for more information. To validate that the S3 exporter ran successfully for a scan:
  1. Select Projects from the left sidebar and select the project associated with your exporter.
  2. Select Scan History and select a record to view its information.
  3. Select Logs to view the scan log and set the log level to All The following message confirms that the S3 export is successful. INFO: Successfully completed S3 export

Exported file structure

Endor Labs exports data to S3 using a hierarchical folder structure:
The following table explains each path segment:

Example file path

An exporter that uses the default ZIP compression format writes the following object.
An exporter that uses the GZIP compression format writes the same data under a .gz key.

Manage the S3 exporter

You can edit and delete S3 exporters from the Endor Labs user interface.
  1. Select User menu > Integrations from the left sidebar.
  2. Under Exporters, click Manage on the AWS S3 card.
The AWS S3 page lists your S3 exporters with the namespace that owns each one, its region and bucket, its scan context, its scan data type, and the time it was last changed. You can search the list by exporter name.

Edit an exporter

You can change any setting of an exporter except its type.
  1. Select the vertical three dots for the exporter you want to change and select Edit.
  2. Update the values you want to change and click Next until you reach the last step.
  3. Click Save.

Delete an exporter

Delete an exporter when you no longer want to send scan data to its destination.
  1. Select the vertical three dots for the exporter you want to remove and select Delete.
  2. Click Delete to confirm.
If a scan profile uses the exporter, Endor Labs blocks the deletion and lists the scan profiles that reference it. Remove the exporter from each of those scan profiles and delete it again. See Scan profiles to manage the exporters a scan profile uses. You can edit or delete an exporter only in the namespace that owns it. An exporter is also available in the child namespaces of the namespace that owns it, where it is read-only.