Skip to content

Commit 7ea7a36

Browse files
authored
Merge pull request #34 from gustavocabral/cr/enable-sandbox
feat: Add EnableSandbox parameter for optional Docker
2 parents a3de86d + 7daf53a commit 7ea7a36

2 files changed

Lines changed: 27 additions & 6 deletions

File tree

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,18 @@ CreateVPCEndpoints: false # For cost optimization
491491
# Cons: Traffic goes through public internet
492492
```
493493

494+
### Sandbox Mode
495+
496+
```yaml
497+
EnableSandbox: true # Default: Docker installed
498+
# Provides isolated execution for code in group chats
499+
# Recommended for shared/team use
500+
501+
EnableSandbox: false # Skip Docker installation
502+
# Faster deployment (~2 min saved)
503+
# Use for personal/single-user deployments
504+
```
505+
494506
## Security Features
495507

496508
IAM roles eliminate API key risks. CloudTrail logs every API call. VPC Endpoints keep traffic private. Docker sandbox isolates execution.

clawdbot-bedrock.yaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,10 @@ Parameters:
7979
- "true"
8080
- "false"
8181

82+
EnableSandbox:
83+
Type: String
84+
Default: "true"
85+
Description: "Install Docker for sandboxed execution (recommended for group chats)"
8286
CreateS3Bucket:
8387
Type: String
8488
Default: "true"
@@ -103,6 +107,7 @@ Conditions:
103107
AllowSSH: !And
104108
- !Not [!Equals [!Ref AllowedSSHCIDR, ""]]
105109
- !Not [!Equals [!Ref KeyPairName, "none"]]
110+
EnableDocker: !Equals [!Ref EnableSandbox, "true"]
106111

107112
Mappings:
108113
# Architecture detection based on instance type
@@ -464,12 +469,16 @@ Resources:
464469
echo "[3/9] Configuring SSM Agent..."
465470
snap start amazon-ssm-agent || systemctl start amazon-ssm-agent
466471

467-
# Install Docker
468-
echo "[4/9] Installing Docker..."
469-
curl -fsSL https://get.docker.com | sh
470-
systemctl enable docker
471-
systemctl start docker
472-
usermod -aG docker ubuntu
472+
# Install Docker (if EnableSandbox=true)
473+
if [ "${EnableSandbox}" = "true" ]; then
474+
echo "[4/9] Installing Docker..."
475+
curl -fsSL https://get.docker.com | sh
476+
systemctl enable docker
477+
systemctl start docker
478+
usermod -aG docker ubuntu
479+
else
480+
echo "[4/9] Skipping Docker (EnableSandbox=false)..."
481+
fi
473482

474483
# Install Node.js
475484
echo "[5/9] Installing Node.js..."

0 commit comments

Comments
 (0)