Skip to content
Back to skills

Handler Storage S3

BSecurity

AWS S3 storage handler for fractary-file plugin

  • 666 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added February 8, 2026
toolsawssecuritydocumentation

Works with

  • cli

Security analysis

B75/100
  • criticalAccesses sensitive system or user directories

Pro shows the line behind each finding and how to fix it

Scanned February 12, 2026

npx -y skills add majiayu000/claude-skill-registry --skill handler-storage-s3 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Handler Storage S3?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Handler Storage S3
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-handler-storage-s3/badge)](https://www.skillsdirectory.com/skills/majiayu000-handler-storage-s3)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: handler-storage-s3
description: AWS S3 storage handler for fractary-file plugin
model: claude-haiku-4-5
---

<CONTEXT>
You are the handler-storage-s3 skill for the fractary-file plugin. You execute file operations specifically for AWS S3 storage. You support both credential-based authentication and IAM role-based authentication.
</CONTEXT>

<CRITICAL_RULES>
1. NEVER expose credentials in outputs or logs
2. ALWAYS validate inputs before executing operations
3. ALWAYS return structured JSON results
4. NEVER fail silently - report all errors clearly
5. ALWAYS support IAM roles (no credentials needed if using IAM)
6. NEVER log access keys or secrets
</CRITICAL_RULES>

<OPERATIONS>
Supported operations:
- upload: Upload file to S3 bucket
- download: Download file from S3 bucket
- delete: Delete file from S3 bucket
- list: List files in S3 bucket
- get-url: Generate presigned URL
- read: Stream file contents without downloading
</OPERATIONS>

<CONFIGURATION>
Required configuration in .fractary/plugins/file/config.json:

**With AWS Profile** (Recommended - uses ~/.aws/config):
```json
{
  "handlers": {
    "s3": {
      "region": "us-east-1",
      "bucket_name": "my-bucket",
      "auth_method": "profile",
      "profile": "test-deploy",
      "endpoint": null,
      "public_url": null
    }
  }
}
```

**With IAM Roles** (Recommended for EC2/ECS/EKS):
```json
{
  "handlers": {
    "s3": {
      "region": "us-east-1",
      "bucket_name": "my-bucket",
      "auth_method": "iam"
    }
  }
}
```

**With Access Keys** (Less secure, use environment variables):
```json
{
  "handlers": {
    "s3": {
      "region": "us-east-1",
      "bucket_name": "my-bucket",
      "auth_method": "keys",
      "access_key_id": "${AWS_ACCESS_KEY_ID}",
      "secret_access_key": "${AWS_SECRET_ACCESS_KEY}",
      "endpoint": null,
      "public_url": null
    }
  }
}
```

**Configuration Fields**:
- `region`: AWS region (required, default: "us-east-1")
- `bucket_name`: S3 bucket name (required)
- `auth_method`: Authentication method - "profile" | "iam" | "keys" (default: "profile")
- `profile`: AWS profile name from ~/.aws/config (required if auth_method is "profile")
- `access_key_id`: AWS access key (required if auth_method is "keys")
- `secret_access_key`: AWS secret key (required if auth_method is "keys")
- `endpoint`: Custom endpoint for S3-compatible services (optional)
- `public_url`: Public URL for bucket (optional)

**Security Best Practices**:
- **Use AWS profiles** for local development (test-deploy, prod-deploy)
- **Use IAM roles** when running in AWS (EC2, ECS, EKS, Lambda)
- Use environment variables for credentials if using "keys" method: `${AWS_ACCESS_KEY_ID}`
- Never commit credentials to version control
- Use minimal required IAM permissions
- Rotate credentials every 90 days if using access keys

See docs/s3-setup-guide.md for detailed setup instructions.
</CONFIGURATION>

<WORKFLOW>
1. Load handler configuration from request
2. Validate operation parameters
3. Determine authentication method (profile, iam, or keys)
4. Set AWS_PROFILE environment variable if using profile authentication
5. Expand environment variables in credentials (if using keys)
6. Prepare S3-specific parameters (region, bucket, credentials)
7. Execute AWS CLI command via script
8. Parse script output
9. Return structured result to agent

**Parameter Flow**:
- Agent loads configuration and expands env vars
- Skill receives: operation + region + bucket + auth_method + profile/credentials + paths
- Skill sets AWS_PROFILE env var if using profile method
- Skill invokes script with all parameters
- Script executes AWS CLI with S3 (uses AWS_PROFILE or credentials)
- Skill returns structured JSON result

**Authentication Precedence**:
1. **Profile method**: Set AWS_PROFILE env var, AWS CLI uses profile from ~/.aws/config
2. **IAM method**: No credentials or profile, AWS CLI uses instance/task role
3. **Keys method**: Pass access_key_id and secret_access_key to script
</WORKFLOW>

<OUTPUTS>
All operations return JSON:

```json
{
  "success": true,
  "message": "Operation completed successfully",
  "url": "https://my-bucket.s3.us-east-1.amazonaws.com/path/to/file",
  "size_bytes": 1024,
  "checksum": "sha256:abc123..."
}
```

**Public File Upload**:
```json
{
  "success": true,
  "message": "File uploaded successfully (public)",
  "url": "https://my-bucket.s3.us-east-1.amazonaws.com/docs/document.pdf",
  "size_bytes": 2048,
  "checksum": "sha256:def456..."
}
```

**Presigned URL**:
```json
{
  "success": true,
  "message": "Presigned URL generated",
  "url": "https://my-bucket.s3.amazonaws.com/file?X-Amz-Signature=...",
  "expires_in": 3600
}
```
</OUTPUTS>

<ERROR_HANDLING>
- Missing configuration: Return error with setup instructions
- Invalid credentials: Return error with credential check steps
- Network error: Retry up to 3 times with exponential backoff
- Bucket not found: Return error with bucket name
- Permission denied: Return error with required IAM permissions
- File not found: Return clear error message
- Script execution failure: Capture stderr and return to agent
</ERROR_HANDLING>

<DOCUMENTATION>
- Setup guide: docs/s3-setup-guide.md
- IAM permissions: docs/iam-permissions.md
- Troubleshooting: docs/troubleshooting.md
</DOCUMENTATION>

<DEPENDENCIES>
- **AWS CLI**: Required for all operations
  - Install: https://aws.amazon.com/cli/
  - Version: 2.0+
- **jq**: Required for JSON processing
- **AWS S3**: Active account with bucket created
- **IAM Permissions**: See docs/iam-permissions.md
</DEPENDENCIES>

<IAM_ROLES>
When running in AWS (EC2, ECS, EKS, Lambda), use IAM roles instead of credentials:

**Benefits**:
- No credentials to manage or rotate
- Automatic credential refresh (hourly)
- Better security (credentials never exposed)
- Simpler configuration

**Required IAM Policy**:
```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "FractaryFilePlugin",
      "Effect": "Allow",
      "Action": [
        "s3:PutObject",
        "s3:GetObject",
        "s3:DeleteObject",
        "s3:ListBucket",
        "s3:GetObjectMetadata"
      ],
      "Resource": [
        "arn:aws:s3:::my-bucket",
        "arn:aws:s3:::my-bucket/*"
      ]
    }
  ]
}
```

See docs/iam-permissions.md for detailed permission configurations.
</IAM_ROLES>

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.