Skip to content

(multiple) Randomize osp-secrets.env default passwords - #4114

Open
abays wants to merge 1 commit into
openstack-k8s-operators:mainfrom
abays:random_arch_secrets
Open

(multiple) Randomize osp-secrets.env default passwords#4114
abays wants to merge 1 commit into
openstack-k8s-operators:mainfrom
abays:random_arch_secrets

Conversation

@abays

@abays abays commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

The architecture repo ships osp-secrets.env with hardcoded default passwords that end up in the osp-secret K8s Secret via kustomize secretGenerator. This is a security risk for any environment that deploys using these defaults.

Add a new randomize_secrets.yml task file to the kustomize_deploy role that rewrites values in osp-secrets.env with randomly generated replacements after the architecture repo is cloned but before oc kustomize runs. The task uses a three-tier resolution per key: live cluster secret, local cache, then fresh generation.

Value format handling:

  • Hex-encoded keys (e.g. HeatAuthEncryptionKey): random hex of the same length
  • Skipped keys (e.g. BarbicanSimpleCryptoKEK): preserved as-is
  • Plain passwords (everything else): 20-char alphanumeric string

The task is wired into both cifmw_setup/deploy_architecture.yml and the deprecated 06-deploy-architecture.yml playbook, running right after check_requirements and before reduce_ocp_cluster.

@openshift-ci

openshift-ci Bot commented Aug 17, 2026

Copy link
Copy Markdown
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 tosky 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

@abays

abays commented Aug 17, 2026

Copy link
Copy Markdown
Contributor Author

This complements #4110. They both attack the same problem for different secret keys in different ways, so perhaps we could converge on a preferred approach.

The architecture repo ships `osp-secrets.env` with hardcoded default
passwords that end up in the `osp-secret` K8s Secret via kustomize
`secretGenerator`. This is a security risk for any environment that
deploys using these defaults.

Add a new `randomize_secrets.yml` task file to the `kustomize_deploy`
role that rewrites values in `osp-secrets.env` with randomly generated
replacements after the architecture repo is cloned but before
`oc kustomize` runs. The task uses a three-tier resolution per key:
live cluster secret, local cache, then fresh generation.

Value format handling:
- Hex-encoded keys (e.g. `HeatAuthEncryptionKey`): random hex of
  the same length
- Skipped keys (e.g. `BarbicanSimpleCryptoKEK`): preserved as-is
- Plain passwords (everything else): 20-char alphanumeric string

The task is wired into both `cifmw_setup/deploy_architecture.yml`
and the deprecated `06-deploy-architecture.yml` playbook, running
right after `check_requirements` and before `reduce_ocp_cluster`.

Signed-off-by: Andrew Bays <abays@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@abays
abays force-pushed the random_arch_secrets branch from 72803ce to b947518 Compare August 17, 2026 18:45
@abays abays changed the title [kustomize_deploy] Randomize osp-secrets.env default passwords (multiple) Randomize osp-secrets.env default passwords Aug 17, 2026
@centosinfra-prod-github-app

Copy link
Copy Markdown

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://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/77926fcac6684226a9f204ff9cf18c78

✔️ openstack-k8s-operators-content-provider SUCCESS in 3h 39m 16s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 31m 12s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 49m 23s
✔️ cifmw-crc-podified-edpm-baremetal-minor-update SUCCESS in 2h 26m 48s
✔️ cifmw-pod-zuul-files SUCCESS in 5m 04s
✔️ openstack-k8s-operators-content-provider-bootc SUCCESS in 1h 00m 15s
cifmw-crc-podified-edpm-baremetal-bootc NODE_FAILURE Node(set) request 099-0000172642 failed in 0s
✔️ adoption-standalone-to-crc-ceph-provider SUCCESS in 3h 17m 19s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 08s
✔️ cifmw-pod-pre-commit SUCCESS in 10m 08s
✔️ cifmw-architecture-validate-hci SUCCESS in 5m 25s
✔️ cifmw-molecule-cifmw_setup SUCCESS in 2m 15s
✔️ cifmw-molecule-kustomize_deploy SUCCESS in 7m 08s

@abays

abays commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@centosinfra-prod-github-app

Copy link
Copy Markdown

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://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/06ac05bedaf048c79a59952a3eb26606

✔️ openstack-k8s-operators-content-provider SUCCESS in 6h 23m 08s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 36m 17s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 53m 05s
cifmw-crc-podified-edpm-baremetal-minor-update FAILURE in 2h 45m 46s
✔️ cifmw-pod-zuul-files SUCCESS in 6m 10s
✔️ openstack-k8s-operators-content-provider-bootc SUCCESS in 5h 12m 32s
✔️ cifmw-crc-podified-edpm-baremetal-bootc SUCCESS in 2h 02m 53s
✔️ adoption-standalone-to-crc-ceph-provider SUCCESS in 3h 19m 44s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 10m 16s
✔️ cifmw-pod-pre-commit SUCCESS in 10m 02s
✔️ cifmw-architecture-validate-hci SUCCESS in 11m 24s
✔️ cifmw-molecule-cifmw_setup SUCCESS in 5m 04s
✔️ cifmw-molecule-kustomize_deploy SUCCESS in 13m 23s

@abays

abays commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@centosinfra-prod-github-app

Copy link
Copy Markdown

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://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/347d2688e51842838487e0d45dba0828

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 44m 07s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 34m 35s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 52m 39s
✔️ cifmw-crc-podified-edpm-baremetal-minor-update SUCCESS in 2h 21m 08s
✔️ cifmw-pod-zuul-files SUCCESS in 7m 31s
✔️ openstack-k8s-operators-content-provider-bootc SUCCESS in 50m 04s
cifmw-crc-podified-edpm-baremetal-bootc NODE_FAILURE Node(set) request 099-0000173771 failed in 0s
adoption-standalone-to-crc-ceph-provider NODE_FAILURE Node(set) request 099-0000173710 failed in 0s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 21s
✔️ cifmw-pod-pre-commit SUCCESS in 11m 58s
✔️ cifmw-architecture-validate-hci SUCCESS in 5m 12s
✔️ cifmw-molecule-cifmw_setup SUCCESS in 2m 29s
✔️ cifmw-molecule-kustomize_deploy SUCCESS in 6m 47s

@abays

abays commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@centosinfra-prod-github-app

Copy link
Copy Markdown

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://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/a07050e6dd5c4d91b7e66ad5e0b5ab14

✔️ openstack-k8s-operators-content-provider SUCCESS in 3h 30m 27s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 2h 06m 00s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 57m 14s
cifmw-crc-podified-edpm-baremetal-minor-update FAILURE in 1h 58m 36s
✔️ cifmw-pod-zuul-files SUCCESS in 6m 29s
✔️ openstack-k8s-operators-content-provider-bootc SUCCESS in 2h 20m 59s
✔️ cifmw-crc-podified-edpm-baremetal-bootc SUCCESS in 1h 40m 59s
✔️ adoption-standalone-to-crc-ceph-provider SUCCESS in 3h 15m 22s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 10m 49s
✔️ cifmw-pod-pre-commit SUCCESS in 10m 24s
✔️ cifmw-architecture-validate-hci SUCCESS in 5m 59s
✔️ cifmw-molecule-cifmw_setup SUCCESS in 2m 22s
✔️ cifmw-molecule-kustomize_deploy SUCCESS in 6m 18s

@abays

abays commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@centosinfra-prod-github-app

Copy link
Copy Markdown

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://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/aa708ff3e0d148d99dc71e6ea3b52e04

✔️ openstack-k8s-operators-content-provider SUCCESS in 4h 05m 54s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 43m 56s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 2h 10m 20s
cifmw-crc-podified-edpm-baremetal-minor-update NODE_FAILURE Node(set) request 099-0000174684 failed in 0s
✔️ cifmw-pod-zuul-files SUCCESS in 10m 52s
✔️ openstack-k8s-operators-content-provider-bootc SUCCESS in 49m 47s
cifmw-crc-podified-edpm-baremetal-bootc NODE_FAILURE Node(set) request 099-0000174714 failed in 0s
adoption-standalone-to-crc-ceph-provider POST_FAILURE in 3h 22m 02s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 14m 23s
✔️ cifmw-pod-pre-commit SUCCESS in 14m 36s
✔️ cifmw-architecture-validate-hci SUCCESS in 8m 10s
✔️ cifmw-molecule-cifmw_setup SUCCESS in 2m 59s
✔️ cifmw-molecule-kustomize_deploy SUCCESS in 10m 23s

@abays

abays commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@centosinfra-prod-github-app

Copy link
Copy Markdown

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://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/118576c3ae6a4647bead89180a324d29

✔️ openstack-k8s-operators-content-provider SUCCESS in 3h 42m 38s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 39m 10s
cifmw-crc-podified-edpm-baremetal NODE_FAILURE Node(set) request 099-0000175169 failed in 0s
cifmw-crc-podified-edpm-baremetal-minor-update FAILURE in 2h 34m 31s
✔️ cifmw-pod-zuul-files SUCCESS in 7m 05s
✔️ openstack-k8s-operators-content-provider-bootc SUCCESS in 2h 49m 03s
✔️ cifmw-crc-podified-edpm-baremetal-bootc SUCCESS in 1h 49m 34s
adoption-standalone-to-crc-ceph-provider POST_FAILURE in 3h 21m 33s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 56s
✔️ cifmw-pod-pre-commit SUCCESS in 9m 59s
✔️ cifmw-architecture-validate-hci SUCCESS in 7m 00s
✔️ cifmw-molecule-cifmw_setup SUCCESS in 3m 22s
✔️ cifmw-molecule-kustomize_deploy SUCCESS in 8m 50s

@abays

abays commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@centosinfra-prod-github-app

Copy link
Copy Markdown

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://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/be29db29ab554de48b0820ba403ff338

✔️ openstack-k8s-operators-content-provider SUCCESS in 3h 48m 27s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 36m 55s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 52m 44s
✔️ cifmw-crc-podified-edpm-baremetal-minor-update SUCCESS in 2h 32m 16s
✔️ cifmw-pod-zuul-files SUCCESS in 6m 23s
✔️ openstack-k8s-operators-content-provider-bootc SUCCESS in 2h 22m 51s
✔️ cifmw-crc-podified-edpm-baremetal-bootc SUCCESS in 1h 42m 40s
adoption-standalone-to-crc-ceph-provider POST_FAILURE in 3h 17m 17s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 10m 22s
✔️ cifmw-pod-pre-commit SUCCESS in 10m 06s
✔️ cifmw-architecture-validate-hci SUCCESS in 6m 58s
✔️ cifmw-molecule-cifmw_setup SUCCESS in 2m 40s
✔️ cifmw-molecule-kustomize_deploy SUCCESS in 7m 23s

@abays

abays commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@centosinfra-prod-github-app

Copy link
Copy Markdown

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://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/d0d49efd2c474e66bf6cb01599745101

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 14m 56s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 57m 45s
cifmw-crc-podified-edpm-baremetal NODE_FAILURE Node(set) request 099-0000175957 failed in 0s
cifmw-crc-podified-edpm-baremetal-minor-update NODE_FAILURE Node(set) request 099-0000175958 failed in 0s
✔️ cifmw-pod-zuul-files SUCCESS in 6m 17s
openstack-k8s-operators-content-provider-bootc TIMED_OUT in 46m 42s
⚠️ cifmw-crc-podified-edpm-baremetal-bootc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider-bootc
adoption-standalone-to-crc-ceph-provider NODE_FAILURE Node(set) request 099-0000175959 failed in 0s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 59s
✔️ cifmw-pod-pre-commit SUCCESS in 9m 01s
✔️ cifmw-architecture-validate-hci SUCCESS in 5m 20s
✔️ cifmw-molecule-cifmw_setup SUCCESS in 2m 42s
✔️ cifmw-molecule-kustomize_deploy SUCCESS in 7m 16s

@abays

abays commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@centosinfra-prod-github-app

Copy link
Copy Markdown

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://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/8a09753e5ce24945854cce5d5b52ed6b

✔️ openstack-k8s-operators-content-provider SUCCESS in 3h 44m 29s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 41m 19s
cifmw-crc-podified-edpm-baremetal FAILURE in 53m 15s
✔️ cifmw-crc-podified-edpm-baremetal-minor-update SUCCESS in 2h 29m 55s
✔️ cifmw-pod-zuul-files SUCCESS in 4m 44s
✔️ openstack-k8s-operators-content-provider-bootc SUCCESS in 2h 35m 29s
✔️ cifmw-crc-podified-edpm-baremetal-bootc SUCCESS in 1h 47m 39s
adoption-standalone-to-crc-ceph-provider POST_FAILURE in 3h 22m 54s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 45s
✔️ cifmw-pod-pre-commit SUCCESS in 9m 19s
✔️ cifmw-architecture-validate-hci SUCCESS in 6m 38s
✔️ cifmw-molecule-cifmw_setup SUCCESS in 3m 17s
✔️ cifmw-molecule-kustomize_deploy SUCCESS in 6m 13s

@abays

abays commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

recheck

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.

1 participant