- Creating Your Cloud Storage Bucket
- AWS S3 Bucket Setup
- Step 1: Create the Bucket
- Step 2: Enable Object Versioning (SOC II Compliance)
- Step 3: (Optional) Enable Server-Side Encryption
- Step 4: (Optional) Configure Lifecycle Rules
- Google Cloud Storage Bucket Setup
- Step 1: Create the Bucket
- Step 2: Enable Object Versioning (SOC II Compliance)
- Step 3: (Optional) Configure Lifecycle Rules
- SOC II Compliance Checklist
- AWS S3 Credentials
- Step 1: Navigate to IAM Security Credentials
- Step 2: Create Access Key
- Step 3: Retrieve Your Credentials
- Best Practices for AWS Access Keys
- Required IAM Permissions
- Google Cloud Storage Credentials
- Step 1: Navigate to Service Accounts
- Step 2: Create Service Account
- Step 3: Grant Permissions
- Step 4: Create and Download JSON Key
- JSON Key File Format
- Using the Service Account with Captain
- Best Practices for Service Account Keys
- Using Credentials with Captain
- AWS S3 Example
- Google Cloud Storage Example
- Security Reminders
- Troubleshooting
- AWS Issues
- Google Cloud Issues
- Need Help?
Cloud Storage Credentials Guide
This guide will help you create cloud storage buckets with proper compliance settings and obtain the necessary credentials to use Captain with your cloud storage provider.
Creating Your Cloud Storage Bucket
Before obtaining credentials, you’ll need a bucket to store your documents. Follow these steps to create a properly configured bucket.
AWS S3 Bucket Setup
Step 1: Create the Bucket
- Log in to the AWS Console
- Navigate to S3 → Buckets → Create bucket
- Enter a unique bucket name (e.g.,
company-captain-documents) - Select your preferred AWS Region (recommendation: same region as your application)
- Under Object Ownership, keep “ACLs disabled” (recommended)
- Under Block Public Access settings, keep all options checked (block all public access)
- Click Create bucket
Step 2: Enable Object Versioning (SOC II Compliance)
Required for SOC II Compliance: Object versioning maintains a complete audit trail of all document changes, enabling recovery from accidental deletions and supporting data retention policies.
- Click on your newly created bucket
- Navigate to the Properties tab
- Find the Bucket Versioning section
- Click Edit
- Select Enable versioning
- Click Save changes
Step 3: (Optional) Enable Server-Side Encryption
For additional security, enable default encryption:
- In the Properties tab, find Default encryption
- Click Edit
- Select Server-side encryption with Amazon S3 managed keys (SSE-S3) or your preferred encryption method
- Click Save changes
Step 4: (Optional) Configure Lifecycle Rules
For cost optimization with versioned objects:
- Navigate to the Management tab
- Click Create lifecycle rule
- Configure rules to transition old versions to cheaper storage classes or delete them after a retention period
Google Cloud Storage Bucket Setup
Step 1: Create the Bucket
- Go to Google Cloud Console
- Navigate to Cloud Storage → Buckets → Create
- Enter a unique bucket name (e.g.,
company-captain-documents) - Select a Location type (Region, Dual-region, or Multi-region)
- Select Standard storage class for general use
- Under Access control, select “Uniform” (recommended)
- Click Create
Step 2: Enable Object Versioning (SOC II Compliance)
Required for SOC II Compliance: Object versioning maintains a complete audit trail of all document changes.
Via Google Cloud Console:
- Click on your bucket name
- Navigate to the Configuration tab
- Find Object versioning and click Edit
- Toggle versioning to Enabled
- Click Save
Via gsutil command line:
Via gcloud CLI:
Step 3: (Optional) Configure Lifecycle Rules
To manage versioned object costs:
- In your bucket, go to Lifecycle tab
- Click Add a rule
- Configure rules to delete old versions after your retention period
SOC II Compliance Checklist
Ensure your buckets meet SOC II requirements:
AWS S3 Credentials
To index files from Amazon S3 buckets, you’ll need an AWS Access Key ID and Secret Access Key.
Step 1: Navigate to IAM Security Credentials
- Log in to the AWS Console
- Click on your account name in the top-right corner
- Select Security credentials from the dropdown menu

Step 2: Create Access Key
- Scroll down to the Access keys section
- Click the Create access key button

Step 3: Retrieve Your Credentials
- Your Access Key ID and Secret Access Key will be displayed
- Important: This is the only time you can view the Secret Access Key
- Click Show to reveal the Secret Access Key
- Copy both the Access Key ID and Secret Access Key to a secure location
- Optionally, download the
.csvfile for safekeeping

Best Practices for AWS Access Keys
- Never store your access key in plain text, in a code repository, or in code
- Disable or delete access keys when no longer needed
- Enable least-privilege permissions
- Rotate access keys regularly
Required IAM Permissions
Your AWS access key needs the following permissions to work with Captain:
For read-only access to S3 buckets:
Replace your-bucket-name with your actual S3 bucket name.
Google Cloud Storage Credentials
To index files from Google Cloud Storage buckets, you’ll need a Service Account JSON key.
Step 1: Navigate to Service Accounts
- Go to Google Cloud Console
- Navigate to IAM & Admin → Service Accounts
- Click Create Service Account

Step 2: Create Service Account
- Enter a Service account name (e.g.,
captain-storage-access) - Add a Service account description (optional but recommended)
- The Service account ID will be auto-generated
- Click Create and continue

Step 3: Grant Permissions
Under Grant this service account access to project, choose the appropriate role based on your needs:
For read-only access to buckets/objects:
- Role: Storage Object Viewer (
roles/storage.objectViewer)
For read/write access:
- Role: Storage Object Admin (
roles/storage.objectAdmin)
For full bucket management:
- Role: Storage Admin (
roles/storage.admin)
Click Continue → Done
Step 4: Create and Download JSON Key
- You’ll now see your new service account in the list
- Click on the service account name
- Navigate to the Keys tab
- Click Add Key → Create New Key
- Select JSON as the key type
- Click Create

The JSON key file will automatically download to your computer. This file contains your service account credentials.
JSON Key File Format
Your downloaded JSON key will look like this:
Using the Service Account with Captain
When using Captain with Google Cloud Storage, you’ll typically need to:
- Store the JSON key file securely on your server
- Set the
GOOGLE_APPLICATION_CREDENTIALSenvironment variable to point to the JSON file path:
Or load it programmatically in your application.
Best Practices for Service Account Keys
- Service account keys could pose a security risk if compromised
- Never commit service account keys to version control
- Store keys securely using secret management services
- Rotate keys regularly
- Delete unused service accounts and keys
- Consider using Workload Identity Federation for more secure authentication (advanced)
- Google automatically disables service account keys detected in public repositories
Using Credentials with Captain
Once you have your credentials, you can use them with Captain’s indexing endpoints:
AWS S3 Example
Google Cloud Storage Example
Security Reminders
- Never share your credentials in public forums, chat messages, or email
- Never commit credentials to version control systems (Git, SVN, etc.)
- Use environment variables or secure secret management services in production
- Rotate credentials regularly to minimize security risks
- Apply least-privilege permissions - only grant the minimum access needed
- Monitor credential usage through AWS CloudTrail or Google Cloud Audit Logs
Troubleshooting
AWS Issues
Error: “Invalid AWS credentials”
- Verify your Access Key ID and Secret Access Key are correct
- Check that the access key is active in the IAM console
- Ensure your IAM user/role has the necessary S3 permissions
Error: “Access Denied”
- Verify your IAM permissions include
s3:GetObjectands3:ListBucket - Check bucket policies and ensure they allow your IAM user/role
- Verify the bucket region matches the
bucket_regionparameter
Google Cloud Issues
Error: “Invalid service account credentials”
- Verify the JSON key file is valid and not corrupted
- Check that the service account is enabled
- Ensure the service account has the necessary Storage permissions
Error: “Permission denied”
- Verify the service account has the appropriate Storage role
- Check that the bucket exists and the service account has access
- Review IAM permissions in the Google Cloud Console
Need Help?
If you encounter issues obtaining or using your cloud storage credentials, contact Captain support:
- Email: support@runcaptain.com