Operator security

From RedHatProductSecurity/prodsec-skills · View interactive version

Operator security is an AI agent skill from the GitHub repository RedHatProductSecurity/prodsec-skills. Enforce least-privilege RBAC and secure runtime configuration for Kubernetes Operators. Use when building, reviewing, or auditing Operator manifests, ClusterRoles, Roles, OLM bundles, or CRD definitions.

How to use this skill

Skill file

Kubernetes Operator Security

Secure Operator manifests, OLM packaging, CRD governance, and runtime configuration for least-privilege operation.

Design Principles

Minimize Scope

Namespace Isolation

Fine-Grained Roles

RBAC Requirements

| Rule | Rationale |

|---|---|

| No wildcards -- list every verb and resource explicitly | Wildcards grant permissions to resources that may not exist yet |

| No cluster-admin | Grants unrestricted access to the entire cluster |

| No self-escalating RBAC | Roles must not grant the ability to create or modify their own RoleBindings |

| No Escalate verb | Allows circumventing RBAC restrictions |

| No Bind verb in role definitions | Allows binding to roles with higher privileges |

Container Security

OLM Installation

Installation Source

Operators must be installed via the Operator Lifecycle Manager (OLM). Direct deployment of operator pods bypasses OLM's dependency resolution, upgrade management, and security controls.

Required for: Telco (mandatory), Far-Edge (mandatory), Extended (mandatory), Non-Telco (optional)

Installation Status

Operators must report a Succeeded installation status. Failed or pending installations indicate packaging or dependency issues.

Required for: Telco (mandatory), Far-Edge (mandatory), Extended (mandatory), Non-Telco (optional)

No SCC Privileges

Operators must not require Security Context Constraint (SCC) access privileges during installation.

Required for: Telco (mandatory), Far-Edge (mandatory), Extended (mandatory), Non-Telco (optional)

No Duplicate Operators

Only one instance of the same operator CSV should exist per cluster.

Required for: Telco (mandatory), Far-Edge (mandatory), Extended (mandatory), Non-Telco (optional)

CRD Governance

OpenAPI Schema

All Custom Resource Definitions must include an OpenAPI v3 schema specification. This enables validation of custom resources at admission time.

Required for: Telco (mandatory), Far-Edge (mandatory), Extended (mandatory), Non-Telco (optional)

CRD Versioning

CRDs must have valid versioning with proper served/storage version configuration.

Required for: Telco (mandatory), Far-Edge (mandatory), Extended (mandatory), Non-Telco (optional)

Semantic Versioning

Operators must use semantic versioning (semver) for their CSV version.

Required for: Telco (mandatory), Far-Edge (mandatory), Extended (mandatory), Non-Telco (optional)

Single CRD Owner

Each CRD must be owned by only one operator. Multiple operators claiming ownership of the same CRD creates conflict and unpredictable behavior.

Required for: Telco (mandatory), Far-Edge (mandatory), Extended (mandatory), Non-Telco (optional)

Catalog Source Management

Bundle Count

Catalog sources must contain fewer than 1000 bundles. Large catalogs degrade OLM performance and increase memory consumption.

Required for: all profiles (optional, recommended best practice)

OLM Skip Range

Operators with multiple versions in a catalog must have a valid OLM skip range configured to enable proper upgrade paths.

Required for: all profiles (optional, recommended best practice)

Namespace Scoping

Tenant namespaces can only contain operators with SingleNamespaced or MultiNamespaced install modes. Cluster-scoped operators should not be installed in tenant namespaces.

Required for: all profiles (optional, recommended best practice)

Resource Constraints

Operator pods must not enable hugepages. Hugepage allocation is a node-level resource that should be reserved for application workloads, not operator infrastructure.

Required for: Telco (mandatory), Far-Edge (mandatory), Extended (mandatory), Non-Telco (optional)

Implementation Checklist

Certsuite Test Mapping

| Guidance | Certsuite Test ID | Profiles |

|----------|-------------------|----------|

| Installed via OLM | CODE0 | Telco/Far-Edge/Extended: mandatory, Non-Telco: optional |

| Installation succeeded | CODE0 | Telco/Far-Edge/Extended: mandatory, Non-Telco: optional |

| No SCC privileges | CODE0 | Telco/Far-Edge/Extended: mandatory, Non-Telco: optional |

| No duplicate operators | CODE0 | Telco/Far-Edge/Extended: mandatory, Non-Telco: optional |

| CRD OpenAPI schema | CODE0 | Telco/Far-Edge/Extended: mandatory, Non-Telco: optional |

| CRD versioning | CODE0 | Telco/Far-Edge/Extended: mandatory, Non-Telco: optional |

| Semantic versioning | CODE0 | Telco/Far-Edge/Extended: mandatory, Non-Telco: optional |

| Single CRD owner | CODE0 | Telco/Far-Edge/Extended: mandatory, Non-Telco: optional |

| Catalog bundle count | CODE0 | All profiles: optional (recommended) |

| OLM skip range | CODE0 | All profiles: optional (recommended) |

| Namespace scoping | CODE0 | All profiles: optional (recommended) |

| No hugepages | CODE0 | Telco/Far-Edge/Extended: mandatory, Non-Telco: optional |

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.