Commit Graph

14 Commits

Author SHA1 Message Date
carnivuth
9d9a718aec feat:removed manual timezone management, delegate timezone configuration to execution environment
removed code that manages timezone setup from config file, krawl now
obeys to the environment configuration
2026-01-17 18:06:09 +01:00
Phillip Tarrant
5fe1984365 Merge branch 'dev' into feat/background-tasks 2026-01-07 11:51:27 -06:00
Phillip Tarrant
7d9f0616b7 Add background task to export suspicious IPs to text file
- Implement export-malicious-ips task that queries distinct IPs flagged
    as is_suspicious from database and writes to exports/malicious_ips.txt
  - Add exports volume mount to docker-compose.yaml for host persistence
  - Update entrypoint.sh to fix ownership of exports directory for krawl user
  - Update Dockerfile to create /app/exports directory during build

Other tasks can be added by creating them in the tasks dir using the same setup as this task.
All tasks *MUST* include a TASK_CONFIG dict and a main method in the file to work correctly.
2026-01-05 11:54:02 -06:00
Leonardo Bambini
ff98a77e1a parametrized into config.yaml + bug fix 2026-01-04 22:20:10 +01:00
Leonardo Bambini
48f38cb28e added scoring system + db model modifications 2026-01-04 19:12:23 +01:00
Phillip Tarrant
d458eb471d Migrate configuration from environment variables to YAML file
- Add YAML-based configuration loaded from config.yaml (CONFIG_LOCATION env var)
  - Add PyYAML dependency and install requirements in Dockerfile
  - Replace Config.from_env() with get_config() singleton pattern
  - Remove server_header from config (now randomized from wordlists only)
  - Update docker-compose.yaml to mount config.yaml read-only
  - Update Helm chart: restructure values.yaml, generate config.yaml in ConfigMap
  - Update Kubernetes manifests: ConfigMap now contains config.yaml, deployments mount it
  - Remove Helm secret.yaml (dashboard path now auto-generated in config.yaml)
2026-01-02 13:39:54 -06:00
Phillip Tarrant
6487cb493d Merge branch 'dev' into feat/sqlite3-storage 2025-12-28 11:08:10 -06:00
Phillip Tarrant
f1c142c53d feat: add SQLite persistent storage for request logging
- Add SQLAlchemy-based database layer for persistent storage
  - Create models for access_logs, credential_attempts, attack_detections, ip_stats
  - Include fields for future GeoIP and reputation enrichment
  - Implement sanitization utilities to protect against malicious payloads
  - Fix XSS vulnerability in dashboard template (HTML escape all user data)
  - Add DATABASE_PATH and DATABASE_RETENTION_DAYS config options
  - Dual storage: in-memory for dashboard performance + SQLite for persistence

  New files:
  - src/models.py - SQLAlchemy ORM models
  - src/database.py - DatabaseManager singleton
  - src/sanitizer.py - Input sanitization and HTML escaping
  - requirements.txt - SQLAlchemy dependency

  Security protections:
  - Parameterized queries via SQLAlchemy ORM
  - Field length limits to prevent storage exhaustion
  - Null byte and control character stripping
  - HTML escaping on dashboard output
2025-12-28 10:43:32 -06:00
Patrick Di Fazio
6556e17f91 Added timezone env variable handling 2025-12-28 17:07:18 +01:00
Patrick Di Fazio
61ba574e92 Added POST log and dashboard for used credentials 2025-12-27 19:17:27 +01:00
Phillip Tarrant
6ab4cf428f Merge branch 'main' into feat/logging-system 2025-12-26 11:52:52 -06:00
Phillip Tarrant
7916932ea7 Add rotating file logging system with app and access loggers
Implement a centralized logging singleton using Python's built-in
  logging module with RotatingFileHandler. Replaces all print()
  statements with structured logging.

  - Create LoggerManager singleton in src/logger.py
  - Add two loggers: app (krawl.log) and access (access.log)
  - Configure 1MB file rotation with 5 backups
  - Output to both files and stdout for container compatibility
  - Update handler.py, server.py, wordlists.py to use new loggers

  Benefits over print():
  - Persistent logs survive restarts for forensic analysis
  - Automatic rotation prevents unbounded disk growth
  - Separate access/app logs for easier analysis and SIEM integration
  - Consistent timestamps and log levels across all messages
  - Configurable verbosity without code changes
2025-12-26 08:23:38 -06:00
Phillip Tarrant
16aca9bba6 Add configurable HTTP Server header for deception
Add SERVER_HEADER environment variable to customize the HTTP Server
  response header, defaulting to Apache/2.2.22 (Ubuntu). This allows the
  honeypot to masquerade as different web servers to attract attackers.

  - Add server_header field to Config dataclass
  - Override version_string() in Handler to return configured header
  - Update documentation and all deployment configs
2025-12-26 07:53:05 -06:00
BlessedRebuS
076b2de584 First commit 2025-12-14 19:08:01 +01:00