Skip to content

Storage Backends

Manage where deployment scripts and artifacts are stored.

Storage backends define where Mantis retrieves scripts and artifacts for deployments:

Mantis supports three storage backend types:

TypeBest ForFeatures
LocalDevelopment, single-serverSimple paths, fast access
GitVersion control, GitOpsBranch tracking, audit trail
S3Large artifacts, distributedMulti-region, immutable storage

Best when:

  • Development and testing
  • Single-server deployments
  • Air-gapped environments without network storage
  • Quick setup without external dependencies

Best when:

  • Scripts need version control
  • GitOps workflows with PR-based changes
  • Audit trails via Git history are required
  • Multiple teams collaborate on deployment scripts

Best when:

  • Large deployment artifacts
  • Multi-region deployments
  • Immutable artifact storage
  • Cloud-native infrastructure
┌─────────────────────────────────────────────────────────────┐
│ Storage Backends │
├─────────────────────────────────────────────────────────────┤
│ │
│ Search: [____________________________] [+ New Storage] │
│ │
│ ┌────────────────┬────────┬─────────────────┬───────────┐ │
│ │ Name │ Type │ Location │ Actions │ │
│ ├────────────────┼────────┼─────────────────┼───────────┤ │
│ │ scripts │ Local │ /var/mantis/... │ [View] │ │
│ │ deploy-repo │ Git │ github.com/... │ [View] │ │
│ │ artifacts │ S3 │ s3://bucket/... │ [View] │ │
│ └────────────────┴────────┴─────────────────┴───────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘

Actions reference scripts from storage backends:

When creating an action, you specify the storage and filename:

┌─────────────────────────────────────────────────────────────┐
│ Create Action │
├─────────────────────────────────────────────────────────────┤
│ │
│ Name: [deploy-app ] │
│ │
│ Payload Type: ● Script ○ Command │
│ │
│ Storage: [scripts ▼] │
│ Filename: [deploy.sh ] │
│ │
│ ┌───────────────────────────────────────────────────────┐ │
│ │ Script will be read from: │ │
│ │ /var/mantis/scripts/deploy.sh │ │
│ └───────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘

All storage backends implement path traversal protection:

ProtectionDescription
Null bytesRejected
Absolute pathsRejected
Parent traversal../ sequences rejected
CanonicalizationPaths verified within storage root
Symlink protectionFiles read with O_NOFOLLOW (Unix)
Terminal window
# These filenames are blocked:
../../../etc/passwd # Parent traversal
/etc/passwd # Absolute path
script�.sh # Null byte injection

Sensitive credentials are encrypted at rest:

Storage TypeEncrypted Fields
GitSSH private key, SSH passphrase, password
S3Access key ID, secret access key

Encryption uses AES-256-GCM with AAD binding.

  1. Open the Infrastructure group in the top navigation, then the Storage pill
  2. Click New Storage
  3. Click the tab for your storage type
  4. Configure backend-specific settings
  5. Click the per-type create button (e.g. Create Local Storage / Create Git Storage / Create S3 Storage / Create Git Auth)

Storage sources are managed in Lens or through the /api/v1/storage/* endpoints (there is no mantisctl storage subcommand). Each backend has its own endpoint:

Global-admin tokens must include tenant_id. Storage creation calls resolve_tenant_id_for_write, which rejects with 400 tenant_id is required for storage creation when it resolves to None — exactly the case for an admin token that omits it. Add "tenant_id": "<uuid>" to the request body (or use a tenant-scoped token, which supplies it automatically).

Terminal window
# Create local storage
curl -X POST "$MANTIS_URL/api/v1/storage/local" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"name": "scripts", "path": "/var/mantis/scripts"}'
# Create git storage (auth_id references a git auth credential)
curl -X POST "$MANTIS_URL/api/v1/storage/git" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{
"name": "deploy-repo",
"path": "/var/mantis/git/deploy-repo",
"url": "https://github.com/org/scripts.git",
"reference": "main",
"auth_id": "<git-auth-id>"
}'
# Create S3 storage (static credentials)
curl -X POST "$MANTIS_URL/api/v1/storage/s3" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{
"name": "artifacts",
"bucket": "my-artifacts-bucket",
"region": "us-west-2",
"path_prefix": "deployments/",
"auth_type": "static",
"access_key_id": "AKIA...",
"secret_access_key": "..."
}'
SettingRequiredDescription
NameYesUnique identifier
TypeYesLocal, Git, or S3

See detailed configuration guides:

Store deployment scripts in Git for:

  • Change history and audit trails
  • PR-based review workflows
  • Rollback to previous versions

Use S3 for binary artifacts:

  • Application packages
  • Container images
  • Large data files

Local storage is ideal for:

  • Quick iteration during development
  • Testing new scripts
  • Air-gapped environments

Create separate storages for different purposes:

Storage Backends:
├── scripts-local # Development scripts
├── scripts-git # Production scripts (version controlled)
├── artifacts-dev # Development artifacts
└── artifacts-prod # Production artifacts

Cause: File doesn’t exist or path is incorrect

Solution:

  1. Verify file exists in storage location
  2. Check filename spelling (case-sensitive)
  3. Ensure storage backend is accessible

Cause: Cache or authentication issues

Solution:

  1. Check last fetch time (last_fetched on the git storage location)
  2. Verify authentication credentials
  3. Verify the configured reference still exists and that the credentials are valid; there is no refresh endpoint — the clone re-syncs on the next read

Cause: Insufficient permissions

Solution:

  1. Check IAM policy allows required actions
  2. Verify bucket policy
  3. Confirm credential configuration