From ce0a2d69b8298eb930b336952d43052dff5b4847 Mon Sep 17 00:00:00 2001
From: Chris Nowicki <cnowicki@bridgephase.com>
Date: Fri, 21 Mar 2025 10:29:29 -0400
Subject: [PATCH] Enable dynamic network policy

---
 CHANGELOG.md                                       |  6 ++++++
 README.md                                          |  6 +++---
 chart/Chart.yaml                                   |  2 +-
 chart/templates/bigbang/networkpolicies/istio.yaml | 12 ++++++++++--
 4 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4f94cd4..82688e0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,12 @@
 The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
 
 ---
+## [1.1.2320154-bb.23] - 2025-03-21
+
+### Changed
+
+- Enabled dynamic network policy for istio
+
 ## [1.1.2320154-bb.22] - 2024-12-13
 
 ### Changed
diff --git a/README.md b/README.md
index 5afecff..76f4019 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,14 @@
 <!-- Warning: Do not manually edit this file. See notes on gluon + helm-docs at the end of this file for more information. -->
 # fortify-ssc
 
-![Version: 1.1.2320154-bb.22](https://img.shields.io/badge/Version-1.1.2320154--bb.22-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 24.4.2.0009](https://img.shields.io/badge/AppVersion-24.4.2.0009-informational?style=flat-square) ![Maintenance Track: bb_integrated](https://img.shields.io/badge/Maintenance_Track-bb_integrated-green?style=flat-square)
+![Version: 1.1.2320154-bb.23](https://img.shields.io/badge/Version-1.1.2320154--bb.23-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 24.4.2.0009](https://img.shields.io/badge/AppVersion-24.4.2.0009-informational?style=flat-square) ![Maintenance Track: bb_integrated](https://img.shields.io/badge/Maintenance_Track-bb_integrated-green?style=flat-square)
 
 A Helm chart for Fortify Software Security Center application
 
 ## Upstream References
-- <https://www.microfocus.com/en-us/solutions/application-security>
 
-* <https://github.com/fortify/helm3-charts>
+- <https://www.microfocus.com/en-us/solutions/application-security>
+- <https://github.com/fortify/helm3-charts>
 
 ## Upstream Release Notes
 
diff --git a/chart/Chart.yaml b/chart/Chart.yaml
index 45ace0e..c504178 100644
--- a/chart/Chart.yaml
+++ b/chart/Chart.yaml
@@ -1,7 +1,7 @@
 apiVersion: v2
 description: A Helm chart for Fortify Software Security Center application
 name: fortify-ssc
-version: 1.1.2320154-bb.22
+version: 1.1.2320154-bb.23
 appVersion: 24.4.2.0009
 type: application
 keywords:
diff --git a/chart/templates/bigbang/networkpolicies/istio.yaml b/chart/templates/bigbang/networkpolicies/istio.yaml
index ddacf7a..9a62f80 100644
--- a/chart/templates/bigbang/networkpolicies/istio.yaml
+++ b/chart/templates/bigbang/networkpolicies/istio.yaml
@@ -12,7 +12,11 @@ spec:
   - to:
     - namespaceSelector:
         matchLabels:
-          app.kubernetes.io/name: istio-controlplane
+          {{- if .Values.networkPolicies.istioNamespaceSelector }}
+          app.kubernetes.io/name: {{ .Values.networkPolicies.istioNamespaceSelector.egress }}
+          {{- else }}
+          app.kubernetes.io/name: "istio-controlplane"
+          {{- end }}
       podSelector:
         matchLabels:
           app: istiod
@@ -32,7 +36,11 @@ spec:
   - from:
     - namespaceSelector:
         matchLabels:
-          app.kubernetes.io/name: istio-controlplane
+          {{- if .Values.networkPolicies.istioNamespaceSelector }}
+          app.kubernetes.io/name: {{ .Values.networkPolicies.istioNamespaceSelector.ingress }}
+          {{- else }}
+          app.kubernetes.io/name: "istio-controlplane"
+          {{- end }}
       podSelector:
         matchLabels:
           {{- toYaml .Values.networkPolicies.ingressLabels | nindent 10}}
-- 
GitLab