tektoncd / results

Long term storage of execution results.
Apache License 2.0
77 stars 73 forks source link

Database SSL Mode `verify-ca` or `verify-full` with a custom CA certificate #531

Closed iainsproat closed 10 months ago

iainsproat commented 1 year ago

Expected Behavior

Given a custom root CA certificate for a postgres database server, I would like postgres to use verify-ca or verify-full SSL modes using the custom CA certificate.

Is there a mechanism for achieving this that maybe I have missed?

Actual Behavior

With the existing kubernetes manifests, there does not seem to be a mechanism for mounting a trusted certificate either in postgres default location or by specifying a custom location to postgres.

Steps to Reproduce the Problem

  1. Configure Results with either DB_SSLMODE=verify-ca or DB_SSLMODE=verify-full.
  2. Provide a trusted certificate to Results to be used by postgres.
  3. Results API should undertake SSL verification using the trusted certificate when connecting, but does not.

Additional Info

xinnjie commented 1 year ago

There is no mechanism for achieving this currently IMO.

This should be a feature request.

adambkaplan commented 1 year ago

/kind feature

Agree this would be a net new feature, as Results would need to do the following:

  1. Provide a means for the database certificate authority (CA) to be (optionally) mounted at a known path in the apiserver deployment.
  2. Ensure that the path to the database CA is passed into the Postgres connection string, via the sslrootcert parameter.

See PostgreSQL SSL docs for further technical information.

tekton-robot commented 11 months ago

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale with a justification. Stale issues rot after an additional 30d of inactivity and eventually close. If this issue is safe to close now please do so with /close with a justification. If this issue should be exempted, mark the issue as frozen with /lifecycle frozen with a justification.

/lifecycle stale

Send feedback to tektoncd/plumbing.

adambkaplan commented 11 months ago

/lifecycle frozen

This is an important security feature.

enarha commented 11 months ago

/assign enarha

enarha commented 10 months ago

@iainsproat, when you have a chance please TAL at #658. It implements the feature you asked for. Thanks.