cloudfoundry / cloudfoundry/cloud_controller_ng

Deprecate "staging_upload_user" and "staging_upload_password"

Open
#3,119 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

unscheduled
Dominant language
Ruby
Stars
207
Forks
373
Avg merge
2d 12h
Merged PRs (30d)
56

Description

Issue

Deprecate the staging.auth.user and staging.auth.password credentials. They are used to protect some internal endpoints, but those have been secured with mTLS in the meantime.

Background: We need to ensure that all passwords are rotated regularly. We've enabled a password rotation and detected no downtimes for cf push or any other operation. If the credentials are not really used anymore, it would of course be better to remove them entirely.

https://github.com/cloudfoundry/cloud_controller_ng/blob/dbeb9dbdeed152cbaf88d4bac29299fa9c26ce9d/config/cloud_controller.yml#L151

Context

The staging_upload_user/staging_upload_password are used to protect the following endpoints with basic authentication:

  1. GET /staging/packages/:guid
    https://github.com/cloudfoundry/cloud_controller_ng/tree/main/docs/internal#get-stagingpackagesguid

  2. GET /staging/v3/droplets/:guid/download
    https://github.com/cloudfoundry/cloud_controller_ng/tree/main/docs/internal#get-stagingv3dropletsguiddownload

  3. GET /staging/v3/buildpack_cache/:stack/:app_guid/download
    https://github.com/cloudfoundry/cloud_controller_ng/tree/main/docs/internal#get-stagingv3buildpack_cachestackapp_guiddownload

The three endpoints above are only used for the "NFS server mounted on the CC" scenario. Is this still a supported setup?

  1. GET /staging/jobs/:guid
    https://github.com/cloudfoundry/cloud_controller_ng/blob/ec8558268aa59131580a050f8870b8a5f5f69c57/app/presenters/api/staging_job_presenter.rb

Looks like dead code as the http scheme is not used anymore.

  1. GET /v2/buildpacks/:guid/download
    https://github.com/cloudfoundry/cloud_controller_ng/tree/main/docs/internal#get-v2buildpacksguiddownload
    https://github.com/cloudfoundry/cloud_controller_ng/blob/ec8558268aa59131580a050f8870b8a5f5f69c57/app/controllers/runtime/buildpack_bits_controller.rb#L10

Not in use anymore as Diego downloads directly from blobstore?

  1. blobstore_url_generator
    https://github.com/cloudfoundry/cloud_controller_ng/blob/ec8558268aa59131580a050f8870b8a5f5f69c57/lib/cloud_controller/dependency_locator.rb#L190

This function is used in different places:

https://github.com/cloudfoundry/cloud_controller_ng/blob/ec8558268aa59131580a050f8870b8a5f5f69c57/app/controllers/runtime/stagings_controller.rb
-> no use of blobstore_url_generator

https://github.com/cloudfoundry/cloud_controller_ng/blob/ec8558268aa59131580a050f8870b8a5f5f69c57/app/controllers/internal/download_droplets_controller.rb#L17
For internal endpoint GET /internal/v4/droplets/:guid/:droplet_checksum/download:
https://github.com/cloudfoundry/cloud_controller_ng/tree/main/docs/internal#get-internalv4dropletsguiddroplet_checksumdownload
-> in use, but without basich auth?

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 config/cloud_controller.yml at the staging credentials and trace their uses through the listed staging, buildpack, droplet, and blobstore endpoints, including lib/cloud_controller/dependency_locator.rb and the referenced controllers and presenter. Confirm whether the NFS-mounted CC setup and each endpoint remain supported, then define the deprecation or removal scope and update the affected documentation and behavior accordingly.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api, backend, security
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.