How elite-architects/distributed-secure-nas works
Intelligent Secure NAS is a distributed file-storage platform with security detection and centralized monitoring. Users store and share files through Nextcloud; upload events reach the intelligence API through a workflow hook or access-log forwarder, where they are recorded and uploads can be queued for classification. Separately, the security engine watches Nextcloud logs, detects suspicious activity, and can block IPs or report alerts. The README also documents Prometheus-to-Grafana observability. Several infrastructure services are documented but their implementation is not sampled, so those links are shown only where documentation supports them.
Main entry points: config Nextcloud storage · main.py Intelligence API · tasks.py File classifier · engine.py Security engine
Components 20
File storage
- Nextcloud storage
nas-core/nextcloud/config - Nginx proxy
nas-core/nginx/conf.d/nextcloud.conf - Nextcloud configuration
nas-core/nextcloud/config/config.sample.php - Object storage
nas-core/nextcloud/config/s3.config.php - NAS file data
Event intelligence
- File event hook
nas-core/nextcloud/config/event_hook.py - Upload log forwarder
nas-core/log_forwarder.py - Nginx access logs
- Intelligence API
nas-intel/api/main.py - Event database
- Classification queue
- File classifier
nas-intel/workers/tasks.py - Classification records
Security response
- Security engine
nas-sec/security_engine/engine.py - Nextcloud logs
- Fail2ban
Monitoring
- Prometheus
nas-sec/prometheus/prometheus.yml - Infrastructure metrics
- Grafana dashboards
Other components
- NAS user
Connections 20
- NAS user → Nextcloud storage: uploads files
- Nextcloud storage → Nginx proxy: serves behind
- Nextcloud storage → Nextcloud configuration: uses settings
- Nextcloud storage → Object storage: stores objects
- Nextcloud storage → File event hook: triggers hook
nas-core/nextcloud/config/event_hook.py - File event hook → Intelligence API: posts file event
nas-core/nextcloud/config/event_hook.py - Nextcloud storage → Nginx access logs: writes access logs
- Nginx access logs → Upload log forwarder: tails uploads
nas-core/log_forwarder.py - Upload log forwarder → Intelligence API: posts file event
nas-core/log_forwarder.py - Intelligence API → Event database: records events
nas-intel/api/main.py - Intelligence API → Classification queue: queues uploads
nas-intel/api/main.py - Classification queue → File classifier: dispatches task
- File classifier → NAS file data: reads file
nas-intel/workers/tasks.py - File classifier → Classification records: writes classification
nas-intel/workers/tasks.py - Nextcloud storage → Nextcloud logs: generates security logs
- Nextcloud logs → Security engine: watches log file
nas-sec/security_engine/engine.py - Security engine → Fail2ban: bans IP
nas-sec/security_engine/engine.py - Security engine → Intelligence API: posts alerts
nas-sec/security_engine/engine.py - Infrastructure metrics → Prometheus: collects metrics
- Prometheus → Grafana dashboards: visualizes metrics