Skip to content

Harden Redis, InstanceHA, Memcached, DNSMasq, and RabbitMQ workload security - #630

Open
lmiccini wants to merge 3 commits into
openstack-k8s-operators:mainfrom
lmiccini:security-hardening-33203-33205
Open

Harden Redis, InstanceHA, Memcached, DNSMasq, and RabbitMQ workload security#630
lmiccini wants to merge 3 commits into
openstack-k8s-operators:mainfrom
lmiccini:security-hardening-33203-33205

Conversation

@lmiccini

@lmiccini lmiccini commented Jul 22, 2026

Copy link
Copy Markdown
Contributor
Address anyuid SCC and overly permissive RBAC findings across all infra-operator workloads.

Redis:
- Remove sudo -E kolla_set_configs from startup scripts — eliminates
  the only blocker for nonroot-v2. Config files are now read directly
  from the generated path (/var/lib/config-data/generated/), and TLS
  certs reference the volume-mounted paths instead of /etc/pki/tls/.
- Change SCC from anyuid to nonroot-v2
- Remove kolla-config volumes and mounts (config.json files deleted)
- Reduce workload SA pod verbs from full CRUD to get/list/watch/patch
- Add full SecurityContext via pod.RestrictiveSecurityContext helper
- Set AutomountServiceAccountToken: false with projected SA token volume

InstanceHA:
- Change SCC from anyuid to nonroot-v2
- Add SeccompProfile RuntimeDefault
- Set AutomountServiceAccountToken: false with projected SA token volume
- Use lib-common pod.RestrictiveSecurityContext helper

Memcached:
- Change SCC from anyuid to nonroot-v2
- Remove full pod CRUD from workload SA (no SA token usage)
- Set AutomountServiceAccountToken: false
- Add full SecurityContext via pod.RestrictiveSecurityContext helper

DNSMasq:
- Change SCC from anyuid to nonroot-v2
- Remove full pod CRUD from workload SA (no SA token usage)
- Set AutomountServiceAccountToken: false
- Add DnsmasqUID constant (42435, neutron UID from kolla)
- Add full SecurityContext via pod.RestrictiveSecurityContext helper

RabbitMQ:
- Change SCC from anyuid to nonroot-v2 (bypasses kolla entrypoint,
  runs rabbitmq-server directly as UID 999, no sudo needed)
- Set AutomountServiceAccountToken: false with projected SA token volume
- Add full SecurityContext via pod.RestrictiveSecurityContext on both
  rabbitmq and amqp-proxy containers
- Keep FSGroup=0 to avoid chown overhead on existing PVCs

Depends-On: openstack-k8s-operators/ci-framework#4075

@openshift-ci
openshift-ci Bot requested review from dciabrin and dprince July 22, 2026 13:14
@openshift-ci

openshift-ci Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lmiccini

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

The pull request process is described 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

@lmiccini
lmiccini force-pushed the security-hardening-33203-33205 branch from e0c8b06 to 7cab0e7 Compare July 23, 2026 14:06
@lmiccini lmiccini changed the title Harden Redis and InstanceHA workload security Address anyuid SCC and overly permissive RBAC findings across all infra-operator workloads except RabbitMQ Jul 23, 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/1321581e65ee4c6fa38dba3a031c8b5d

openstack-k8s-operators-content-provider FAILURE in 11m 20s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

@lmiccini
lmiccini force-pushed the security-hardening-33203-33205 branch 2 times, most recently from 08cf4e2 to 7944f4e Compare July 23, 2026 14:33
@centosinfra-prod-github-app

Copy link
Copy Markdown

This change depends on a change that failed to merge.

Change openstack-k8s-operators/lib-common#720 is needed.

@lmiccini
lmiccini force-pushed the security-hardening-33203-33205 branch from 7944f4e to 9a05b05 Compare July 23, 2026 14:45
@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/ee0ba61e9f064d929c17aa8e340646a9

openstack-k8s-operators-content-provider FAILURE in 12m 11s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

@lmiccini
lmiccini force-pushed the security-hardening-33203-33205 branch from 9a05b05 to 9c3f94c Compare July 23, 2026 15:06
@lmiccini lmiccini changed the title Address anyuid SCC and overly permissive RBAC findings across all infra-operator workloads except RabbitMQ Harden Redis, InstanceHA, Memcached, DNSMasq, and RabbitMQ workload security Jul 23, 2026
@lmiccini
lmiccini force-pushed the security-hardening-33203-33205 branch 6 times, most recently from ba2781e to d10ee2c Compare July 23, 2026 16:09
@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/335294d717d04c07b6a1389a249327ba

openstack-k8s-operators-content-provider FAILURE in 12m 45s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

@lmiccini
lmiccini force-pushed the security-hardening-33203-33205 branch from d10ee2c to 3cc71d0 Compare July 23, 2026 16:27
@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/2797ccd2034444cd9873b54dbb1f6f9f

openstack-k8s-operators-content-provider FAILURE in 11m 15s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

@lmiccini
lmiccini force-pushed the security-hardening-33203-33205 branch from 3cc71d0 to 14636f1 Compare July 23, 2026 16:53
@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/78a57b9ac77f49a08e3350c8868a031b

openstack-k8s-operators-content-provider FAILURE in 10m 41s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

@lmiccini
lmiccini force-pushed the security-hardening-33203-33205 branch from 14636f1 to 87f993c Compare July 23, 2026 17:09
@lmiccini

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/250d5a880d664eca82769882f70a2051

openstack-k8s-operators-content-provider FAILURE in 11m 22s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

@lmiccini

Copy link
Copy Markdown
Contributor Author

recheck

@lmiccini
lmiccini force-pushed the security-hardening-33203-33205 branch from 87f993c to f8e17f6 Compare July 23, 2026 18:12
@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/733ac007ce284115923a9319ba57bede

openstack-k8s-operators-content-provider FAILURE in 10m 42s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

@lmiccini

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/1de6f871aa0e410b862216aee362bb4a

openstack-k8s-operators-content-provider FAILURE in 10m 52s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

@lmiccini

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/a4dd34b09f7044d682252e9ad5bfc933

openstack-k8s-operators-content-provider FAILURE in 6m 36s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

@lmiccini

Copy link
Copy Markdown
Contributor Author

recheck

…ecurity

Address anyuid SCC and overly permissive RBAC findings
across all infra-operator workloads.

Redis:
- Remove sudo -E kolla_set_configs from startup scripts — eliminates
  the only blocker for nonroot-v2. Config files are now read directly
  from the generated path (/var/lib/config-data/generated/), and TLS
  certs reference the volume-mounted paths instead of /etc/pki/tls/.
- Change SCC from anyuid to nonroot-v2
- Remove kolla-config volumes and mounts (config.json files deleted)
- Reduce workload SA pod verbs from full CRUD to get/list/watch/patch
- Add full SecurityContext via pod.RestrictiveSecurityContext helper
- Set AutomountServiceAccountToken: false with projected SA token volume

InstanceHA:
- Change SCC from anyuid to nonroot-v2
- Add SeccompProfile RuntimeDefault
- Set AutomountServiceAccountToken: false with projected SA token volume
- Use lib-common pod.RestrictiveSecurityContext helper

Memcached:
- Bypass kolla_start entrypoint — run memcached directly by sourcing
  /etc/sysconfig/memcached (volume-mounted) instead of going through
  kolla_set_configs which requires sudo. Delete kolla config.json and
  remove kolla-config volume/mount.
- Change SCC from anyuid to nonroot-v2
- Remove full pod CRUD from workload SA (no SA token usage)
- Set AutomountServiceAccountToken: false
- Add full SecurityContext via pod.RestrictiveSecurityContext helper

DNSMasq:
- Change SCC from anyuid to nonroot-v2
- Remove full pod CRUD from workload SA (no SA token usage)
- Set AutomountServiceAccountToken: false
- Add DnsmasqUID constant (42435, neutron UID from kolla)
- Add full SecurityContext via pod.RestrictiveSecurityContext helper

RabbitMQ:
- Change SCC from anyuid to nonroot-v2 (bypasses kolla entrypoint,
  runs rabbitmq-server directly as UID 999, no sudo needed)
- Set AutomountServiceAccountToken: false with projected SA token volume
- Add full SecurityContext via pod.RestrictiveSecurityContext on both
  rabbitmq and amqp-proxy containers
- Change FSGroup from 0 to 999 with FSGroupChangePolicy OnRootMismatch
  for transparent one-time PVC chown on upgrade

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lmiccini
lmiccini force-pushed the security-hardening-33203-33205 branch from f8e17f6 to 59d2055 Compare July 24, 2026 05:28
@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/e4151d6f0fe94bc6af5a439d40e1bf46

openstack-k8s-operators-content-provider FAILURE in 7m 33s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

The pods/exec create permission was vestigial — no exec code exists
in the codebase (no remotecommand, SPDY, or exec helper calls).
The pods create permission was also unused — pods are managed by
StatefulSet, not created directly by the controller.

Retain pods get/list/watch/update/delete (needed for labeling pods
with skipPreStopChecks during CR deletion and deleting pods with
short grace period) and pods update/patch (needed by BGP controller
for pod label management).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@lmiccini
lmiccini force-pushed the security-hardening-33203-33205 branch from f76939d to 585c936 Compare July 24, 2026 11:14
@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/9d9c14c45d8e4513b91708d3dbfa2b8c

openstack-k8s-operators-content-provider FAILURE in 7m 19s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

@lmiccini

Copy link
Copy Markdown
Contributor Author

recheck

@lmiccini

Copy link
Copy Markdown
Contributor Author

/test infra-operator-build-deploy-kuttl

The redis container's liveness/readiness probes were defined inline with
Exec handlers but no timeout settings, falling back to Kubernetes
defaults (TimeoutSeconds=1, InitialDelaySeconds=0). The probe variables
defined earlier (with 5s timeout and initialDelay) were unused because
the container spec created new Probe objects that discarded them.

This caused kuttl CI failures under the nonroot-v2 security context
where the probe script (sourcing common.sh, reading SA token, calling
redis-cli) could not complete within the 1s default timeout.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@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/3aab760eed0b44578dbc7067060a83c0

openstack-k8s-operators-content-provider FAILURE in 8m 00s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

@lmiccini

Copy link
Copy Markdown
Contributor Author

/test functional

@lmiccini

Copy link
Copy Markdown
Contributor Author

recheck

@lmiccini

Copy link
Copy Markdown
Contributor Author

/test functional

@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/2f0c3419064c4ad6aaa9a1fe3d52fc6b

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 57m 15s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 37m 31s
cifmw-crc-podified-edpm-baremetal FAILURE in 1h 13m 00s

@lmiccini

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/4a6d287e1c614261a6795d446afe9c28

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 01m 25s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 37m 37s
cifmw-crc-podified-edpm-baremetal NODE_FAILURE Node(set) request 099-0000152318 failed in 0s

@lmiccini

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant