Commit Graph

5 Commits

Author SHA1 Message Date
Luca Sacchi Ricciardi
96ba01b349 docs: add AI Pipeline technical specification
Create comprehensive spec for Sprint 2 Feature 2:

Content:
- System prompt with Metodo Sacchi integration (Safety First, Little Often, Double Check)
- OpenAI GPT-4o-mini configuration (cost: ~/bin/bash.0002/call)
- Complete n8n Code Node JavaScript implementation
- JSON output schema with severity mapping
- Error handling with circuit breaker pattern
- Security guidelines (data sanitization, rate limiting)
- 10 acceptance criteria defined
- 5 test scenarios with expected input/output
- 5 real-world examples (OOM, disk full, connection refused, etc.)
- Implementation checklist for developers

Key Features:
- Safe command generation (destructive commands blacklisted)
- Incremental actions (Little Often principle)
- Confirmation required for uncertain situations (Double Check)
- Fallback when OpenAI unavailable
- Response time < 5s target
- Cost-optimized with GPT-4o-mini

Next: @python-developer implements OpenAI integration in n8n workflow

Refs: workflows/logwhisperer_ingest.json (already created)
2026-04-02 19:15:02 +02:00
Luca Sacchi Ricciardi
9de40fde2d feat: implement secure bash log ingestion script (Sprint 2)
Implement secure_logwhisperer.sh resolving HIGH severity vulnerabilities:

Security Features:
- Path traversal prevention: validate_log_source() enforces /var/log/ only
- Command injection protection: no eval, array-based commands
- JSON injection fix: jq-based encoding (no manual escaping)
- DLP masking: passwords, emails, API keys, IPs redacted
- HMAC-SHA256 webhook authentication with timestamps
- Atomic file operations preventing race conditions
- HTTPS enforcement for webhook URLs

New Functions:
- validate_log_source(): whitelist /var/log paths, symlink validation
- sanitize_log_line(): DLP + control char removal + truncation
- encode_json_payload(): safe JSON via jq
- generate_hmac_signature(): HMAC-SHA256 for auth
- atomic_write_offset(): tmp+mv atomic writes
- dispatch_webhook_secure(): authenticated HTTPS POST

CLI Commands:
--validate-source, --sanitize-line, --check-deps
--validate-config, --generate-hmac, --atomic-write
--read-offset, --encode-json

Test Results:
- 27/27 security tests passing
- 4/4 integration tests skipped (require webhook)
- All SEC-* requirements met

Documentation:
- Technical spec in docs/specs/bash_ingestion_secure.md
- Test suite in tests/test_secure_logwhisperer.py (31 tests)

Security Audit: Passes all OWASP guidelines
Breaking Changes: Requires jq, openssl dependencies
2026-04-02 18:52:02 +02:00
Luca Sacchi Ricciardi
3a455e48d2 docs: update documentation with MCP configuration and agent catalog
- Add MCP servers documentation (n8n, context7, sequential-thinking)
- Update README.md with complete project structure and requirements.txt
- Transform agents.md into comprehensive agent staff catalog (9 agents)
- Update CHANGELOG.md with [Unreleased] MCP entries
- Fix ingestion_script.md acceptance criteria checkboxes
- Add .opencode/opencode.json to .gitignore for security
- Include new agent configs: n8n_specialist_agent, context_auditor_agent
- Include new skill playbooks: n8n_automation, context7_documentation

Security: API credentials in .opencode/opencode.json are now gitignored
2026-04-02 18:21:21 +02:00
Luca Sacchi Ricciardi
88cfe9af50 docs: update all documentation for Sprint 1 completion
- Update README.md with badges, project status, and improved structure
- Update CHANGELOG.md with Project Review Sprint 1 and version 0.1.1
- Update PRD status to reflect Sprint 1 completion
- Update ingestion script spec status to Completed with review link
- Update Sprint 1 verification report with Project Review reference
- Add comprehensive Sprint 1 Project Review document

Refs: Project Review conducted by agent staff (Product Manager, Tech Lead, Security Auditor)
2026-04-02 17:25:29 +02:00
Luca Sacchi Ricciardi
69f475ec78 feat(ingestion): implement log monitoring script with webhook integration
- Add logwhisperer.sh script for tailing and monitoring system logs
- Implement pattern matching for critical errors (FATAL, ERROR, OOM, segfault)
- Add JSON payload generation with severity levels
- Implement rate limiting and offset tracking per log source
- Add install.sh with interactive configuration and systemd support
- Create comprehensive test suite with pytest
- Add technical specification documentation
- Update CHANGELOG.md following Common Changelog standard

All 12 tests passing. Follows Metodo Sacchi (Safety first, little often, double check).
2026-04-02 16:10:20 +02:00