kubesphere / kubesphere/ks-devops

security bug: bad auth in ks-devop apiserver.

Open
#596 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug
Dominant language
Go
Stars
164
Forks
140
PR merge metrics
No merged PRs in 30d

Description

What is version of KubeSphere DevOps has the issue?

3.2.1

How did you install the Kubernetes? Or what is the Kubernetes distribution?

kk create cluster --with-kubernetes v1.21.5 --with-kubesphere v3.2.1

What happened?
  • in "devops-apiserver", there has been "identity authentication",but no "authority division"
  • in "devops-apiserver", all api can be access using "anonymous" user
  • in "kubesphere cluster", there is no NetworkPolicy.

so, by default, any pod in "kubesphere cluster" can access all api in "devops-apiserver".

root@ip-172-31-14-33:~# curl 10.233.30.131:9090/v1alpha2/devops/go-sec-code4bgns/pipelines/build
{
 "_class": "io.jenkins.blueocean.rest.impl.pipeline.PipelineImpl",
 "_links": {
  "self": {
   "_class": "io.jenkins.blueocean.rest.hal.Link",
   "href": "/blue/rest/organizations/jenkins/pipelines/go-sec-code4bgns/pipelines/build/"
  },
  "scm": {
   "_class": "io.jenkins.blueocean.rest.hal.Link",
   "href": "/blue/rest/organizations/jenkins/pipelines/go-sec-code4bgns/pipelines/build/scm/"
  },
...

what i expect to happen is: by default, person can only do operate(include create、update、delete、read) to their projects and pipeline information.

Relevant log output

No response

Additional information

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the devops-apiserver entry points serving /v1alpha2/devops and reproduce the anonymous curl request shown in the issue. Trace how identity authentication and project or pipeline authorization are applied, then verify that users cannot read or modify other projects and pipelines.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
api, authorization, devops, security
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.