Skip to content

Security: recap and quiz

  1. Authentication and authorization. Authentication says who is calling and happens at sign-in, and authorization says whether they may do this and happens on every request, for the specific object.
  2. Sessions and tokens. A session cookie, a JWT checked locally and an opaque token that is introspected cost 340, 500 and 520 ms for the first request at the starting settings, and a local check cannot take a token back before it expires.
  3. TLS and encryption. TLS protects data between the two ends of a connection, encryption at rest protects a stolen disk, and neither protects against a caller that the application serves.
  4. Secrets and least privilege. A leaked credential does damage equal to what it reaches times the time it stays valid, so keep secrets out of code, rotate them, and give each caller only what it needs.
  5. Zero trust. No request is trusted for the network it comes from, every access is decided on identity and policy, and the aim is to bound what a breach can reach.
Control What it gives What it does not give
Authentication Who is calling What they may do
Authorization What this caller may do Proof that the caller is who they say
TLS Confidentiality and integrity on the wire Protection after the data arrives, or of the next hop
Encryption at rest A stolen disk is unreadable Protection from the application’s own credentials
Local token check No round trip to check Revocation before the token expires
Least privilege A smaller reach for a leak Prevention of the leak
Zero trust Every access decided, a smaller trust zone A product to buy, or a complete defence

Each question points back to the lesson that answers it.

  1. Is every connection protected by TLS, and where does a TLS connection end? A proxy that ends it leaves the next hop to protect on its own. (TLS and encryption)
  2. What proves who is calling, and how long does that proof stay valid? (Sessions and tokens)
  3. If an account is disabled now, when does its last token stop working? Name the window, in seconds. (Sessions and tokens)
  4. Does each request check what the caller may do with this object, and is the default a refusal? (Authentication and authorization)
  5. Does a failed check say 401 or 403 for the right reason? (Authentication and authorization)
  6. Where does each secret live, who can read it, how often does it change, and what do you do the minute it leaks? (Secrets and least privilege)
  7. What does one leaked credential reach, in tables or operations? If the answer is everything, split it. (Secrets and least privilege)
  8. What does encryption at rest protect against here, and where is its key? (TLS and encryption)
  9. Would a request from inside the network get anything a request from outside would not? (Zero trust)

Nine questions cover the whole module. Every option is explained, whether it is right or wrong.

Security: module quiz

This quiz needs JavaScript to check your answers.

Question 1 of 9

A user is signed in. They change the number in the address of their order page from 522 to 523, which is another customer’s order, and the service shows it.

Which control is missing?

Choose one answer.

Question 2 of 9

A client presents a valid access token whose scope allows reading orders. It sends a request that creates an order.

Which answer does RFC 6750 suggest for a request that needs more than the token allows?

Choose one answer.

Question 3 of 9

In the course’s flow, the client is 80 ms from the service and 80 ms from the authorization server, and a processing time is 10 ms. With a session cookie, the first response arrives after 340 ms. With a JWT it takes two connections: one to the authorization server and one to the service.

How many milliseconds longer is the first response with the JWT?

Enter a number and choose its unit.

milliseconds
Question 4 of 9

Clients connect to a load balancer over TLS. The load balancer ends the TLS connection and forwards each request to a server inside the data centre over plain HTTP.

Which statement is true?

Choose one answer.

Question 5 of 9

A database’s disks are encrypted, and the key is held by a key service.

Which of these does that encryption stop?

Choose one answer.

Question 6 of 9

Five services share one database credential that can read and write all 20 tables. One service’s credential leaks.

Which change shrinks the damage of a leak the most?

Choose one answer.

Question 7 of 9

A request to an internal service comes from a machine inside the company’s own network.

What do NIST’s zero trust tenets say about it?

Choose one answer.

Question 8 of 9

A service checks a JWT locally and never asks the authorization server about it. The token lifetime is 1 hour, the longest RFC 6750 suggests for a bearer token. A token is stolen the moment it is issued, and the account is disabled immediately.

For how many seconds at most can the thief use the token?

Enter a number and choose its unit.

seconds
Question 9 of 9

Two internal services talk over TLS. The team wants the called service to know which service is calling, without a password.

What does mutual TLS add to ordinary TLS?

Choose one answer.

This module covered the controls on the request path. It does not cover attacks such as injection or cross-site scripting, and it does not make a system safe on its own: it gives the vocabulary and the cost of each control, so that a review can ask the right questions. The deployment module comes next, and with it the question of how a change reaches production.

Your progress

Built by GhaziAlibi.

© ShardCraft. All rights reserved.