Problem
The REST API (jplatform-rest-api) has no authentication or authorization, allowing anyone to deploy, start, stop, and undeploy applications.
Security Risk
CRITICAL: An unauthenticated attacker could:
- Deploy malicious applications
- Stop production applications (DoS)
- Undeploy all applications
- Access application metrics (information disclosure)
Impact
- Severity: CRITICAL
- Category: Security
- Cannot be deployed in production without authentication
- Violates principle of least privilege
Current State
All REST endpoints are open:
POST /api/applications - Deploy (anyone can deploy)
POST /api/applications/{id}/start - Start (unauthenticated)
POST /api/applications/{id}/stop - Stop (unauthenticated)
DELETE /api/applications/{id} - Undeploy (unauthenticated)
Required Implementation
Option 1: API Key Authentication (Simple)
api:
enabled: true
port: 8080
apiKey: ${API_KEY} # From environment variable
Option 2: JWT Authentication (Recommended)
api:
enabled: true
port: 8080
auth:
type: jwt
issuer: platform-java
audience: api-clients
Option 3: mTLS (Enterprise)
Client certificate authentication for high-security environments.
Authorization
After authentication, implement RBAC:
- Admin role: Full access (deploy, start, stop, undeploy)
- Operator role: Start/stop only
- Viewer role: Read-only (list, status, metrics)
Priority
P0 - CRITICAL - MUST be implemented before ANY production deployment.
Workaround
Until fixed, restrict REST API access via firewall:
# Allow only from localhost
iptables -A INPUT -p tcp --dport 8080 -s 127.0.0.1 -j ACCEPT
iptables -A INPUT -p tcp --dport 8080 -j DROP
Related
- SECURITY.md (doesn't mention REST API security)
- REST API module:
jplatform-rest-api
Problem
The REST API (
jplatform-rest-api) has no authentication or authorization, allowing anyone to deploy, start, stop, and undeploy applications.Security Risk
CRITICAL: An unauthenticated attacker could:
Impact
Current State
All REST endpoints are open:
POST /api/applications- Deploy (anyone can deploy)POST /api/applications/{id}/start- Start (unauthenticated)POST /api/applications/{id}/stop- Stop (unauthenticated)DELETE /api/applications/{id}- Undeploy (unauthenticated)Required Implementation
Option 1: API Key Authentication (Simple)
Option 2: JWT Authentication (Recommended)
Option 3: mTLS (Enterprise)
Client certificate authentication for high-security environments.
Authorization
After authentication, implement RBAC:
Priority
P0 - CRITICAL - MUST be implemented before ANY production deployment.
Workaround
Until fixed, restrict REST API access via firewall:
# Allow only from localhost iptables -A INPUT -p tcp --dport 8080 -s 127.0.0.1 -j ACCEPT iptables -A INPUT -p tcp --dport 8080 -j DROPRelated
jplatform-rest-api