Skip to content

[RFC] Service Credential Binding Rotation for Apps #1198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

beyhan
Copy link
Member

@beyhan beyhan commented Jun 10, 2025

@beyhan beyhan added toc rfc CFF community RFC labels Jun 10, 2025
@beyhan beyhan requested review from a team, rkoster, stephanme, ameowlia and ChrisMcGowan and removed request for a team June 10, 2025 11:00
Copy link

@sklevenz sklevenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@philippthun
Copy link
Member

Some thoughts on binding names:

  • In theory multiple bindings to the same service instance (per app) with different names would be possible for the service-binding-k8s file-based service bindings flavor, as the binding name is used as key (i.e. folder name).
  • For VCAP_SERVICES, the service label is used as key, so multiple bindings to the same service instance (per app) cannot be represented in the JSON structure.
  • As of today, the only use-case for multiple bindings to the same service instance (per app) is credential rotation, thus I would say that these bindings MUST have the same name. Allowing different names (and using the newest one) would be somewhat confusing.

@ameowlia ameowlia moved this from Inbox to In Progress in CF Community Jun 17, 2025
- CC just allows multiple bindings per app/service
- require that binding names don't change on cred rotation
- removed --recreate from cf bind-service
- added option to keep last x bindings on cleanup
@stephanme
Copy link
Member

Reworked the RFC to address most of the discussion points:

  • no more extra CF API recreate endpoint for rotation
  • CC just allows multiple bindings per app/service
  • require that binding names don't change on cred rotation
  • removed --recreate from cf bind-service
  • added option to keep last x bindings on cleanup

Please review again.

@beyhan beyhan requested review from cweibel and removed request for ChrisMcGowan July 15, 2025 05:58
- add reasoning for the conditions of multiple bindings
- allow multiple bindings to UPSI (even though there is no benefit but less constaints on API)
- add reasoning for limiting the number of multiple bindings
- cf cleanup-outdated-service-bindings: use flags for optional params
@Gerg Gerg self-requested a review July 15, 2025 14:14
A full service binding rotation flow with the CF CLI could look like:
```
cf bind-service myApp myService -c {<parameters>}
cf bind-service myApp myService2 -c {<parameters>}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be the same binding?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sample shows how you could rotate the bindings of an app which is bound to two different services. Does this answer the question?

- multiple bindings to the same service instance are intended for credential rotation
- VCAP_SERVICES structure doesn't allow multiple bindings to the same service instance so different binding names don't make sense

The number of multiple service credential bindings for the same app and service instance should be limited. The limit prevents a DoS threat and eventually reminds users to clean up old, likely outdated bindings.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you expand a bit more on the DoS thread and how a limit would mitigate these risks? Are we expecting the creation of a binding to be really expansive? Also do we allow to create multiple bindings at the same time? If not there already will a natural delay. If you are thinking about database pollution that might be a valid concern, but this would be the first time we implement an arbitrary limit on a particular resource.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far, the bindings are implicitly limited by app and service quotas (assuming they are not unlimited which they should not be in productive public foundations). With multiple service bindings per app/service instance, we give up on this implicit limit. That's why an additional limit. Adding a real (org and space) quota for bindings is probably an overkill -> so the idea is to add a foundation wide limit (configurable via bosh).

Service bindings are expensive resources. Creation is not just an API call and a DB record but also a background job that talks to the broker (and this communication can even be asynchronous).

There are limits (in addition to the CF quotas) already today:

We should not have any resources that can be created infinitely via the CF API as they open the door for misuse. Creation rate is limited by CF API rate limits but they are rather high and it won't be too hard to attack with multiple users...


### CC adoption of OSBAPI 2.17

The CC could use the service binding rotation functionality introduced with the OSBAPI 2.17 and introduce a dedicated API endpoint for rotation, e.g. `POST /v3/service_credential_bindings/:guid/actions/duplicate` (good naming to be found).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this naming be defined as part of this RFC?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the need to define the naming for this in this RFC because it is future work which could happen or not.

@beyhan
Copy link
Member Author

beyhan commented Jul 15, 2025

During the TOC meeting on July 15th we decided to start the FCP for this RFC with the goal to accept it. Please have a final review on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rfc CFF community RFC toc
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

7 participants