5.3 Describe REST API security

ENCOR 350-401 v1.2 · 5.0 Security

APIs open the network to automation, and to attackers if they are careless. REST API security covers who may call (authentication), what they may do (authorization), protecting the data in transit (TLS), and protecting the API itself (rate limits, input validation, secrets handling).

What you must know

Authentication and transport

MethodHowNotes
BasicUsername:password in Base64 in a headerOnly over HTTPS; often used once to get a token
API keyA static secret in a headerSimple; rotate and scope it
Token (bearer, JWT)Short-lived token from an auth endpoint, sent with each requestCatalyst Center uses X-Auth-Token; expires
OAuth 2.0An authorization server issues scoped tokensDelegated access without sharing passwords
Mutual TLSClient certificateStrong machine-to-machine identity

Every call must use HTTPS: Base64 is encoding, not encryption. Clients must validate the server certificate; disabling verification (verify=False) invites man-in-the-middle attacks.

The script authenticates once (1) and then uses the token, limited by its role, for each call (2).

Good practice

Commands

curl -H 'X-Auth-Token: …' https://…A token-authenticated call.
openssl s_client -connect host:443Inspect the API's TLS certificate.

Exam traps

Check yourself

Why is basic authentication acceptable only over HTTPS?
Base64 is reversible; TLS is what protects the credentials.
Where should an automation script keep its API secret?
In a secrets vault or environment variable, not in the code or repository.
A call returns 403. Is the token wrong?
Not necessarily: the caller is authenticated but its role does not allow that action.

More topics in 5.0 Security