-
Notifications
You must be signed in to change notification settings - Fork 22
fix: replace bitnami commercial images with free official images #2477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: mysql-secret | ||
| namespace: gluu | ||
| type: Opaque | ||
| stringData: | ||
| root-password: Test1234# | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: mysql | ||
| namespace: gluu | ||
| spec: | ||
| ports: | ||
| - port: 3306 | ||
| selector: | ||
| app: mysql | ||
| clusterIP: None | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: mysql | ||
| namespace: gluu | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| app: mysql | ||
| strategy: | ||
| type: Recreate | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: mysql | ||
| spec: | ||
| containers: | ||
| - image: mysql:8.0 | ||
| name: mysql | ||
| env: | ||
| - name: MYSQL_ROOT_PASSWORD | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: mysql-secret | ||
| key: root-password | ||
| - name: MYSQL_DATABASE | ||
| value: gluu | ||
| ports: | ||
| - containerPort: 3306 | ||
| name: mysql | ||
| volumeMounts: | ||
| - name: mysql-persistent-storage | ||
| mountPath: /var/lib/mysql | ||
| volumes: | ||
| - name: mysql-persistent-storage | ||
| persistentVolumeClaim: | ||
| claimName: mysql-pv-claim | ||
| --- | ||
|
Comment on lines
+22
to
+59
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainScript executed: #!/bin/bash
# Check if the file exists and view its content
if [ -f "automation/mysql.yaml" ]; then
echo "=== File found ==="
wc -l automation/mysql.yaml
echo ""
echo "=== Content ==="
cat -n automation/mysql.yaml
else
echo "File not found at automation/mysql.yaml"
# Try to locate it
find . -name "mysql.yaml" -type f 2>/dev/null | head -20
fiRepository: GluuFederation/flex <shell_result> stdout: </shell_result> CKV_K8S_35 Checkov security check MySQL secrets <web_search_result>
Why it matters for MySQL
Simple remediation options
Notes
References
Would you like a ready-to-apply Deployment manifest that shows mounting a MySQL secret and an example init script that reads the password from a file? All security hardening recommendations are valid and well-founded. The review accurately identifies five production readiness gaps in the MySQL Deployment:
The file confirms the Deployment lacks all five hardening measures. The example improvements are accurate and applicable. The characterization as acceptable for demo/test but requiring hardening for production is appropriate. 🧰 Tools🪛 Checkov (3.2.334)[medium] 22-59: Containers should not run with allowPrivilegeEscalation (CKV_K8S_20) [low] 22-59: CPU limits should be set (CKV_K8S_11) [low] 22-59: CPU requests should be set (CKV_K8S_10) [low] 22-59: Apply security context to your containers (CKV_K8S_30) [low] 22-59: Minimize the admission of containers with the NET_RAW capability (CKV_K8S_28) [low] 22-59: Image should use digest (CKV_K8S_43) [low] 22-59: Image Pull Policy should be Always (CKV_K8S_15) [low] 22-59: Liveness Probe Should be Configured (CKV_K8S_8) [low] 22-59: Memory limits should be set (CKV_K8S_13) [low] 22-59: Memory requests should be set (CKV_K8S_12) [low] 22-59: Minimize the admission of containers with capabilities assigned (CKV_K8S_37) [low] 22-59: Apply security context to your pods and containers (CKV_K8S_29) [low] 22-59: Use read-only filesystem for containers where possible (CKV_K8S_22) [low] 22-59: Readiness Probe Should be Configured (CKV_K8S_9) [medium] 22-59: Minimize the admission of root containers (CKV_K8S_23) [low] 22-59: Containers should run as a high UID to avoid host conflict (CKV_K8S_40) [low] 22-59: Ensure that the seccomp profile is set to docker/default or runtime/default (CKV_K8S_31) [low] 22-59: Prefer using secrets as files over secrets as environment variables (CKV_K8S_35) [low] 22-59: Ensure that Service Account Tokens are only mounted where necessary (CKV_K8S_38) 🤖 Prompt for AI Agents |
||
| apiVersion: v1 | ||
| kind: PersistentVolumeClaim | ||
| metadata: | ||
| name: mysql-pv-claim | ||
| namespace: gluu | ||
| spec: | ||
| accessModes: | ||
| - ReadWriteOnce | ||
| resources: | ||
| requests: | ||
| storage: 5Gi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: postgresql-secret | ||
| namespace: gluu | ||
| type: Opaque | ||
| stringData: | ||
| postgresql-password: Test1234# | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hardcoded credentials pose security risk — consider parameterization. The password "Test1234#" is hardcoded in the YAML manifest. For production use, externalize via environment variables or sealed secrets. Add a warning comment for demo/test users to change before production. Also applies to: 8-8 🤖 Prompt for AI Agents |
||
| --- | ||
| apiVersion: v1 | ||
| kind: Service | ||
| metadata: | ||
| name: postgresql | ||
| namespace: gluu | ||
| spec: | ||
| ports: | ||
| - port: 5432 | ||
| selector: | ||
| app: postgresql | ||
| clusterIP: None | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: postgresql | ||
| namespace: gluu | ||
| spec: | ||
| selector: | ||
| matchLabels: | ||
| app: postgresql | ||
| strategy: | ||
| type: Recreate | ||
| template: | ||
| metadata: | ||
| labels: | ||
| app: postgresql | ||
| spec: | ||
| containers: | ||
| - image: postgres:16 | ||
| name: postgresql | ||
| env: | ||
| - name: POSTGRES_PASSWORD | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: postgresql-secret | ||
| key: postgresql-password | ||
| - name: POSTGRES_DB | ||
| value: gluu | ||
| - name: PGDATA | ||
| value: /var/lib/postgresql/data/pgdata | ||
| ports: | ||
| - containerPort: 5432 | ||
| name: postgresql | ||
| volumeMounts: | ||
| - name: postgresql-persistent-storage | ||
| mountPath: /var/lib/postgresql/data | ||
| volumes: | ||
| - name: postgresql-persistent-storage | ||
| persistentVolumeClaim: | ||
| claimName: postgresql-pv-claim | ||
| --- | ||
|
Comment on lines
+22
to
+61
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainScript executed: # First, let's look at the structure and find the relevant files
fd -e yaml . automation/ 2>/dev/null | head -20Repository: GluuFederation/flex <shell_result> stdout: </shell_result> Script executed: # Read the PostgreSQL manifest
cat -n automation/pgsql.yamlRepository: GluuFederation/flex <shell_result> stdout: </shell_result> Script executed: # Read the MySQL manifest for comparison
cat -n automation/mysql.yamlRepository: GluuFederation/flex <shell_result> stdout: </shell_result> All suggested improvements are valid and confirmed missing from the PostgreSQL deployment manifest. The review comment is accurate. Both the PostgreSQL and MySQL manifests in
The manifests are structured identically and demonstrate identical gaps, confirming the comparison to 🧰 Tools🪛 Checkov (3.2.334)[medium] 22-61: Containers should not run with allowPrivilegeEscalation (CKV_K8S_20) [low] 22-61: CPU limits should be set (CKV_K8S_11) [low] 22-61: CPU requests should be set (CKV_K8S_10) [low] 22-61: Apply security context to your containers (CKV_K8S_30) [low] 22-61: Minimize the admission of containers with the NET_RAW capability (CKV_K8S_28) [low] 22-61: Image should use digest (CKV_K8S_43) [low] 22-61: Image Pull Policy should be Always (CKV_K8S_15) [low] 22-61: Liveness Probe Should be Configured (CKV_K8S_8) [low] 22-61: Memory limits should be set (CKV_K8S_13) [low] 22-61: Memory requests should be set (CKV_K8S_12) [low] 22-61: Minimize the admission of containers with capabilities assigned (CKV_K8S_37) [low] 22-61: Apply security context to your pods and containers (CKV_K8S_29) [low] 22-61: Use read-only filesystem for containers where possible (CKV_K8S_22) [low] 22-61: Readiness Probe Should be Configured (CKV_K8S_9) [medium] 22-61: Minimize the admission of root containers (CKV_K8S_23) [low] 22-61: Containers should run as a high UID to avoid host conflict (CKV_K8S_40) [low] 22-61: Ensure that the seccomp profile is set to docker/default or runtime/default (CKV_K8S_31) [low] 22-61: Prefer using secrets as files over secrets as environment variables (CKV_K8S_35) [low] 22-61: Ensure that Service Account Tokens are only mounted where necessary (CKV_K8S_38) |
||
| apiVersion: v1 | ||
| kind: PersistentVolumeClaim | ||
| metadata: | ||
| name: postgresql-pv-claim | ||
| namespace: gluu | ||
| spec: | ||
| accessModes: | ||
| - ReadWriteOnce | ||
| resources: | ||
| requests: | ||
| storage: 5Gi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -167,18 +167,12 @@ kubectl get secret cn -o json -n <namespace> | |
| To install a quick setup with `PostgreSQL` as the backend, you need to provide the connection parameters of a fresh setup. | ||
| For a test setup, you can follow the below instructions: | ||
|
|
||
| - `Apps` --> `Charts` and search for `Postgres`. | ||
| - Click on `Install` on the right side of the window. | ||
| - Create a new namespace called `postgres` and hit `Next`. | ||
| - You should be on the `Edit YAML` page. Modify the below keys as desired. These values will be inputted in the installation of `Gluu Flex` | ||
|
|
||
| | Key | | ||
| |-----------------| | ||
| | `auth.database` | | ||
| | `auth.username` | | ||
| | `auth.password` | | ||
|
|
||
| - Click `Install` at the bottom right of the page. | ||
| - Open a kubectl shell from the top right navigation menu `>_`. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix markdown formatting issues from linter. Three formatting issues were flagged by markdownlint:
Apply this diff to fix formatting: To install a quick setup with `PostgreSQL` as the backend, you need to provide the connection parameters of a fresh setup.
For a test setup, you can follow the below instructions:
~
- - Open a kubectl shell from the top right navigation menu `>_`.
+ - Open a kubectl shell from the top right navigation menu `>_`.
- Run:
+
```bash
wget https://raw.githubusercontent.com/GluuFederation/flex/nightly/automation/pgsql.yaml
kubectl apply -f pgsql.yaml #adjust values as preferredAnd for MySQL: To install a quick setup with `MySQL` as the backend, you need to provide the connection parameters of a fresh setup.
For a test setup, you can follow the below instructions:
~
- Open a kubectl shell from the top right navigation menu `>_`.
- Run:
+
```bash
wget https://raw.githubusercontent.com/GluuFederation/flex/nightly/automation/mysql.yaml
kubectl apply -f mysql.yaml #adjust values as preferredAlso applies to: 172-172, 186-186 🧰 Tools🪛 markdownlint-cli2 (0.18.1)170-170: Trailing spaces (MD009, no-trailing-spaces) 🤖 Prompt for AI Agents |
||
| - Run: | ||
| ```bash | ||
| wget https://raw.githubusercontent.com/GluuFederation/flex/nightly/automation/pgsql.yaml | ||
| kubectl apply -f pgsql.yaml #adjust values as preferred | ||
| ``` | ||
|
Comment on lines
+170
to
+175
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainScript executed: #!/bin/bash
# Verify YAML file accessibility and check their structure
echo "=== Checking PostgreSQL YAML accessibility ==="
if curl -s -o /dev/null -w "%{http_code}" https://raw.githubusercontent.com/GluuFederation/flex/nightly/automation/pgsql.yaml; then
echo " (HTTP status code above)"
fi
echo -e "\n=== Checking MySQL YAML accessibility ==="
if curl -s -o /dev/null -w "%{http_code}" https://raw.githubusercontent.com/GluuFederation/flex/nightly/automation/mysql.yaml; then
echo " (HTTP status code above)"
fi
echo -e "\n=== PostgreSQL YAML content (first 40 lines) ==="
curl -s https://raw.githubusercontent.com/GluuFederation/flex/nightly/automation/pgsql.yaml | head -40
echo -e "\n=== MySQL YAML content (first 40 lines) ==="
curl -s https://raw.githubusercontent.com/GluuFederation/flex/nightly/automation/mysql.yaml | head -40Repository: GluuFederation/flex <shell_result> stdout: </shell_result> Script executed: #!/bin/bash
# Check if YAML files exist in the repository at different locations
echo "=== Checking for pgsql.yaml and mysql.yaml in GluuFederation/flex repository ==="
# Try to find files in different branches and paths using GitHub API
curl -s "https://api.github.com/search/code?q=repo:GluuFederation/flex+filename:pgsql.yaml" | python3 << 'EOF'
import json, sys
try:
data = json.load(sys.stdin)
if data.get('total_count', 0) > 0:
print("PostgreSQL YAML files found:")
for item in data.get('items', []):
print(f" - {item['path']} (branch: {item.get('repository', {}).get('default_branch', 'N/A')})")
else:
print("No pgsql.yaml files found in repository")
except:
print("Error parsing response")
EOF
echo ""
curl -s "https://api.github.com/search/code?q=repo:GluuFederation/flex+filename:mysql.yaml" | python3 << 'EOF'
import json, sys
try:
data = json.load(sys.stdin)
if data.get('total_count', 0) > 0:
print("MySQL YAML files found:")
for item in data.get('items', []):
print(f" - {item['path']} (branch: {item.get('repository', {}).get('default_branch', 'N/A')})")
else:
print("No mysql.yaml files found in repository")
except:
print("Error parsing response")
EOF
echo ""
echo "=== Checking automation directory in nightly branch ==="
curl -s "https://api.github.com/repos/GluuFederation/flex/contents/automation?ref=nightly" | python3 << 'EOF'
import json, sys
try:
data = json.load(sys.stdin)
if isinstance(data, list):
print("Files in automation/ directory (nightly branch):")
for item in data:
print(f" - {item['name']}")
elif 'message' in data:
print(f"Error: {data['message']}")
else:
print("Unexpected response format")
except Exception as e:
print(f"Error: {e}")
EOFRepository: GluuFederation/flex <shell_result> stdout: </shell_result> Script executed: #!/bin/bash
# Direct check of the nightly branch contents
echo "=== Attempting to retrieve main branch automation directory ==="
curl -s -H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/GluuFederation/flex/contents/automation" | head -100
echo ""
echo "=== Attempting to retrieve nightly branch automation directory ==="
curl -s -H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/GluuFederation/flex/contents/automation?ref=nightly" | head -100Repository: GluuFederation/flex <shell_result> stdout: </shell_result> The verification has confirmed the critical issue. The YAML files referenced in wget commands do not exist and will cause failures. Both URLs return HTTP 404:
Users following lines 170-175 will fail at the
Additionally, the instruction "adjust values as preferred" remains vague without examples of which configuration parameters (credentials, database name, storage class, resource limits) require customization. 🧰 Tools🪛 markdownlint-cli2 (0.18.1)170-170: Trailing spaces (MD009, no-trailing-spaces) 172-172: Fenced code blocks should be surrounded by blank lines (MD031, blanks-around-fences) 🤖 Prompt for AI Agents |
||
|
|
||
| ### Install MySQL database | ||
| !!! Note | ||
|
|
@@ -189,21 +183,11 @@ kubectl get secret cn -o json -n <namespace> | |
|
|
||
| - Open a kubectl shell from the top right navigation menu `>_`. | ||
| - Run: | ||
| ```bash | ||
| wget https://raw.githubusercontent.com/GluuFederation/flex/nightly/automation/mysql.yaml | ||
| kubectl apply -f mysql.yaml #adjust values as preferred | ||
| ``` | ||
| helm repo add bitnami https://charts.bitnami.com/bitnami | ||
| helm repo update | ||
| kubectl create ns gluu #Create gluu namespace | ||
| ``` | ||
| - Pass in a custom password for the database. Here we used `Test1234#`. The admin user will be left as `root`. Notice we are installing in the `gluu` namespace. Run | ||
|
|
||
| ``` | ||
| helm install my-release --set auth.rootPassword=Test1234#,auth.database=jans bitnami/mysql -n gluu | ||
| ``` | ||
|
|
||
| ### Successful Installation | ||
| After the installation is successful, you should have a `Statefulset` active in the rancher UI as shown in the screenshot below. | ||
|
|
||
| <img width="1504" alt="Screenshot 2022-07-05 at 14 54 26" src="https://user-images.githubusercontent.com/17182751/177326700-9215436c-f1c2-467f-94ff-601ff7fbdbfb.png"> | ||
|
|
||
|
|
||
| 2. Install [Nginx-Ingress](https://github.com/kubernetes/ingress-nginx), if you are not using Istio ingress | ||
|
|
@@ -227,7 +211,7 @@ kubectl get secret cn -o json -n <namespace> | |
| - Change the namespace from `default` to `gluu`, then click on `Next`. | ||
| - Scroll through the sections to get familiar with the options. For minimal setup follow with the next instructions. | ||
| - Add `License SSA`. Before initiating the setup, please obtain an [SSA](https://docs.gluu.org/vreplace-flex-version/install/agama/prerequisites/#obtaining-an-ssa) for Flex trial, after which you will issued a JWT. | ||
| - Click on the `Persistence` section. Change `SQL database host uri` to `postgresql.postgres.svc.cluster.local` in the case of `PostgreSQL` or `my-release-mysql.gluu.svc.cluster.local` in the case of `MySQL`. Also set `SQL database username`,`SQL password`, and `SQL database name` to the values you used during the database installation. | ||
| - Click on the `Persistence` section. Change `SQL database host uri` to `postgresql.gluu.svc` in the case of `PostgreSQL` or `mysql.gluu.svc` in the case of `MySQL`. Also set `SQL database username`,`SQL password`, and `SQL database name` to the values you used during the database installation. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial 🧩 Analysis chainScript executed: #!/bin/bash
# Find pgsql.yaml and mysql.yaml files
find . -type f \( -name "pgsql.yaml" -o -name "mysql.yaml" \) | head -20Repository: GluuFederation/flex <shell_result> stdout: </shell_result> Script executed: #!/bin/bash
# Read the mysql.yaml file to check service definition
echo "=== mysql.yaml ==="
cat ./automation/mysql.yamlRepository: GluuFederation/flex <shell_result> stdout: </shell_result> Script executed: #!/bin/bash
# Read the pgsql.yaml file to check service definition
echo "=== pgsql.yaml ==="
cat ./automation/pgsql.yamlRepository: GluuFederation/flex <shell_result> stdout: </shell_result> Based on my verification of the deployment manifests, I can now provide the rewritten review comment: Hostname verification confirms values are correct; consider adding verification step for user clarity. Line 214 references Consider adding a verification step: 🤖 Prompt for AI Agents |
||
| - To enable Casa and the Admin UI, navigate to the `Optional Services` section and check the `Enable casa` and `boolean flag to enable admin UI` boxes. You can also enable different services like `Client API` and `Jackrabbit`. | ||
| - Click on the section named `Ingress` and enable all the endpoints. You might add LB IP or address if you don't have `FQDN` for `Gluu`. | ||
| - To pass your `FQDN` or `Domain` that is intended to serve the Gluu Flex IDP, head to the `Configuration` section: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoded credentials pose security risk — consider parameterization.
The root password "Test1234#" is hardcoded in the YAML manifest. For production use, this should be externalized via environment variables or sealed secrets.
For demo/test purposes, consider adding a comment warning users to change this value before production deployment.
Also applies to: 8-8
🤖 Prompt for AI Agents