Security fixes should be applied to the latest maintained version of this repository.
If you discover a security issue, do not post secrets or exploit details in public issues.
Please report security concerns through a private channel or repository owner contact method.
- Do not share API keys, bot tokens, or access credentials publicly.
- Revoke any exposed credentials immediately.
- Update local configuration files after rotating secrets.
This repository includes a security overview for Brahma Evo's current runtime model, gateway exposure, and authentication flow.
- API keys are stored in
config/api_keys.json. - The code reads
gemini_api_keyandopenrouter_api_keydirectly from this file. - This file is a local configuration artifact and should never be committed to source control.
- There is no built-in secret vault; security depends on file system permissions and local access controls.
- Brahma Evo uses Gemini as the primary AI provider and OpenRouter as a fallback.
- Both API keys are loaded from the local config file and sent to the respective service clients.
config/api_keys.jsonis plaintext JSON and is not encrypted by the application.
Brahma Connect is the local device gateway layer for Brahma Evo.
- Default gateway config:
config/brahma_connect.json - Default host:
0.0.0.0 - Default port:
8765 - Default advertise:
true - Default pairing TTL:
300seconds
Because the gateway binds to 0.0.0.0, it is reachable from any interface on the host unless OS firewall rules block it.
- Optional mDNS discovery is provided through
brahma_connect.gateway.discovery.GatewayDiscoveryand Zeroconf. - Discovery advertises service
_BRAHMA._tcp.local.only when the Zeroconf library is installed andadvertiseis enabled.
- The gateway is designed as a local network transport.
- There is no built-in TLS/SSL for the gateway websocket in the current code.
- Gateway traffic is not encrypted end-to-end by default and relies on LAN trust.
- Pairing uses a temporary pairing offer created by
brahma_connect.gateway.pairing.PairingManager. - Each offer includes a
pairing_token, a 6-digitpairing_code, and an expiration timestamp. - Pairing offers expire after
pairing_ttl_seconds(default 300 seconds).
- Incoming device connections begin with
HELLOand create a pending request. - A user must explicitly approve or reject each pending pairing request through the app.
- Approved devices are added to the registry and issued a permanent
device_secret.
- Device records are stored in
config/brahma_connect/devices.j 5B3A son. - Device secrets are not stored plaintext; the repository stores a
secret_hash. - The
secret_hashis computed usinghashlib.sha256(secret.encode('utf-8')).hexdigest(). - Authentication uses constant-time comparison (
hmac.compare_digest) to avoid timing attacks.
- Authenticated device connections use the websocket
/wsendpoint and send anAUTHENTICATEmessage withdevice_idanddevice_secret. - On successful authentication, the device is marked online and registered in the connection hub.
- Revoked devices are rejected by
DeviceManager.authenticate.
- The gateway exposes REST endpoints for
/gateway/info,/gateway/pair,/gateway/devices,/gateway/devices/{device_id}/revoke,/gateway/devices/{device_id}/forget,/gateway/pending,/gateway/pending/{pending_id}/approve, and/gateway/pending/{pending_id}/reject. - These endpoints are exposed on the same host and port as the gateway service.
- There is no API authentication for these admin endpoints in the current code, so local network access is effectively trusted.
- The local dashboard (
dashboard/server.py) includes_ensure_network_access. - This helper attempts to open a Windows firewall rule for dashboard ports and includes cross-platform stubs for macOS/Linux.
- The dashboard uses port
8000by default and a legacy HTTPS alias on8001.
- The gateway does not automatically open OS firewall ports.
- Because it binds to
0.0.0.0:8765, administrators should verify and restrict firewall access manually if needed.
- Pairing is explicit and requires user approval.
- Device secret handling uses hashed secrets and constant-time comparison.
- Temporary pairing codes expire quickly.
- Device revocation and forgetting are supported.
- The dashboard encrypts local commands using AES-256-CBC with a session-derived key.
- No built-in gateway TLS/SSL for WebSocket
/ws; websocket traffic is plaintext on the LAN. - Admin REST endpoints have no authentication layer in the current codebase.
- Local API key storage is plaintext.
- The gateway host default of
0.0.0.0exposes the service broadly unless OS firewall restrictions are applied. - There is no remote access firewall or gateway-level authentication beyond pairing and device credentials.
- Keep
config/api_keys.jsonprivate and out of version control. - Use OS firewall rules to restrict access to port
8765when Brahma Connect is enabled. - Disable
advertiseinconfig/brahma_connect.jsonunless discovery is needed. - Revoke lost or untrusted devices using
/gateway/devices/{device_id}/revoke. - Run Brahma Evo on a trusted local network.
- Consider adding HTTPS/TLS support for the gateway websocket and admin REST endpoints for secure remote access.