Kahibaro
Discord Login Register

Authentication and authorization

Concepts: Authentication vs Authorization in OpenShift

OpenShift separates two closely related concerns:

Every request to the OpenShift API (via oc, web console, other tools) first goes through:

  1. Authentication → request gets a user identity.
  2. Authorization → access is allowed or denied based on that identity.

You will see this flow whenever you log in to the web console or use oc login.

Authentication in OpenShift

OpenShift does not manage accounts directly (like a traditional Unix /etc/passwd); it integrates with external identity providers and issues tokens.

Users, Identities, and Service Accounts

At the authentication layer, OpenShift deals with:

Mappings:

Service accounts:

Authentication Methods

OpenShift supports multiple authentication methods through identity providers. Typical ones:

Identity Providers (IdPs)

Identity providers are configured at the cluster level. Common options include:

Conceptually, each IdP:

  1. Verifies the user’s credentials (password, SSO token, etc.).
  2. Returns identity data (username, groups, email).
  3. OpenShift maps this identity to a user object and issues an access token.

As a regular user, you mainly need to know:

The OAuth Server and Tokens

OpenShift uses an internal OAuth server for authentication:

You can typically:

Tokens should be treated as sensitive credentials:

Authorization in OpenShift

Authorization decides whether an authenticated user or service account can perform an action (verb) on a resource.

Examples:

OpenShift mainly uses Kubernetes RBAC, with some OpenShift-specific roles and resources.

Basic Authorization Model

Every request is evaluated as:

If there is a grant → request allowed, otherwise → denied.

Roles and RoleBindings

Authorization is managed through Roles and Bindings:

Example pattern:

Conceptually:

Common Built-in Roles

Typical built-in ClusterRoles you will encounter:

OpenShift adds some specialized roles, for example:

As a developer or basic user you will mostly be assigned:

Checking and Understanding Your Permissions

OpenShift provides CLI tools to inspect and troubleshoot authorization:

Typically:

Project Membership and Access

Projects (namespaces) use RBAC for membership and access:

This means:

Service Accounts and Application Permissions

Service accounts are central to how applications access the API and other resources.

Key points:

For secure applications:

Labels, Groups, and External Identity

Authorization often leverages groups:

This decouples:

Security Considerations and Good Practices

Even at an introductory level, keep in mind:

Practical CLI Examples (Conceptual)

You will use these types of commands in hands-on work:

The exact outputs and available roles depend on how your cluster is configured and which roles your administrators have defined.

Views: 12

Comments

Please login to add a comment.

Don't have an account? Register now!