Skip to content

Conversation

@mauricioharley
Copy link

@mauricioharley mauricioharley commented Aug 20, 2025

This PR implements Application Credentials authentication support for Nova services as an alternative to service user authentication, providing enhanced security and simplified credential management.

What has changed:

  • Added ApplicationCredential fields to all Nova service specs
  • Implemented automatic AC detection with fallback logic
  • Added utility package for AC operations
  • Enhanced RBAC with AC permissions
  • Added event watches for AC resources
  • Comprehensive functional and KUTTL test coverage

How to Test:

  1. Deploy Nova operator with AC secret: oc apply -f examples/ac-secret.yaml
  2. Create ApplicationCredential CR: oc apply -f examples/ac-cr.yaml
  3. Deploy Nova CR and verify AC authentication is used
  4. Run test suite: oc kuttl test test/kuttl/test-suites/default/application-credentials-tests/

Backward Compatibility:
Fully backward compatible - existing deployments continue to use service user authentication

Closes: OSPRH-16626

This commit implements Application Credentials (AC) authentication as an
alternative to service user authentication for Nova services, providing
enhanced security and simplified credential management.

Changes include:

* **API Types**: Add ApplicationCredential fields to NovaAPISpec,
  NovaSchedulerSpec, NovaMetadataSpec, and NovaCellSpec to support
  AC configuration propagation

* **Controller Logic**: Implement AC detection with graceful fallback
  to service user authentication when AC is unavailable. Add AC hash
  tracking in Nova status for change detection and reconciliation

* **Utility Package**: Add pkg/util/appcred with helper functions for
  AC secret loading, validation, hashing, and logging

* **RBAC**: Add permissions for ApplicationCredential resources to
  enable AC CR and Secret watching

* **Event Handling**: Add watches for ac-nova ApplicationCredential CR
  and ac-nova-secret Secret with proper event mapping to trigger
  Nova reconciliation on AC changes

* **Dependencies**: Update go.mod to include keystone-operator API
  with ApplicationCredential CRD support

* **Testing**: Add comprehensive functional and KUTTL test suites
  covering AC usage, fallback scenarios, and credential updates

The implementation maintains backward compatibility by requiring only
the metadata secret when using Application Credentials, while falling
back to requiring the service password when AC is not available.

ApplicationCredential authentication is automatically detected by the
presence of the 'ac-nova-secret' Secret containing AC_ID and AC_SECRET
keys, eliminating the need for manual configuration changes.

Implements: https://issues.redhat.com/browse/OSPRH-16626

Signed-off-by: Mauricio Harley <[email protected]>
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 20, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mauricioharley
Once this PR has been reviewed and has the lgtm label, please assign kk7ds for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 20, 2025

@mauricioharley: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/functional 29aa89c link true /test functional

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/ce9340d9de40461f9e3d71fc04df1881

openstack-meta-content-provider FAILURE in 14m 41s
⚠️ nova-operator-kuttl SKIPPED Skipped due to failed job openstack-meta-content-provider
⚠️ nova-operator-tempest-multinode SKIPPED Skipped due to failed job openstack-meta-content-provider
⚠️ nova-operator-tempest-multinode-ceph SKIPPED Skipped due to failed job openstack-meta-content-provider

@SeanMooney
Copy link
Contributor

SeanMooney commented Aug 20, 2025

nite: Implements: https://issues.redhat.com/browse/OSPRH-16626 shoudl be

Closes: OSPRH-16626

if you want the bot to properly do the linkage its import to not use the full url you need to use jsut the short slug.

the both will turn that into a link but it wont match proeprly on the full url

@SeanMooney
Copy link
Contributor

by the way im gladd this propoal is findally movign forward.

i proposed doing this before we gaed https://issues.redhat.com/browse/OSPRH-335 but there was not enough capstiy to do that at the teime

// +listType=set
IPs []string `json:"ips,omitempty"`
}

Copy link
Contributor

Choose a reason for hiding this comment

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

these CRD change do not look related and shoudl not be done as part of this PR if we need to make the CRD change to use this new type that shoudl be its won PR that is doen before or aftere the applciation credential pr

allowedKeys,
)
}

Copy link
Contributor

Choose a reason for hiding this comment

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

again non of this is correct to includ in this PR plwase serperate all cred validation chagne to a sepreate pr, not just a sperate commit and this shoudl have its own jira tracker.

also we need to ensure that this change is semanticly equilvent and that exsitign CR will still be compatibale that means to make this chagne we shoudl be able to do it without any kuttl or tempest/edpm job changes

althought eh envtests may need to be modifed.

NodeSelector *map[string]string `json:"nodeSelector,omitempty"`
// +listType=map
// +listMapKey=key
NodeSelector []KeyValuePair `json:"nodeSelector,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

im going to stop commeitng on the ohter crd change but assume the same applies.

// +kubebuilder:validation:Enum="true";"false"
// +kubebuilder:default="false"
// UseApplicationCredential - indicates if ApplicationCredential authentication is used
UseApplicationCredential string `json:"useApplicationCredential"`
Copy link
Contributor

Choose a reason for hiding this comment

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

this is inapprotiate.

by design we are not allowed to have boolean feature flag in the CRDs

usage of application credentials shoudl either by unconditional or determined by the presence of the application Credtial secreat in the CR.


// +kubebuilder:validation:Optional
// ApplicationCredentialID - the ID of the ApplicationCredential
ApplicationCredentialID string `json:"applicationCredentialID"`
Copy link
Contributor

Choose a reason for hiding this comment

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

this i guess will funciton similar to the passworkd selector however this also feels like a desgin flaw.

really we shoudl nto have multiple applciation credtial in the ApplicationCredentialSecret

so this information should be encoded in that object

@@ -0,0 +1,52 @@
package appcred
Copy link
Contributor

Choose a reason for hiding this comment

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

i dont think this si really corerct. we shoudl take the time to put these helper fucntion into lib-common so that they are nto cargo culted around all the service operators..

Copy link
Author

Choose a reason for hiding this comment

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

Hello, @SeanMooney. Thank you for all the comments. This was just the very first release of the feature. I know there's room for more improvement.

Anyway, I'd like to ask you: regarding the package appcred part and the corresponding appcred.go, should we move the code to lib-common and remove it from here?

Copy link
Contributor

Choose a reason for hiding this comment

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

i think that would be good to move to lib-common if its reusabel yes isntead of doing it here

@mauricioharley
Copy link
Author

by the way im gladd this propoal is findally movign forward.

i proposed doing this before we gaed https://issues.redhat.com/browse/OSPRH-335 but there was not enough capstiy to do that at the teime

Thank you. Yes, the actual support is being implemented for both, Keystone and OpenStack operators, on specific PRs.

@openshift-merge-robot
Copy link
Collaborator

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants