summaryrefslogtreecommitdiff
path: root/app/models/clusters/applications/ingress.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/clusters/applications/ingress.rb')
-rw-r--r--app/models/clusters/applications/ingress.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/app/models/clusters/applications/ingress.rb b/app/models/clusters/applications/ingress.rb
index 50def3ba38c..44c66f06059 100644
--- a/app/models/clusters/applications/ingress.rb
+++ b/app/models/clusters/applications/ingress.rb
@@ -35,6 +35,10 @@ module Clusters
'stable/nginx-ingress'
end
+ def values
+ content_values.to_yaml
+ end
+
def allowed_to_uninstall?
external_ip_or_hostname? && application_jupyter_nil_or_installable?
end
@@ -67,6 +71,23 @@ module Clusters
private
+ def specification
+ return {} unless Feature.enabled?(:ingress_modsecurity)
+
+ {
+ "controller" => {
+ "config" => {
+ "enable-modsecurity" => "true",
+ "enable-owasp-modsecurity-crs" => "true"
+ }
+ }
+ }
+ end
+
+ def content_values
+ YAML.load_file(chart_values_file).deep_merge!(specification)
+ end
+
def application_jupyter_nil_or_installable?
cluster.application_jupyter.nil? || cluster.application_jupyter&.installable?
end