Security context
A security context is security-related configuration or execution state associated with a subject, request, container, or runtime environment.
Spring Security in Action, Second Edition
A security context is a Spring Security object that holds authentication information associated with the current execution or request.
- How it is used
- Retains authenticated-request data so controllers and authorization logic can use the current user and authorities.
- How deep it goes
- Defines the Authentication contract and explains thread-local, inheritable, and global management strategies, including asynchronous and concurrency hazards.
- Examples
- Uses controller access, an @Async username lookup, strategy configuration, and direct method-security tests with authenticated and unauthorized users.
- What you can do after
- Operate/configure it through SecurityContextHolder, retrieve authentication details, propagate them to asynchronous threads, and test secured methods.
Read how Spring Security in Action, Second Edition explains security context →
Kubernetes for Developers
A Kubernetes security context is a set of Pod or container settings that controls security-related execution properties such as the user identity.
- How it is used
- Configures elevated permissions for node-level work or restricts ordinary application containers to reduce risk.
- How deep it goes
- Shows concrete settings, startup failures, application fixes, and admission rejection diagnostics rather than an exhaustive security-context field reference.
- Examples
- Uses a privileged DaemonSet, a locked-down Pod, and a non-root service with port and file-permission failures.
- What you can do after
- Operate/configure a non-root workload and diagnose container startup or Pod admission failures.
Read how Kubernetes for Developers explains security context →
Quarkus in Action
A security context is information describing the authenticated principal and associated security state for a request or interaction.
- How it is used
- Connects authenticated request identity to REST-resource behavior such as ownership, filtering, and downstream service calls.
- How deep it goes
- Explains injection, principal lookup, anonymous handling, and filtering, but does not detail authentication-provider internals.
- Examples
- Demonstrates reservation creation, anonymous fallback, user ownership, and current-user reservation filtering.
- What you can do after
- Apply it via Jakarta REST injection to identify request users and enforce user-specific application behavior.
Google Anthos in Action
A Kubernetes security context is a pod or container specification field that controls identity, privilege, and filesystem security settings at runtime.
- How it is used
- Controls container identity and host-level privileges during Pod deployment.
- How deep it goes
- Defines user, group, filesystem-group, and privileged settings with runtime demonstrations, but defers cluster-wide enforcement to policy tools.
- Examples
- Uses busybox Pods, UID and group assignments, whoami and groups checks, and attempted host kernel changes.
- What you can do after
- Operate/configure Pods with nonroot identities and controlled privileges, then verify identity and host-operation behavior.
Read how Google Anthos in Action explains security context →
Related concepts
- thread localuses · Thread-local data is data whose value or instance is independently associated with each executing thread.
- authentication filterconfigured by · An authentication filter is a request-processing component that intercepts authentication requests and delegates them to an authentication mechanism.
- privileged containerconfigures · A privileged container is a container granted broad host-level permissions or capabilities that substantially reduce its normal isolation from the host.
- SecurityContextHolderused by · SecurityContextHolder is a Spring Security utility that provides access to the security context associated with the current execution.
- non-root userconfigures · A non-root user is an operating-system account without the unrestricted administrative privileges of the root or superuser account.
- authenticationhas part · Authentication is the process of establishing or verifying the identity of a user, service, device, or other communicating entity.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



