Security & Data Protection
Security & Data Protection
This page describes the security architecture, encryption, authentication, and data protection mechanisms in uControl Insight.
Encryption at Rest
Credential Storage
All discovery credentials (SSH passwords, private keys, SNMP community strings, API tokens, WinRM passwords, etc.) are encrypted before being stored in the database.
| Property | Value |
|---|---|
| Algorithm | AES-256-GCM (Galois/Counter Mode) |
| Key size | 256 bits (32 bytes) |
| IV size | 96 bits (12 bytes), randomly generated per encryption |
| Authentication tag | 128 bits — provides integrity verification |
| Key source | UCONTROL_MASTER_KEY environment variable (base64-encoded) |
| Key generation | openssl rand -base64 32 |
| Storage format | JSON envelope: {"alg": "AES-256-GCM", "iv": "...", "ct": "...", "kv": 1} |
The encrypted payload is stored in the credentials.encrypted_payload column. The kv (key version) field supports future key rotation — decrypt with old key, re-encrypt with new key.
The UCONTROL_MASTER_KEY is the most critical secret in the system. If lost, all stored credentials become permanently unrecoverable. Always include it in backups (encrypted with a backup password) and store a copy in a secure vault.
Worker Agent Credential Storage
Worker agents that store credentials locally use the same AES-256-GCM encryption. The worker's master key is stored in ./data/worker.key (auto-generated on first run). The worker's H2 database stores encrypted credential payloads identical to the control plane format.
Backup Encryption
When creating backups, the master key is encrypted using:
- Key derivation: PBKDF2 with HMAC-SHA256, 100,000 iterations, 128-bit random salt
- Encryption: AES-256-GCM with 96-bit random IV
- Input: User-provided backup password (minimum 8 characters)
This means backup files are safe to store on disk, S3, or any storage — the master key cannot be extracted without the backup password.
Password Storage
User passwords are hashed using bcrypt (Spring Security default) with a cost factor of 10. Passwords are never stored in plaintext or reversible encryption.
Encryption in Transit
Web UI & API
| Connection | Protocol | Notes |
|---|---|---|
| Browser → Control Plane | HTTPS (TLS 1.2+) | Terminated at reverse proxy (Apache/Nginx) or ALB. Session cookies are HttpOnly, Secure, SameSite=Strict. |
| API clients → Control Plane | HTTPS (TLS 1.2+) | Same TLS termination. API keys transmitted in Authorization: Bearer header. |
| Worker → Control Plane | HTTPS (outbound only) | Workers poll the control plane over HTTPS. All traffic is outbound — no inbound ports required at the worker site. |
Discovery Protocols
| Protocol | Encryption | Notes |
|---|---|---|
| SSH | Encrypted (SSH protocol) | Full encryption of commands and data. Supports password and key-based auth, including keyboard-interactive for ESXi. |
| WinRM (PowerShell Remoting) | Encrypted (WinRM/SOAP over HTTP) | Port 5985 (HTTP) — data is encrypted at the WinRM protocol level. Port 5986 (HTTPS) also supported. |
| SNMP v2c | Not encrypted | Community string sent in plaintext. Use SNMPv3 for sensitive environments. |
| SNMP v3 | Encrypted (authPriv) | Supports authentication (MD5/SHA) and privacy (DES/AES) protocols. |
| VMware REST API | HTTPS (TLS) | Skip TLS verification option for self-signed certificates in lab environments. |
| Proxmox REST API | HTTPS (TLS) | Skip TLS verification option available. |
| AWS SDK | HTTPS (TLS) | All AWS API calls use TLS. Credentials never leave the scanning host. |
| Omada Open API | HTTPS (TLS) | Skip TLS verification option for self-signed controllers. |
| NetFlow/IPFIX | Not encrypted | UDP protocols. Deploy collectors on the same network segment as exporters. |
Authentication & Authorisation
Multi-Layer Authentication
uControl Insight supports four authentication methods, processed in order by Spring Security filter chains:
| Priority | Method | Header / Mechanism | Use Case |
|---|---|---|---|
| 1 | Integration API Key | Authorization: Bearer ucm_... or X-Integration-Api-Key | Service-to-service integration (full access) |
| 2 | Worker API Key | X-Worker-Api-Key: uck_... | Worker agent authentication (scoped to site) |
| 3 | User API Token | Authorization: Bearer uci_... | Per-user programmatic access (inherits user roles) |
| 4 | Form Login | Session cookie (JSESSIONID) | Browser-based UI access |
Role-Based Access Control (RBAC)
| Role | Access |
|---|---|
READ_ONLY | View dashboards, assets, topology, flows, lifecycle, cloud costs |
DISCOVERY_ADMIN | Configure and run discovery targets, manage software rules |
API_USER | Generate personal API tokens from Profile page |
ADMINISTRATOR | Full access — users, credentials, workers, integration keys, backup/restore, audit log |
Users can have multiple roles (e.g. DISCOVERY_ADMIN + API_USER).
API Key Security
- Integration keys (
ucm_) — SHA-256 hashed before storage. Only the prefix is stored for identification. The full key is shown once at generation time. - User API tokens (
uci_) — Same SHA-256 hashing. Inherits the generating user's roles. - Worker API keys (
uck_) — SHA-256 hashed. Scoped to a site label. Can be revoked and deleted.
Session Security
- Session timeout: 8 hours
- Cookies:
HttpOnly(no JavaScript access),SameSite=Strict(CSRF protection),Secureflag configurable - CSRF protection enabled on all form submissions (Thymeleaf auto-includes CSRF tokens)
Database Security
- Database credentials stored in environment variables (not in application config files)
- Connection pool: HikariCP with connection-level timezone enforcement (
SET time_zone='+00:00') - All user input is parameterised via JdbcTemplate or Spring Data JDBC — no SQL injection vectors
- Flyway migrations validate schema integrity on every startup
Audit Trail
All security-relevant actions are logged to the audit_events table:
- User login / logout
- Credential CRUD operations (create, update, delete)
- Discovery target changes
- User management (create, update, disable, role changes)
- API key generation and revocation
- Worker registration and deregistration
- Backup creation and restore operations
Each audit event records: event type, actor (username), target type, target ID, details (JSON), IP address, and timestamp.
Network Security Recommendations
Control Plane
- Deploy behind a TLS-terminating reverse proxy (Apache, Nginx, or cloud ALB)
- Restrict management ports (8080/8180) to internal networks
- Use a dedicated database user with minimal privileges (GRANT on application database only)
- Set
UCONTROL_MASTER_KEYvia environment variable, not in config files
Worker Agents
- Workers require no inbound ports for core operation (outbound HTTPS only)
- If flow collection is enabled: inbound UDP 2055/4739 from network exporters only
- Store
worker.keywith restricted file permissions (chmod 600) - Worker API keys can be revoked immediately from the control plane if compromised
Discovery Targets
- Use dedicated service accounts with minimum required privileges for each platform
- Rotate credentials regularly — credential match patterns allow scoped access
- For SNMP: prefer SNMPv3 over v2c in production environments
- For VMware/Proxmox: use read-only roles where full admin is not needed
Compliance Considerations
| Requirement | How uControl Insight Addresses It |
|---|---|
| Encryption at rest | AES-256-GCM for all credentials, bcrypt for passwords |
| Encryption in transit | HTTPS/TLS for all web traffic, SSH for Linux/UNIX discovery |
| Access control | RBAC with 4 roles, multi-factor via API tokens |
| Audit logging | Comprehensive audit trail of all security-relevant actions |
| Data retention | Configurable backup retention, flow data partitioned by quarter |
| Key management | Master key in environment variable, backup encryption with PBKDF2 |
| Credential isolation | Worker agents store credentials locally — never transmitted to cloud |