Skip to content

✨ WIP: Add the FIPS field to the RosaControlPlane CR, and add tests.#5873

Open
tinaafitz wants to merge 12 commits intokubernetes-sigs:mainfrom
tinaafitz:add_fips_support
Open

✨ WIP: Add the FIPS field to the RosaControlPlane CR, and add tests.#5873
tinaafitz wants to merge 12 commits intokubernetes-sigs:mainfrom
tinaafitz:add_fips_support

Conversation

@tinaafitz
Copy link
Contributor

@tinaafitz tinaafitz commented Feb 23, 2026

/kind feature

The acceptance criteria states that the FIPS state can only be selected at cluster install time

@k8s-ci-robot
Copy link
Contributor

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

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.

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Feb 23, 2026
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. needs-priority labels Feb 23, 2026
@k8s-ci-robot
Copy link
Contributor

Hi @tinaafitz. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/contains-merge-commits and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Feb 23, 2026
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed do-not-merge/contains-merge-commits labels Feb 23, 2026
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 23, 2026
@tinaafitz
Copy link
Contributor Author

Hi @serngawy, Changes made. Please review.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

Details 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

FIPSEnabled FIPS = "Enabled"

// FIPSDisabled disables FIPS mode (default)
FIPSDisabled FIPS = "Disabled"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
FIPSDisabled FIPS = "Disabled"
Disabled FIPS = "Disabled"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified.

)

// FIPS specifies the FIPS mode for the ROSA Control Plane.
type FIPS string
Copy link
Contributor

Choose a reason for hiding this comment

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

can we generalize this enum, it is similar to autoNode. lets make it as state so in future can be re-used with any boolean kind of fields

Suggested change
type FIPS string
type mode/state string

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added State.

AWSCreator: creator,
AuditLogRoleARN: ptr.To(controlPlaneSpec.AuditLogRoleARN),
ExternalAuthProvidersEnabled: controlPlaneSpec.EnableExternalAuthProviders,
FIPS: controlPlaneSpec.FIPS == "Enabled",
Copy link
Contributor

Choose a reason for hiding this comment

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

compare with the enum type created above

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Modified.

})

// Test case 3: Zero value FIPS (should be false)
t.Run("FIPS Zero Value", func(t *testing.T) {
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 this similar to the above test-case , why duplication ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @serngawy, this test case differs in that the controlPlaneSpec FIPSfield is not provided. The first test sets FIPS to Enabled, the second to Disabled, and the third doesn't set it.

Updated TestBuildOCMClusterSpec test cases to pass nil for roleConfig and
rosaNet parameters to match the current function signature.
@serngawy
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Feb 24, 2026
@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 24, 2026
@tinaafitz
Copy link
Contributor Author

tinaafitz commented Feb 26, 2026

The CAPA code only enables etcd encryption if a KMS ARN is provided:
EtcdEncryption: controlPlaneSpec.EtcdEncryptionKMSARN != ""

OCM requires etcd encryption to be enabled when FIPS is enabled.

The rosa CLI (v1.2.59) requires a KMS ARN for etcd encryption on ROSA HCP clusters.
Testing rosa create cluster --fips --etcd-encryption:

When you use
 --etcd-encryption, it prompts for --etcd-encryption-kms-arn.

From rosa help:

 --etcd-encryption   Add etcd encryption. By default etcd data is encrypted at rest. This option configures 
 etcd encryption on top of existing storage encryption.

The help text says:

 1. --etcd-encryption is a boolean flag that "adds etcd encryption"
 2. --etcd-encryption-kms-arn is OPTIONAL and "if set it will override etcd-encryption flag to true"

I added the validation below to ensure the KMS ARN is set when FIPS is enabled.


 Validation Error:
 {
   "type": "ROSAControlPlaneValid",
   "status": "False",
   "reason": "InvalidConfiguration",
   "severity": "Error",
   "message": "etcdEncryptionKMSARN is required when fips is Enabled. Create a KMS key, tag it with 'red-hat:true', and provide the ARN."
 }

Updated Documentation

Screenshot 2026-02-26 at 2 28 57 PM

@tinaafitz
Copy link
Contributor Author

@serngawy, Please review.

}
}

// Validate FIPS requirements
Copy link
Contributor

Choose a reason for hiding this comment

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

Based on the discussion this is not true, enable ectd-encryption and fips doesn't requires kmsARN

@tinaafitz
Copy link
Contributor Author

/retest

tinaafitz and others added 4 commits February 26, 2026 15:52
Fixed Gomega instance scoping in TestBuildOCMClusterSpec to prevent
"subtest may have called FailNow on a parent test" error.

Moved NewWithT(t) from function level into each subtest so each has
its own Gomega instance bound to the correct *testing.T.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Remove the validation that requires etcdEncryptionKMSARN when FIPS is enabled.

The validation contradicts:
1. Rosa CLI documentation - etcd-encryption-kms-arn is OPTIONAL
2. Developer comment stating "fips doesn't requires kmsARN"
3. Implementation code which already enables etcd encryption when FIPS is enabled

The implementation at line 1198 correctly handles FIPS:
- Enables etcd encryption when FIPS is enabled OR KMS ARN is provided
- Passes KMS ARN to OCM if provided (optional enhancement)

This allows users to enable FIPS with default etcd encryption without
requiring them to create and manage a custom KMS key.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Feb 27, 2026

@tinaafitz: 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
pull-cluster-api-provider-aws-test 754aeff link true /test pull-cluster-api-provider-aws-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

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.

}

// Validate FIPS requirements
if rosaControlPlane.Spec.FIPS == rosacontrolplanev1.Enabled && rosaControlPlane.Spec.EtcdEncryptionKMSARN == "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

please move this check to the webhook validation

Comment on lines +1203 to +1207
RoleARN: installerRoleARN,
SupportRoleARN: supportRoleARN,
WorkerRoleARN: workerRoleARN,
OperatorIAMRoles: operatorRoles,
OidcConfigId: oidcConfigID,
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to change this

}
}

// Determine role ARNs source - either from RoleConfig or manual configuration
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure why you adding this part ?

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/feature Categorizes issue or PR as related to a new feature. needs-priority ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants