Skip to content

Commit 2b42b96

Browse files
authored
Merge pull request #3558 from embik/docs-security-self-assessment
Add security self-assessment
2 parents 4429699 + aa2e48d commit 2b42b96

File tree

2 files changed

+265
-0
lines changed

2 files changed

+265
-0
lines changed

docs/content/contributing/.pages

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ nav:
22
- index.md
33
- getting-started.md
44
- coding.md
5+
- governance
56
- continuous-integration
67
- guides
Lines changed: 264 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,264 @@
1+
# Security Self-Assessment kcp
2+
3+
This document is intended to aid the project's maintainers, contributors, and users understand the project's security status and help identify points of improvement.
4+
5+
## Table of Contents
6+
7+
* [Metadata](#metadata)
8+
* [Security links](#security-links)
9+
* [Overview](#overview)
10+
* [Actors](#actors)
11+
* [Actions](#actions)
12+
* [Background](#background)
13+
* [Goals](#goals)
14+
* [Non-goals](#non-goals)
15+
* [Self-assessment use](#self-assessment-use)
16+
* [Security functions and features](#security-functions-and-features)
17+
* [Project compliance](#project-compliance)
18+
* [Secure development practices](#secure-development-practices)
19+
* [Security issue resolution](#security-issue-resolution)
20+
* [Appendix](#appendix)
21+
22+
## Metadata
23+
24+
| | |
25+
| ---------------- | -------- |
26+
| Assessment Stage | Complete |
27+
| Software | [kcp](https://kcp.io) |
28+
| Security Provider | No |
29+
| Languages | Go |
30+
| SBOM | kcp does not currently generate SBOMs on release |
31+
| Security links | See below |
32+
33+
### Security links
34+
35+
| Doc | url |
36+
| ------------------------- | ----------------------------------------------- |
37+
| Reporting security issues | [here](https://github.com/kcp-dev/kcp/security) |
38+
| Security process | [here](https://github.com/kcp-dev/kcp/blob/main/SECURITY.md) |
39+
40+
## Overview
41+
42+
kcp is an open-source, Kubernetes-like control plane designed for multi-cluster and multi-tenant environments. It provides a control plane that is not tied to a specific set of hardware, allowing users and services to manage APIs across a group of "logical clusters". kcp is specifically NOT a control plane for managing container workloads but higher level abstractions, which in turn might be run on separate Kubernetes clusters.
43+
44+
### Background
45+
46+
The kcp project began as an experiment to add the concept of "logical clusters" to the Kubernetes API server, effectively decoupling the powerful control plane from its traditional role in container orchestration. The project is built upon upstream Kubernetes code but is not a fork, with a strong commitment to maintaining 100% compatibility with the Kubernetes API machinery and ecosystem tooling. This allows kcp to provide a generic, horizontally scalable control plane for use cases beyond containers.
47+
48+
### Actors
49+
50+
The kcp architecture is composed of several key primitives that work together to provide a scalable, multi-tenant control plane.
51+
52+
#### kcp Server Components
53+
54+
* **Workspaces**: The primary user-facing unit of tenancy and isolation. From a user's perspective, a Workspace is a fully-isolated, Kubernetes-like cluster with its own unique API endpoint, CustomResourceDefinitions (CRDs), and RBAC policies.
55+
56+
* **Logical Clusters**: The underlying implementation construct for a Workspace. A logical cluster is a logical partition within the kcp data store (etcd), ensuring that objects from different workspaces are stored in disjoint key prefixes, which is the primary mechanism for enforcing isolation. The goal is to make creating a logical cluster as cheap and fast as creating a Kubernetes namespace.
57+
58+
* **Virtual Workspaces**: Endpoints that provide a Kubernetes-like API interface, but are not backed by a logical cluster for storage. They provide a computed "view" of certain resources across logical clusters. The exact semantics depend on the virtual workspace implementation, diferent virtual workspace endpoints provide different views according to their role. Access to virtual workspace endpoint is guarded by RBAC.
59+
60+
* **Shards**: A running instance of the kcp server process. Each shard hosts a set of logical clusters, and a full kcp installation can be composed of many shards to achieve horizontal scalability.
61+
62+
#### kcp kubectl Plugin (CLI)
63+
64+
kcp provides a set of plugins for `kubectl`, the Kubernetes command line client. These plugins interact with kcp through its Kubernetes-like APIs and offer command line tooling for interacting with the unique features of kcp (see above for some of them). All of the interactions are executed via Kubernetes client libraries and use the client credentials passed to `kubectl` (e.g. via the `KUBECONFIG` environment variable).
65+
66+
##### kcp Components
67+
68+
* **kcp**: The `kcp` binary provides the means to run a kcp shard (see above). It can either be launched completely standalone and then embeds a "mini" front-proxy, virtual-workspaces and a cache-server to run a fully functional kcp instance, or be run just to serve API endpoints and run controller loops.
69+
70+
* **cache-server**: The cache server provides a shared Kubernetes-like API layer that all shards connect to and cache objects relevant to other shards (e.g. `APIExports`) so that shards do not need to directly interact with each other.
71+
72+
* **kcp-front-proxy**: An intelligent API gateway that sits in front of all shards. It is aware of all logical clusters and the shards they reside on, and it routes incoming user requests to the correct shard.
73+
74+
#### API Management
75+
76+
kcp provides resources dedicated to managing available APIs in a Workspace.
77+
78+
* **APIExport**: Allows a service provider in one workspace to publish an API for consumption by other workspaces.
79+
80+
* **APIBinding**: Allows a service consumer in one workspace to bind to an APIExport from another workspace, making the published API available in the local workspace.
81+
82+
The ability to bind APIs across workspaces (a security boundary) is guarded by RBAC checks.
83+
84+
### Actions
85+
86+
* **Workspace Management**: Users can create, list, and navigate between workspaces, each providing an isolated API endpoint.
87+
88+
* **API Sharing**: Service providers can securely offer APIs across workspace boundaries using a declarative APIExport and APIBinding model.
89+
90+
* **API Request Routing**: The front-proxy routes all standard client traffic to the appropriate shard based on the workspace path in the request URL.
91+
92+
* **Administrative Wildcard Requests**: A privileged "wildcard" endpoint allows global administrators to list resources across all logical clusters on a specific shard, bypassing standard workspace isolation for operational purposes.
93+
94+
### Goals
95+
96+
* Provide a scalable, multi-tenant control plane that can serve hundreds or thousands of isolated tenants.
97+
* Enable service providers to offer Kubernetes-like APIs that can be consumed by consumers across multiple isolated tenants.
98+
* Maintain a high degree of compatibility with the standard Kubernetes API and toolchain (e.g., kubectl, client-go, multicluster-runtime).
99+
100+
101+
#### Security Goals
102+
103+
* **Strict Workspace Isolation:** Ensure that tenants in one Workspace cannot see, access, or affect resources in another Workspace unless explicitly authorized. This is the core security boundary of the system.
104+
* **Scoped Permissions:** The permissions granted to a Syncer on both the kcp server and the physical cluster must be limited to the minimum required for its function (Principle of Least Privilege). - TODO remove Syncer
105+
* **Standard Kubernetes Auth:** Leverage and extend Kubernetes authentication and authorization (RBAC) mechanisms for access control to the kcp server and within Workspaces.
106+
107+
### Non-goals
108+
109+
* kcp does not manage the data plane or physical infrastructure of downstream clusters (e.g., nodes, CNI, storage). It is purely a control plane.
110+
* kcp is not a cluster provisioning tool; it doesn't define what kind of APIs are offered (which could include a cluster provisioning API, but that is not part of the core kcp efforts).
111+
* kcp's logical clusters cannot be used as dedicated control planes for Kubernetes clusters.
112+
113+
## Self-assessment Use
114+
115+
This self-assessment is not intended to provide a security audit of kcp or function as an independent assessment or attestation of kcp's security health.
116+
117+
This document provides kcp users with an initial understanding of kcp's security, where to find existing security documentation, kcp's plans for security, and a general overview of kcp's security practices, both for the development of kcp and its operational security.
118+
119+
## Security Functions and Features
120+
121+
In general, kcp is a project; therefore, we do not list all the features here, only the "non-functional" security features.
122+
123+
### Critical
124+
125+
#### Workspace Isolation
126+
127+
The central security feature of kcp is the logical isolation provided by Workspaces. All API requests are scoped to a Workspace, and the system's authentication and authorization layers ensures that a user's credentials are only valid for the Workspaces they have been granted access to. This prevents cross-tenant data leakage and interference.
128+
129+
#### Authentication and Authorization
130+
131+
kcp uses the standard Kubernetes API server authentication and authorization mechanisms. It extends Kubernetes RBAC to operate within the context of Workspaces, allowing for fine-grained control over who can do what within each isolated environment.
132+
133+
#### Virtual Workspace Isolation
134+
135+
Given the broad permissions that virtual workspace components need to create various computed views across all available resources on a kcp shard, they often have to run with administrative permissions. It is therefore critical that virtual workspace implementations properly isolate requests from each other and use proper impersonation and/or enhanced authN/authZ checks for validating requests.
136+
137+
### Security Relevant
138+
139+
#### API Scoping (APIExport/APIBinding)
140+
141+
kcp allows administrators to control which APIs are available within a Workspace. An APIExport object makes an API available for consumption, and an APIBinding object makes it accessible within a specific Workspace. This mechanism can be used to limit the attack surface available to tenants.
142+
143+
#### APIExport Identity
144+
145+
To prevent data leakage when multiple tenants consume APIs with the same name (e.g., widgets.example.com) from different providers, each APIExport is associated with a unique cryptographic identity. A hash of this identity is used as part of the etcd storage path for all resources created via that export, ensuring complete data segregation.
146+
147+
#### Permission Claims
148+
149+
The APIExport/APIBinding model includes an explicit consent mechanism called PermissionClaims. An API provider must declare any access it needs to resources (like ConfigMaps or Secrets) in a consumer's workspace. The consumer must then explicitly review and accept these claims in their APIBinding for the access to be granted.
150+
151+
#### Maximal Permission Policy
152+
153+
An APIExport can define a maximalPermissionPolicy using standard RBAC rules. This policy acts as an upper bound on the permissions that any user from a consuming workspace can have on the exported API's resources, allowing the provider to enforce security constraints.
154+
155+
## Project Compliance
156+
157+
The project has no written record of complying with a well known security standard like FIPS.
158+
159+
## Secure Development Practices
160+
161+
### Development Pipeline
162+
163+
kcp's development pipeline uses [prow](https://docs.prow.k8s.io/docs/overview/) and thus ensures the software is tested for being robust, reliable, and secure. It involves several stages of reviews by project maintainers and automated testing flows.
164+
165+
#### Contributor Requirements
166+
167+
Contributors to kcp are required to [sign their commits](https://docs.kcp.io/kcp/latest/contributing/getting-started/#developer-certificate-of-origin-dco), adhering to the Developer Certificate of Origin (DCO). Contributors use the Signed-off-by line in commit messages to signal their adherence to these requirements.
168+
169+
Contributors can start by forking the repository on GitHub, reading the installation document for build and test instructions, and playing with the project.
170+
171+
#### Container Images
172+
173+
The container images used in kcp are built by [automatic pipelines](https://github.com/kcp-dev/infra/blob/main/prow/jobs/kcp-dev/kcp/kcp-postsubmits.yaml) and not individual contributors.
174+
175+
#### Reviewers
176+
177+
A project maintainer or code reviewer (called approver) reviews a commit before it is merged. This practice helps catch potential security issues early in the development process.
178+
179+
Maintainers or reviewers cannot merge their own code without a second review.
180+
181+
#### Automated Checks
182+
183+
kcp includes automated checks as part of its continuous integration (CI) process. The project has checks for dangerous workflow patterns and scans for known vulnerabilities in its dependencies.
184+
185+
#### Integration Tests
186+
187+
kcp's upstream continuous integration (CI) tests will automatically run integration tests against proposed changes. Users are not required to run these tests locally, but they may.
188+
189+
### Communication Channels
190+
191+
kcp Communication Channels
192+
193+
#### Internal Communication
194+
195+
* Slack: The kcp-dev Slack channel in the [Kubernetes slack](https://communityinviter.com/apps/kubernetes/community)
196+
or [issues](https://github.com/kcp-dev/kcp/issues)
197+
* Security topics: [kcp-dev-private](https://groups.google.com/g/kcp-dev-private) Google Group
198+
199+
#### Inbound Communication
200+
201+
Users or prospective users communicate with the kcp team through Slack or GitHub issues and pull requests. GitHub is a platform that hosts the kcp project's codebase and provides features for tracking changes, managing versions, and collaborating on code. Users can submit pull requests to report issues, propose changes, or contribute to the project.
202+
203+
* GitHub: [issues](https://github.com/kcp-dev/kcp/issues)
204+
* Slack: [#kcp-users](https://app.slack.com/client/T09NY5SBT/C021U8WSAFK)
205+
206+
#### Outbound Communication
207+
208+
* Mailing list: [kcp-users](https://groups.google.com/g/kcp-users)
209+
* Website and blog: [kcp.io](https://kcp.io/)
210+
211+
##### Community Meetings
212+
213+
kcp [community meetings](https://docs.google.com/document/d/1PrEhbmq1WfxFv1fTikDBZzXEIJkUWVHdqDFxaY1Ply4/) are held on Google Meet every other week on Thursday at 17:00 CET. Meeting events can also be found on [community.cncf.io](https://community.cncf.io/kcp/).
214+
215+
Community members are encouraged to join and add to the discussion via the community meeting notes document (linked above).
216+
217+
## Security Issue Resolution
218+
219+
For a complete list of closed security issues, please refer to [this link](https://github.com/kcp-dev/kcp/security/advisories).
220+
221+
### Responsible Disclosures Process
222+
223+
In case of suspected security issues, incidents, or vulnerabilities, both external and internal to the project, kcp has a responsible disclosure process in place. The process is designed to handle security vulnerabilities quickly and sometimes privately. The primary goal of this process is to reduce the time users are vulnerable to publicly known exploits.
224+
225+
#### Vulnerability Response Process
226+
227+
Maintainers provide a [Security Response Team](https://github.com/kcp-dev/kcp/blob/main/MAINTAINERS.md#security-response-team) that organizes the entire response, including internal communication and external disclosure.
228+
229+
#### Reporting Security Vulnerabilities
230+
231+
Security vulnerability reports are handled via GitHub's security issue reporting feature, available [here](https://github.com/kcp-dev/kcp/security). The Security Response Team triage and respond to security issues reported privately through the tool.
232+
233+
Please see the complete [security release process](https://github.com/kcp-dev/kcp/blob/main/SECURITY.md) for further details.
234+
235+
#### Private Disclosure Processes
236+
237+
If a security vulnerability or any security-related issues are found, they should not be filed as a public or a GitHub issue. Instead, the report should be reported via the security issue reporting feature.
238+
239+
#### Public Disclosure Processes
240+
241+
If a publicly disclosed security vulnerability is known, it should be reported immediately via the security issue reporting feature to inform the Security Response Team. This will initiate the patch, release, and communication process.
242+
243+
### Patch, Release, and Public Communication
244+
245+
For each vulnerability, a member of the Security Response Team will send disclosure messages to the rest of the community. The leading team member is chosen based on availability at the time of a security report.
246+
247+
### Patching/Update Availability
248+
249+
Once the vulnerability has been confirmed and the relevant parties have been notified, the next step is to make a patch or update available. This involves releasing a new version of the software that addresses the vulnerability. The patch or update is then made available to all users, who can update their systems to the latest version to protect against the vulnerability. Communication is sent out via email, Slack and the GitHub security issue disclosure feature.
250+
251+
## Incident Response
252+
253+
There is a template for incident response for reference [here](https://github.com/cncf/tag-security/blob/main/community/resources/project-resources/templates/incident-response.md)
254+
255+
## Appendix
256+
257+
### Known Issues over Time
258+
259+
* [GHSA-c7xh-gjv4-4jgv](https://github.com/kcp-dev/kcp/security/advisories/GHSA-c7xh-gjv4-4jgv): Impersonation allows access to global administrative groups
260+
* [GHSA-w2rr-38wv-8rrp](https://github.com/kcp-dev/kcp/security/advisories/GHSA-w2rr-38wv-8rrp): Unauthorized creation and deletion of objects in arbitrary workspaces through APIExport Virtual Workspace
261+
262+
### OpenSSF Best Practices
263+
264+
The kcp project is continuously improving its practices based on the OpenSSF recommendations, see [Scorecard Results](https://securityscorecards.dev/viewer/?uri=github.com/kcp-dev/kcp) and [Best Practices Badge](https://www.bestpractices.dev/en/projects/8119).

0 commit comments

Comments
 (0)