Skip to content

Commit 687dbc8

Browse files
gl0bal01claude
andcommitted
docs: update README with Docker deployment, container security, rate limiting
- Add Docker/docker-compose deployment instructions - Add ratelimit.js and ratelimit.test.js to architecture tree - Add Dockerfile, docker-compose.yml, CI pipeline to architecture - Update security section: minimal env for child processes, DNS rebinding protection, rate limiting, container hardening details - Fix nuclei template path from /username/ to /opt/ Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3925ae9 commit 687dbc8

File tree

1 file changed

+31
-6
lines changed

1 file changed

+31
-6
lines changed

README.md

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,18 @@ npm run deploy
138138
npm start
139139
```
140140

141+
### Docker Deployment
142+
```bash
143+
# Build and run with Docker Compose (recommended)
144+
cp .env.example .env
145+
# Edit .env with your tokens and API keys
146+
docker compose up -d
147+
148+
# Or build manually
149+
docker build -t discord-osint-assistant .
150+
docker run -d --env-file .env discord-osint-assistant
151+
```
152+
141153
## ⚙️ Configuration
142154

143155
### Required Environment Variables
@@ -170,7 +182,7 @@ AI_API_KEY=your_ai_api_key
170182
EXIFTOOL_PATH=exiftool
171183
SHERLOCK_PATH=sherlock
172184
NUCLEI_PATH=nuclei
173-
NUCLEI_TEMPLATE_PATH=/username/nuclei-templates/http/osint/user-enumeration
185+
NUCLEI_TEMPLATE_PATH=/opt/nuclei-templates/http/osint/user-enumeration
174186
MAIGRET_PATH=maigret
175187
176188
# Access Control (Optional)
@@ -262,8 +274,9 @@ discord-osint-assistant/
262274
├── utils/ # Shared utility modules
263275
│ ├── validation.js # Input validation and sanitization
264276
│ ├── process.js # Safe process execution (spawn, no shell)
265-
│ ├── ssrf.js # SSRF protection (private IP blocking)
277+
│ ├── ssrf.js # SSRF protection (private IP + DNS rebinding)
266278
│ ├── permissions.js # Role-based command access control
279+
│ ├── ratelimit.js # Per-user rate limiting with cooldowns
267280
│ ├── temp.js # Temp directory and file management
268281
│ ├── chunks.js # Discord message chunking utilities
269282
│ └── config.js # Centralized environment config
@@ -275,7 +288,12 @@ discord-osint-assistant/
275288
│ └── utils/ # Utility function tests
276289
│ ├── validation.test.js
277290
│ ├── process.test.js
278-
│ └── ssrf.test.js
291+
│ ├── ssrf.test.js
292+
│ └── ratelimit.test.js
293+
294+
├── Dockerfile # Multi-stage production build
295+
├── docker-compose.yml # Hardened runtime config
296+
├── .github/workflows/ci.yml # CI pipeline (test, lint, audit, scan)
279297
280298
├── docs/ # Documentation
281299
│ └── INSTALLATION.md # Detailed setup guide
@@ -289,16 +307,23 @@ discord-osint-assistant/
289307
For full details, see [SECURITY.md](SECURITY.md).
290308

291309
### Built-in Security Features
292-
- **Safe Command Execution**: All external tools run via `spawn()` with argument arrays no shell string interpolation. See `utils/process.js`
310+
- **Safe Command Execution**: All external tools run via `spawn()` with argument arrays and a minimal environment (no secrets leaked to child processes). See `utils/process.js`
293311
- **Input Validation**: Comprehensive sanitization strips shell metacharacters, newlines, null bytes, and Unicode bypass characters. See `utils/validation.js`
294-
- **SSRF Protection**: URL-accepting commands validate that targets do not resolve to private/internal IP ranges. See `utils/ssrf.js`
312+
- **SSRF Protection**: URL-accepting commands validate resolved IPs against private ranges with connect-time DNS rebinding prevention via custom HTTP agents. See `utils/ssrf.js`
295313
- **Permission System**: Sensitive OSINT commands require elevated Discord permissions (ManageGuild/Administrator). Configurable via `OSINT_ALLOWED_ROLES` env var. See `utils/permissions.js`
314+
- **Rate Limiting**: Per-user cooldowns (3s/10s/30s by command category) and configurable daily limits. See `utils/ratelimit.js`
296315
- **Audit Logging**: All command usage is logged with user, guild, and timestamp
297316
- **Secure Error Handling**: Error responses shown to users are generic; detailed errors are logged server-side only
298317

318+
### Container Security
319+
- Multi-stage Dockerfile with pinned base image and non-root user
320+
- `docker-compose.yml` with `no-new-privileges`, `cap_drop: ALL`, read-only filesystem, tmpfs mounts, memory/PID limits
321+
- CI pipeline includes Trivy image scanning, npm audit, and SHA-pinned GitHub Actions
322+
- Child processes receive only PATH/HOME/LANG — no API keys or tokens
323+
299324
### Privacy Considerations
300325
- Configurable privacy modes for sensitive operations
301-
- Automatic cleanup of temporary files
326+
- Automatic cleanup of temporary files (startup purge + per-command cleanup)
302327
- API keys loaded from environment variables, never hardcoded
303328
- No investigation data persisted beyond Discord message lifetime
304329

0 commit comments

Comments
 (0)