COMP9321 · 06 API security · Terms

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/45

encourage image

There's no tags or description

Looks like no tags are added yet.

46 Terms

1
New cards
Confidentiality
Security goal: only the right people can read the data. ✎ Exam: HTTPS protects ___: an eavesdropper on café Wi-Fi can't read the token.
2
New cards
Integrity
Security goal: data is not altered in transit or by unauthorised people. ✎ Exam: The JWT signature protects ___: a changed payload fails verification.
3
New cards
Availability
Security goal: the service stays up and usable. ✎ Exam: Rate limiting protects ___ against request floods.
4
New cards
Accountability
Being able to trace who did what (audit logs). ✎ Exam: Audit logs give ___: we can see which account deleted the order.
5
New cards
Authentication
Proving who you are (password, token). Failure → 401 Unauthorized. ✎ Exam: ___: riders log in and receive a token sent with every request.
6
New cards
Authorisation
Deciding what an authenticated user may do. Failure → 403 Forbidden. ✎ Exam: ___: the API checks the caller owns the ride before returning it, else 403.
7
New cards
Least privilege
Give each user/app only the permissions it needs, nothing more. ✎ Exam: ___: the reporting app gets a read-only scope.
8
New cards
Fail-safe defaults
Deny access unless it is explicitly allowed. ✎ Exam: ___: a new endpoint is closed until roles are granted.
9
New cards
Complete mediation
Check permission on every access, not just the first. ✎ Exam: ___: the ride owner is checked on every request, not only at login.
10
New cards
Open design
Security must not depend on keeping the ___ secret (no security by obscurity). ✎ Exam: ___: we use the public JWT standard, the keys are secret, not the method.
11
New cards
Defence in depth
Several layers of protection, so if one fails the next still protects. ✎ Exam: ___: HTTPS, tokens, authorisation checks, input validation and rate limiting together.
12
New cards
Economy of mechanism
Keep security ___ simple (fewer places for bugs). ✎ Exam: ___: one shared auth middleware instead of custom checks per endpoint.
13
New cards
Psychological acceptability
Security should be easy to use correctly, or users will work around it. ✎ Exam: ___: single sign-on rather than five passwords.
14
New cards
Separation of privilege
Require more than one condition/key to grant access (e.g. two-factor). ✎ Exam: ___: refunds need both a manager role and a second approval.
15
New cards
HTTP Basic authentication
username:password Base64-encoded in a header on every request. Base64 is encoding, not encryption: safe only over HTTPS. ✎ Exam: HTTP ___ sends the password on every request, so it must only be used over HTTPS.
16
New cards
HTTP Digest authentication
Sends a hash of the password with a server nonce, so the password isn't sent in clear. Weak hashing; rarely used today. ✎ Exam: ___ ___ avoids sending the password, but is rarely used now.
17
New cards
Token-based authentication
Log in once → server issues a signed ___ → client sends Authorization: Bearer . Stateless; ___ expire; a stolen ___ works until expiry. ✎ Exam: ___ keeps the API stateless: the server verifies the signature, no session store.
18
New cards
JWT
JSON Web Token = header.payload.signature. Payload holds claims (user ID, role, expiry), only encoded, not secret; the signature proves it is genuine and unchanged. ✎ Exam: The ___'s payload is readable, so I never put a password in it.
19
New cards
API key
A long key identifying the application (not the user), sent in a header, never in the URL. Simple, but long-lived. ✎ Exam: The weather service identifies our app by its ___ in a header.
20
New cards
OAuth 2.0
Gives an app limited, delegated access to a user's data without sharing the password: scopes, revocable tokens, via an authorisation server. ✎ Exam: ___ with a read-only scope lets the app read Alice's calendar without her password.
21
New cards
Scope
In OAuth, the limited permission an access token grants (e.g. calendar.read). ✎ Exam: The token's ___ is calendar.read, so a write request is refused.
22
New cards
Authorisation server
In OAuth, the ___ where the user logs in and approves scopes; it issues the grant and the access token. ✎ Exam: The user types the password only at the ___, never in the app.
23
New cards
Resource server
In OAuth, the API holding the user's data; it checks the access token and scope before returning data. ✎ Exam: The ___ checks the token's scope before returning the calendar.
24
New cards
Access token
The ___ the app sends to the resource server; limited by scope, expires, revocable. ✎ Exam: The app exchanges the code for an ___, then calls the calendar API with it.
25
New cards
Authorisation grant
In OAuth's code flow, the short-lived code the app receives after the user approves, then exchanges for an access token. ✎ Exam: After approval, the app gets an ___ and swaps it for a token.
26
New cards
HTTPS / TLS
Encrypts traffic and authenticates the server: confidentiality and integrity in transit; the practical defence against man-in-the-middle. ✎ Exam: All endpoints use ___/TLS, so tokens can't be read on public Wi-Fi.
27
New cards
Man-in-the-middle attack
An ___ between client and server reads or changes the traffic. Defence: HTTPS/TLS. ✎ Exam: On café Wi-Fi, a man-in-the-___ could steal tokens sent over plain HTTP.
28
New cards
Input validation
Check type, length, range and format of every ___; use parameterised queries against SQL injection. Reject with 400. ✎ Exam: ___ rejects a latitude of 500 with 400 and stops injection.
29
New cards
SQL injection
Attacker input changes the meaning of a database query (' OR 1=1 --). Defence: parameterised queries + input validation. ✎ Exam: Building SQL by string concatenation allows ___; use parameterised queries.
30
New cards
Rate limiting
___ requests per client per time window (429). Stops abuse, brute force and denial of service; protects availability. ✎ Exam: ___ at 100 requests a minute per client returns 429 beyond that.
31
New cards
Denial of service
Overwhelming a ___ with requests so real users can't use it (attacks availability). ✎ Exam: Rate limiting reduces the risk of ___.
32
New cards
Audit log
A record of who accessed or changed what and when, so incidents can be traced (accountability). ✎ Exam: The ___ shows which token deleted the records.
33
New cards
Broken access control
OWASP #1: users can act outside their permissions, e.g. reading /users/B/rides by changing the ID. ✎ Exam: Returning another user's rides because only the token, not the owner, is checked is ___.
34
New cards
Security misconfiguration
OWASP risk: default passwords, verbose error messages, open endpoints, unnecessary features left on. ✎ Exam: Showing stack traces to clients is a ___.
35
New cards
OWASP Top 10
The Open Worldwide Application Security Project's list of the most critical web/API security risks: broken access control (#1), injection, cryptographic failures, misconfiguration, vulnerable components, authentication failures, logging failures. ✎ Exam: Broken access control tops the ___.
36
New cards
Integrity
Scenario: An attacker changes "role": "user" to "admin" inside a token, and the server rejects it. Why: ___, protected by the token's signature.
37
New cards
Authentication
Scenario: The API checks that the request really comes from user U123. Why: ___: who are you? (fails with 401).
38
New cards
Authorisation
Scenario: Logged-in user A requests /users/B/rides and must be refused. Why: ___ (what may you do?) → 403; missing it is broken access control.
39
New cards
Least privilege
Scenario: A reporting tool only reads orders, but was given full admin rights. Why: Violates ___: give it read-only access.
40
New cards
Defence in depth
Scenario: HTTPS, authentication, input validation and rate limiting are all used, so one failure isn't fatal. Why: ___: layered protections.
41
New cards
HTTP Basic authentication
Scenario: An API sends Authorization: ___ dXNlcjpwYXNz over plain HTTP. Why: HTTP ___ over plain HTTP: Base64 is trivially decoded, so the password is exposed. Use HTTPS or tokens.
42
New cards
Token-based authentication
Scenario: A REST API must stay stateless, but users shouldn't send their password with every request. Why: ___ (JWT): log in once, send the signed ___ each time.
43
New cards
OAuth 2.0
Scenario: An app must read Alice's calendar but not modify it (quiz). Why: ___ with a read-only scope: not her password, not an all-powerful key.
44
New cards
SQL injection
Scenario: A login form accepts the username ' OR 1=1 -- and logs the attacker in. Why: ___: use parameterised queries and validate input.
45
New cards
Rate limiting
Scenario: One client floods the login endpoint with thousands of password guesses. Why: ___ (429) against brute force and denial of service.
46
New cards
Broken access control
Scenario: Logged-in user A changes the URL from /users/A/orders to /users/B/orders and sees B's orders. Why: ___ (OWASP #1): check ownership on every request, return 403.