There are numerous ways to connect to a PostgreSQL database. This step demonstrates how to connect by creating an ephemeral Kubernetes pod.
Connect to the database as superuser (postgres) by creating an ephemeral container inside the Kubernetes cluster. A shell prompt will not be displayed after executing the oc run command outlined below. Wait 5 seconds, and then proceed by entering a password.
CREATEROLE immuta withloginencryptedpassword'<postgres-password>';GRANT immuta TO CURRENT_USER;CREATEDATABASEimmutaOWNER immuta;GRANT all ONDATABASE immuta TO immuta;ALTERROLE immuta SET search_path TO bometadata,public;
Revoke privileges from CURRENT_USER as they're no longer required.
REVOKE immuta FROM CURRENT_USER;
Enable the pgcrypto extension.
\c immutaCREATE EXTENSION pgcrypto;
Type \q, and then press Enter to exit.
Install Immuta
This section demonstrates how to deploy Immuta using the Immuta Enterprise Helm chart once the prerequisite cloud-managed services are configured.
Create a Helm values file named immuta-values.yaml with the content below. Because the Ingress resource will be managed by an OpenShift route you will create when configuring Ingress and not the Immuta Enterprise Helm chart, ingress is set to false below. TLS comes pre-configured with OpenShift, so tls is also set to false.
global:imageRegistry:ocir.immuta.comimagePullSecrets: - name:immuta-oci-registryimageRepositoryMap:immuta/immuta-service:stable/immuta-serviceimmuta/immuta-db:stable/immuta-dbimmuta/immuta-fingerprint:stable/immuta-fingerprintimmuta/audit-service:stable/audit-serviceimmuta/audit-export-cronjob:stable/audit-export-cronjobimmuta/classify-service:stable/classify-serviceimmuta/cache:stable/cacheaudit:config: databaseConnectionString: postgres://immuta:<postgres-password>@pg-db-postgresql.immuta.svc.cluster.local:5432/immuta?schema=audit
elasticsearchEndpoint:http://es-db-elasticsearch.immuta.svc.cluster.local:9200elasticsearchUsername:<elasticsearch-username>elasticsearchPassword:<elasticsearch-password>deployment:podSecurityContext:# A number that is within the project range: # oc get project <project-name> --output template='{{index .metadata.annotations "openshift.io/sa.scc.uid-range"}}{{"\n"}}'
runAsUser:<user-id># A number that is within the project range: # oc get project <project-name> --output template='{{index .metadata.annotations "openshift.io/sa.scc.supplemental-groups"}}{{"\n"}}'
runAsGroup:<group-id>seccompProfile:type:RuntimeDefaultcontainerSecurityContext:allowPrivilegeEscalation:falsecapabilities:drop: - ALLdiscover:deployment:podSecurityContext:# A number that is within the project range: # oc get project <project-name> --output template='{{index .metadata.annotations "openshift.io/sa.scc.uid-range"}}{{"\n"}}'
runAsUser:<user-id># A number that is within the project range: # oc get project <project-name> --output template='{{index .metadata.annotations "openshift.io/sa.scc.supplemental-groups"}}{{"\n"}}'
runAsGroup:<group-id>seccompProfile:type:RuntimeDefaultcontainerSecurityContext:allowPrivilegeEscalation:falsecapabilities:drop: - ALLsecure:extraEnvVars: - name:FeatureFlag_AuditServicevalue:"true" - name:FeatureFlag_detectvalue:"true" - name:FeatureFlag_auditLegacyViewHidevalue:"true"ingress:enabled:falsetls:falsepostgresql:host:<postgres-fqdn>port:5432database:immutausername:immutapassword:<postgres-password>ssl:falseweb:podSecurityContext:# A number that is within the project range: # oc get project <project-name> --output template='{{index .metadata.annotations "openshift.io/sa.scc.uid-range"}}{{"\n"}}'
runAsUser:<user-id># A number that is within the project range: # oc get project <project-name> --output template='{{index .metadata.annotations "openshift.io/sa.scc.supplemental-groups"}}{{"\n"}}'
runAsGroup:<group-id>seccompProfile:type:RuntimeDefaultcontainerSecurityContext:allowPrivilegeEscalation:falsecapabilities:drop: - ALLbackgroundWorker:podSecurityContext:# A number that is within the project range: # oc get project <project-name> --output template='{{index .metadata.annotations "openshift.io/sa.scc.uid-range"}}{{"\n"}}'
runAsUser:<user-id># A number that is within the project range: # oc get project <project-name> --output template='{{index .metadata.annotations "openshift.io/sa.scc.supplemental-groups"}}{{"\n"}}'
runAsGroup:<group-id>seccompProfile:type:RuntimeDefaultcontainerSecurityContext:allowPrivilegeEscalation:falsecapabilities:drop: - ALL