-
Notifications
You must be signed in to change notification settings - Fork 80
CNF-25757: Disable iptables-alerter in RDS configurations #949
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
base: main
Are you sure you want to change the base?
Changes from all commits
4ed7b6c
b1a010f
cdd6bb9
7993215
fbc36b9
70a0940
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,10 @@ | ||
| # required | ||
| # Disables iptables-alerter to prevent high CPU usage in production (OCPBUGS-87026, OCPBUGS-73767) | ||
| # KCS: https://access.redhat.com/solutions/7134521 | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: iptables-alerter-config | ||
| namespace: openshift-network-operator | ||
| data: | ||
| enabled: "false" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # required | ||
| # Disables iptables-alerter to prevent high CPU usage in production (OCPBUGS-87026, OCPBUGS-73767) | ||
| # Partners must test iptables usage in pre-production and migrate to nftables before RHEL10 | ||
| # KCS: https://access.redhat.com/solutions/7134521 | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: iptables-alerter-config | ||
| namespace: openshift-network-operator | ||
| data: | ||
| enabled: "false" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # required | ||
| # Role for network-operator restart Job (OCPBUGS-87026, OCPBUGS-73767) | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: Role | ||
| metadata: | ||
| name: network-operator-restarter | ||
| namespace: openshift-network-operator | ||
| rules: | ||
| - apiGroups: [""] | ||
| resources: ["pods"] | ||
| verbs: ["list", "delete"] | ||
|
ktsai-redhat marked this conversation as resolved.
|
||
| - apiGroups: [""] | ||
| resources: ["configmaps"] | ||
| verbs: ["get"] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # required | ||
| # RoleBinding for network-operator restart Job (OCPBUGS-87026, OCPBUGS-73767) | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: RoleBinding | ||
| metadata: | ||
| name: network-operator-restarter | ||
| namespace: openshift-network-operator | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: Role | ||
| name: network-operator-restarter | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: network-operator-restarter | ||
| namespace: openshift-network-operator |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # required | ||
| # ServiceAccount for network-operator restart Job (OCPBUGS-87026, OCPBUGS-73767) | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: network-operator-restarter | ||
| namespace: openshift-network-operator |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # required | ||
| # Job to restart network-operator after iptables-alerter-config ConfigMap is created | ||
| # Ensures the network operator picks up the new configuration (OCPBUGS-87026, OCPBUGS-73767) | ||
| --- | ||
|
ktsai-redhat marked this conversation as resolved.
|
||
| apiVersion: batch/v1 | ||
| kind: Job | ||
| metadata: | ||
| name: restart-network-operator | ||
| namespace: openshift-network-operator | ||
| spec: | ||
| template: | ||
| spec: | ||
| serviceAccountName: network-operator-restarter | ||
| restartPolicy: OnFailure | ||
| containers: | ||
| - name: kubectl | ||
| image: registry.redhat.io/openshift4/ose-cli:latest | ||
| imagePullPolicy: IfNotPresent | ||
|
Comment on lines
+17
to
+18
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. 🔒 Security & Privacy | 🛡️ Analyzed with Security Review | 🟠 Major | 🏗️ Heavy lift 🧩 Analysis chain🏁 Script executed: #!/bin/bash
printf '%s\n' '--- core Job ---'
cat -n telco-core/configuration/reference-crs/required/networking/RestartNetworkOperatorJob.yaml
printf '%s\n' '--- hub Job ---'
cat -n telco-hub/configuration/reference-crs/required/networking/RestartNetworkOperatorJob.yaml
printf '%s\n' '--- related restarter resources ---'
rg -n -C 3 'network-operator-restarter|serviceAccountName|image:|imagePullPolicy|delete|pods' \
telco-core/configuration/reference-crs/required/networking \
telco-hub/configuration/reference-crs/required/networkingRepository: openshift-kni/telco-reference Length of output: 18894 🏁 Script executed: #!/bin/bash
cat -n telco-core/configuration/reference-crs/required/networking/RestartNetworkOperatorJob.yaml
printf '\n--- hub ---\n'
cat -n telco-hub/configuration/reference-crs/required/networking/RestartNetworkOperatorJob.yaml
printf '\n--- related resources ---\n'
rg -n -C 3 'network-operator-restarter|serviceAccountName|image:|imagePullPolicy|delete|pods' telco-core/configuration/reference-crs/required/networking telco-hub/configuration/reference-crs/required/networkingRepository: openshift-kni/telco-reference Length of output: 18865 Security Misconfiguration Reachability: Internal Use an immutable CLI image reference in both Jobs. Both Jobs run Proposed change- image: registry.redhat.io/openshift4/ose-cli:latest
+ image: registry.redhat.io/openshift4/ose-cli@sha256:<tested-digest>🧰 Tools🪛 Checkov (3.3.13)[medium] 5-43: Containers should not run with allowPrivilegeEscalation (CKV_K8S_20) [medium] 5-43: Minimize the admission of root containers (CKV_K8S_23) 📍 Affects 2 files
🤖 Prompt for AI AgentsSource: MCP tools |
||
| command: | ||
| - /bin/bash | ||
| - -c | ||
| - | | ||
| # Check if iptables-alerter-config ConfigMap exists | ||
| if ! oc get configmap iptables-alerter-config -n openshift-network-operator &>/dev/null; then | ||
| echo "ERROR: iptables-alerter-config ConfigMap not found" | ||
| exit 1 | ||
| fi | ||
| echo "ConfigMap iptables-alerter-config found" | ||
|
|
||
| # Delete network-operator pod to pick up iptables-alerter-config | ||
| # Check if pod exists before deleting | ||
| if oc get pod -n openshift-network-operator -l name=network-operator --no-headers 2>/dev/null | grep -q .; then | ||
| oc delete pod -n openshift-network-operator -l name=network-operator --ignore-not-found=true | ||
| echo "Network operator pod deleted successfully" | ||
| else | ||
| echo "No network-operator pods found, nothing to delete" | ||
| fi | ||
| nodeSelector: | ||
| node-role.kubernetes.io/master: "" | ||
| tolerations: | ||
| - effect: NoSchedule | ||
| key: node-role.kubernetes.io/master | ||
| operator: Exists | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # required | ||
| # Disables iptables-alerter to prevent high CPU usage in production (OCPBUGS-87026, OCPBUGS-73767) | ||
| # KCS: https://access.redhat.com/solutions/7134521 | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: iptables-alerter-config | ||
| namespace: openshift-network-operator | ||
| data: | ||
| enabled: "false" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # required | ||
| # Disables iptables-alerter to prevent high CPU usage in production (OCPBUGS-87026, OCPBUGS-73767) | ||
| # Partners must test iptables usage in pre-production and migrate to nftables before RHEL10 | ||
| # KCS: https://access.redhat.com/solutions/7134521 | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: iptables-alerter-config | ||
| namespace: openshift-network-operator | ||
| data: | ||
| enabled: "false" | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # required | ||
| # Role for network-operator restart Job (OCPBUGS-87026, OCPBUGS-73767) | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: Role | ||
| metadata: | ||
| name: network-operator-restarter | ||
| namespace: openshift-network-operator | ||
| rules: | ||
| - apiGroups: [""] | ||
| resources: ["pods"] | ||
| verbs: ["list", "delete"] | ||
| - apiGroups: [""] | ||
| resources: ["configmaps"] | ||
| verbs: ["get"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # required | ||
| # RoleBinding for network-operator restart Job (OCPBUGS-87026, OCPBUGS-73767) | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: RoleBinding | ||
| metadata: | ||
| name: network-operator-restarter | ||
| namespace: openshift-network-operator | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: Role | ||
| name: network-operator-restarter | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: network-operator-restarter | ||
| namespace: openshift-network-operator |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # required | ||
| # ServiceAccount for network-operator restart Job (OCPBUGS-87026, OCPBUGS-73767) | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: network-operator-restarter | ||
| namespace: openshift-network-operator |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # required | ||
| # Job to restart network-operator after iptables-alerter-config ConfigMap is created | ||
| # Ensures the network operator picks up the new configuration (OCPBUGS-87026, OCPBUGS-73767) | ||
| --- | ||
| apiVersion: batch/v1 | ||
| kind: Job | ||
| metadata: | ||
| name: restart-network-operator | ||
| namespace: openshift-network-operator | ||
| spec: | ||
| template: | ||
| spec: | ||
| serviceAccountName: network-operator-restarter | ||
| restartPolicy: OnFailure | ||
| containers: | ||
| - name: kubectl | ||
| image: registry.redhat.io/openshift4/ose-cli:latest | ||
| imagePullPolicy: IfNotPresent | ||
| command: | ||
| - /bin/bash | ||
| - -c | ||
| - | | ||
| # Check if iptables-alerter-config ConfigMap exists | ||
| if ! oc get configmap iptables-alerter-config -n openshift-network-operator &>/dev/null; then | ||
| echo "ERROR: iptables-alerter-config ConfigMap not found" | ||
| exit 1 | ||
| fi | ||
| echo "ConfigMap iptables-alerter-config found" | ||
|
|
||
| # Delete network-operator pod to pick up iptables-alerter-config | ||
| # Check if pod exists before deleting | ||
| if oc get pod -n openshift-network-operator -l name=network-operator --no-headers 2>/dev/null | grep -q .; then | ||
| oc delete pod -n openshift-network-operator -l name=network-operator --ignore-not-found=true | ||
| echo "Network operator pod deleted successfully" | ||
| else | ||
| echo "No network-operator pods found, nothing to delete" | ||
| fi | ||
| nodeSelector: | ||
| node-role.kubernetes.io/master: "" | ||
| tolerations: | ||
| - effect: NoSchedule | ||
| key: node-role.kubernetes.io/master | ||
| operator: Exists |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| kind: Kustomization | ||
| resources: | ||
| - IptablesAlerterConfig.yaml | ||
| - NetworkOperatorRestarterSA.yaml | ||
| - NetworkOperatorRestarterRole.yaml | ||
| - NetworkOperatorRestarterRoleBinding.yaml | ||
| - RestartNetworkOperatorJob.yaml |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # required | ||
| # Disables iptables-alerter to prevent high CPU usage in production (OCPBUGS-87026, OCPBUGS-73767) | ||
| # KCS: https://access.redhat.com/solutions/7134521 | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: iptables-alerter-config | ||
| namespace: openshift-network-operator | ||
| annotations: | ||
| ran.openshift.io/ztp-deploy-wave: "10" | ||
| data: | ||
| enabled: "false" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # required | ||
| # Disables iptables-alerter to prevent high CPU usage in production (OCPBUGS-87026, OCPBUGS-73767) | ||
| # Partners must test iptables usage in pre-production and migrate to nftables before RHEL10 | ||
| # KCS: https://access.redhat.com/solutions/7134521 | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: iptables-alerter-config | ||
| namespace: openshift-network-operator | ||
| annotations: | ||
| ran.openshift.io/ztp-deploy-wave: "10" | ||
| data: | ||
| enabled: "false" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| # Role for network-operator restart Job (OCPBUGS-87026, OCPBUGS-73767) | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: Role | ||
| metadata: | ||
| name: network-operator-restarter | ||
| namespace: openshift-network-operator | ||
| annotations: | ||
| ran.openshift.io/ztp-deploy-wave: "10" | ||
| rules: | ||
| - apiGroups: [""] | ||
| resources: ["pods"] | ||
| verbs: ["list", "delete"] | ||
| - apiGroups: [""] | ||
| resources: ["configmaps"] | ||
| verbs: ["get"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # RoleBinding for network-operator restart Job (OCPBUGS-87026, OCPBUGS-73767) | ||
| --- | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| kind: RoleBinding | ||
| metadata: | ||
| name: network-operator-restarter | ||
| namespace: openshift-network-operator | ||
| annotations: | ||
| ran.openshift.io/ztp-deploy-wave: "10" | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: Role | ||
| name: network-operator-restarter | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: network-operator-restarter | ||
| namespace: openshift-network-operator |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # ServiceAccount for network-operator restart Job (OCPBUGS-87026, OCPBUGS-73767) | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: network-operator-restarter | ||
| namespace: openshift-network-operator | ||
| annotations: | ||
| ran.openshift.io/ztp-deploy-wave: "10" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # Job to restart network-operator after iptables-alerter-config ConfigMap is created | ||
| # Ensures the network operator picks up the new configuration (OCPBUGS-87026, OCPBUGS-73767) | ||
| --- | ||
| apiVersion: batch/v1 | ||
| kind: Job | ||
| metadata: | ||
| name: restart-network-operator | ||
| namespace: openshift-network-operator | ||
| annotations: | ||
| ran.openshift.io/ztp-deploy-wave: "100" | ||
| spec: | ||
| template: | ||
| spec: | ||
| serviceAccountName: network-operator-restarter | ||
| restartPolicy: OnFailure | ||
| containers: | ||
| - name: kubectl | ||
| image: registry.redhat.io/openshift4/ose-cli:latest | ||
| imagePullPolicy: IfNotPresent | ||
| command: | ||
| - /bin/bash | ||
| - -c | ||
| - | | ||
| # Check if iptables-alerter-config ConfigMap exists | ||
| if ! oc get configmap iptables-alerter-config -n openshift-network-operator &>/dev/null; then | ||
| echo "ERROR: iptables-alerter-config ConfigMap not found" | ||
| exit 1 | ||
| fi | ||
| echo "ConfigMap iptables-alerter-config found" | ||
|
|
||
| # Delete network-operator pod to pick up iptables-alerter-config | ||
| # Check if pod exists before deleting | ||
| if oc get pod -n openshift-network-operator -l name=network-operator --no-headers 2>/dev/null | grep -q .; then | ||
| oc delete pod -n openshift-network-operator -l name=network-operator --ignore-not-found=true | ||
| echo "Network operator pod deleted successfully" | ||
| else | ||
| echo "No network-operator pods found, nothing to delete" | ||
| fi | ||
| nodeSelector: | ||
| node-role.kubernetes.io/master: "" | ||
| tolerations: | ||
| - effect: NoSchedule | ||
| key: node-role.kubernetes.io/master | ||
| operator: Exists |
Uh oh!
There was an error while loading. Please reload this page.