Skip to navigation

Experimental. For evaluation. Interfaces, configuration, and behavior may change incompatibly.

Stores workflow files and creates signed upload and download requests through S3-compatible storage or GCS.

Prerequisites

  • Existing S3-compatible or GCS bucket reachable by the worker.
  • S3 access keys or GCS application-default credentials with access to the bucket. GCS signed download/upload requests require signing-capable credentials. With user ADC or credentials without a private signing key, configure signer_service_account_email, grant the calling identity iam.serviceAccounts.signBlob on that service account, and enable the IAM Service Account Credentials API.

Setup

  • For S3-compatible storage:
[modules.objectstore]
bucket_name = "workflow-files"
base_endpoint = "https://s3.example.com"
access_key_id = "<access-key>"
secret_access_key = "<secret-key>"
  • Set region if required by the storage service.
  • For GCS with application-default credentials:
[modules.objectstore]
backend = "gcs"
bucket_name = "workflow-files"
# For IAM-based signing:
signer_service_account_email = "storage-signer@your-project.iam.gserviceaccount.com"

This module must be enabled in your Remediation Orchestrator config before it is available to scripts.

This module provides utilities for interacting with object storage.

Members

create_read_only_presigned_request

objectstore.create_read_only_presigned_request(file_path, duration?)

Create a read-only presigned request for a file in object storage.

Parameters
file_pathstringThe path to the file in object storage which should be readable via the generated presigned URL.
duration?optionalstringThe Go-style duration for which the presigned URL should be valid. Duration cannot exceed ‘168h’ or 7 days. Default value is ‘1h’.
Returns
requestobjectstore.PresignedRequestThe presigned request for the file.

create_write_presigned_post

objectstore.create_write_presigned_post(path, duration?)

Create a write presigned post request, which allows uploading multiple files in object storage.

Parameters
pathstringThe object storage path where files will be uploaded to using the generated presigned post.
duration?optionalstringThe Go-style duration for which the presigned post should be valid. Duration cannot exceed ‘168h’ or 7 days. Default value is ‘1h’.
Returns
postobjectstore.PresignedPostThe presigned post.

get_file

objectstore.get_file(file_path)

Get a file from object storage.

Parameters
file_pathstringThe path to the file in object storage.
Returns
filescriptrt.FileThe file object.

list

objectstore.list(prefix)

List objects in object storage.

Parameters
prefixstringThe prefix to list objects for.
Returns
fileslist[string]The list of file paths.

upload_file

objectstore.upload_file(file, prefix)

Upload a file to object storage.

Parameters
filescriptrt.FileThe file object.
prefixstringThe path to the file in object storage.
Returns
file_pathstringThe path to the file in object storage.

upload_text

objectstore.upload_text(text, path)

Write a string to object storage.

Parameters
textstringThe text to write. It cannot be empty or larger than 1 MiB.
pathstringThe path of the object in object storage.
Returns
file_pathstringThe path to the file in object storage.