Skip to content

OLS-3144 harden postgres wait init container - #2015

Open
xrajesh wants to merge 1 commit into
openshift:mainfrom
xrajesh:fix/OLS-3144-postgres-wait-security-context
Open

OLS-3144 harden postgres wait init container#2015
xrajesh wants to merge 1 commit into
openshift:mainfrom
xrajesh:fix/OLS-3144-postgres-wait-security-context

Conversation

@xrajesh

@xrajesh xrajesh commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • use the shared restricted security context for the Postgres wait init container
  • extend tests to verify non-root, seccomp, and dropped capabilities

Testing

  • make test

Summary by CodeRabbit

  • Security
    • The PostgreSQL wait initialization container now uses a restricted security context.
    • It runs as a non-root user, applies the runtime-default seccomp profile, and drops all Linux capabilities.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 31215252-76a8-4f59-b192-ab2f37d3f4c4

📥 Commits

Reviewing files that changed from the base of the PR and between f2c9445 and afb7c79.

📒 Files selected for processing (2)
  • internal/controller/utils/postgres_wait.go
  • internal/controller/utils/postgres_wait_test.go

Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review.


📝 Walkthrough

Walkthrough

The PostgreSQL wait init container now uses RestrictedContainerSecurityContext(). Tests verify non-root execution, the runtime-default seccomp profile, and dropped capabilities.

Changes

PostgreSQL wait container security

Layer / File(s) Summary
Apply and validate restricted security settings
internal/controller/utils/postgres_wait.go, internal/controller/utils/postgres_wait_test.go
The init container uses RestrictedContainerSecurityContext(). Tests verify non-root execution, the runtime-default seccomp profile, and dropped capabilities.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to afb7c

The PostgreSQL wait init container now receives the shared restricted security settings, with tests covering the intended hardening behavior. No current merge-readiness risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: hardening the Postgres wait init container.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@openshift-ci

openshift-ci Bot commented Sep 3, 2026

Copy link
Copy Markdown

@xrajesh: all tests passed!

Full PR test history. Your PR dashboard.

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.

@sriroopar

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Sep 4, 2026
@xrajesh

xrajesh commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

/approve

@openshift-ci

openshift-ci Bot commented Sep 4, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xrajesh

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 4, 2026
@xrajesh

xrajesh commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

/retest

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants