Skip to content

Senior Quiz: Microservice Security

#

Question 1

A gateway authenticates a user and forwards X-User: alice to every service. When is a downstream service allowed to trust this header?

#

Question 2

When is token exchange preferable to direct user-token relay?

#

Question 3

A service uses Client Credentials to call inventory on behalf of a user. What identity information is lost unless explicitly modeled?

#

Question 4

What does mTLS prove by itself?

#

Question 5

A multi-tenant resource server reads iss from an unverified JWT and dynamically downloads metadata from that URL. What are the primary risks?

#

Question 6

An API key database stores raw keys so support can show customers their key later. Which design is safer?

#

Question 7

Where should tenant and object ownership authorization occur?

#

Question 8

A WebSocket authenticates once during connection and remains active for seven days after the user's access is revoked. Which controls are defensible?

#

Question 9

An API key is a 64-character random secret. Which storage and handling choices reduce breach impact?

#

Question 10

A Spring application defines one filter chain with .anyRequest().authenticated() and no securityMatcher, then later defines another chain for /mtls/**. Why does Spring Security reject this?

#

Question 11

A downstream service receives a token with an act claim identifying the caller as support-tool. Under what condition may it treat the request as delegated access on behalf of the token's subject?

#

Question 12

A multi-tenant resource server needs to validate tokens from many customers. Which design enforces isolation?

#

Question 13

An API key service stores SHA-256(prefix + secret) and a per-key salt. Why is this safer than storing the full key?

#

Question 14

An authenticated user in tenant-a tries to read a document owned by another tenant-a user. What should the resource server do?

#

Question 15

A GraphQL resolver for salary is protected with @PreAuthorize("hasRole('ADMIN')"), but the HTTP endpoint is permitAll. What happens when a non-admin user requests me { name salary }?

#

Question 16

A gRPC server receives a call with a valid TLS session but no client certificate. What should the server do?