Pcornel
Networking · Security

REST API Security

Cheat sheet · https://pcornel.dk/topic.php?topic=772

Back to the Topic

Answer

REST API security protects network and automation APIs with HTTPS/TLS and certificate validation, strong authentication (tokens, certificates), least-privilege authorisation, safe token handling and input validation. RESTCONF protocol details are in Automation → RESTCONF.

Remember

A successful HTTP response does not prove correct security policy, least privilege or full service function. Inspect the returned resource/body, effective permissions and independent operational state. Certificate, credential and authorization failures are distinct; keep secrets out of logs, shared command lines and copied Evidence.

First checks

curl -v https://host/… → certificate validated, TLS 1.2 or 1.3. A request without credentials → 401; a write with a read-only identity → 403. Check that API calls are logged with identity and source address.

Verify in this order

HTTPS with a validated certificate → every request authenticated → authorised by role or scope → input validated → rate-limited → logged

Where it usually breaks

physical/link dependency → local object state → peer/control state → policy → forwarding/adjacency → end-to-end result

REST API Security evidence chain

BoundaryQuestionEvidenceDoes not prove
DefinitionWhat is configured or intended?running configuration / controller policylive operation
CountersDid controlled traffic or an event reach this stage?scoped counters/timestampscomplete return path
Next boundaryWhat consumes or transports this state?trusted TLS endpoint → authentication/token → authorization scope → input/schema validation → action/result → audit/revocationapplication success

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=772

Confirmation

Confirm action

Continue?