+
General Settings
+ {% for key, value in settings.items() %}
+ {% if key in cat_general %}
+
+ {% endif %}
+ {% endfor %}
+
+
+
+
LDAP Settings
{% for key, value in settings.items() %}
-
+
+
+
Azure Active Directory Settings
+ {% for key, value in settings.items() %}
+ {% if key in cat_azad %}
+
+
+
+
+ {% endif %}
{% endfor %}
+
+
+
+
SMTP Settings
+ {% for key, value in settings.items() %}
+ {% if key in smtp_settings %}
+
+ {% endif %}
+ {% endfor %}
+
+
+
+
Jenkins Settings
+ {% for key, value in settings.items() %}
+ {% if key in cat_jenkins %}
+
+ {% endif %}
+ {% endfor %}
+
+
+
+
+
+
+
+
ServiceNOW Settings
+ {% for key, value in settings.items() %}
+ {% if key in snow_settings %}
+
+ {% endif %}
+ {% endfor %}
+
+
@@ -128,4 +250,157 @@
{% if key == 'SMTP_PASSWORD' %}
-
+
{% else %}
{% endif %}
@@ -199,10 +199,10 @@
Jenkins Settings
{% elif key == 'JENKINS_KEY' %}
-
+
{% elif key == 'JENKINS_TOKEN' %}
-
+
{% else %}
@@ -229,10 +229,10 @@
ServiceNOW Settings
{% elif key == 'SNOW_CLIENT_SECRET' %}
-
+
{% elif key == 'SNOW_PASSWORD' %}
-
+
{% else %}
diff --git a/src/vr/vulns/web/findings.py b/src/vr/vulns/web/findings.py
index 8c9938c8..06d44322 100644
--- a/src/vr/vulns/web/findings.py
+++ b/src/vr/vulns/web/findings.py
@@ -25,7 +25,6 @@
import base64
from io import StringIO
from flask import Response
-from config_engine import ENV
from vr.functions.ml_functions import predict_vuln_validity
from vr.vulns.model.cvssbasescoresv3 import CVSSBaseScoresV3
from vr.vulns.model.cvssbasescoresv3extensions import CVSSBaseScoresV3Extensions
@@ -42,7 +41,7 @@
UNAUTH_STATUS = "403.html"
SERVER_ERR_STATUS = "500.html"
VULN_STATUS_IS_NOT_CLOSED = "Vulnerabilities.Status NOT LIKE 'Closed-%' AND Vulnerabilities.Status NOT LIKE 'Open-RiskAccepted-%'"
-test = ENV
+test = app.config['ENV']
if test == 'test':
ISO_FORMAT = "%Y-%m-%dT%H:%M:%S.%f"
else:
diff --git a/src/vr/vulns/web/testing.py b/src/vr/vulns/web/testing.py
index 32e604b8..c69f7122 100644
--- a/src/vr/vulns/web/testing.py
+++ b/src/vr/vulns/web/testing.py
@@ -11,8 +11,8 @@
from vr.vulns.model.vulnerabilityscans import VulnerabilityScans, VulnerabilityScansSchema
from vr.functions.table_functions import load_table, update_table
from requests.auth import HTTPBasicAuth
-from config_engine import JENKINS_USER, JENKINS_KEY, JENKINS_PROJECT, JENKINS_HOST, JENKINS_TOKEN
from vr.assets.model.applicationprofiles import ApplicationProfiles, ApplicationProfilesSchema
+from vr import app
NAV = {
@@ -115,14 +115,14 @@ def on_demand_testing():
"Content-Type": "application/x-www-form-urlencoded"
}
data = {
- 'token': JENKINS_TOKEN,
+ 'token': app.config['JENKINS_TOKEN'],
'GIT_URL': git_url,
'TESTS': tests_to_run.upper(),
'GIT_BRANCH': git_branch,
'APP_NAME': app_name
}
- url = f'{JENKINS_HOST}/job/{JENKINS_PROJECT}/buildWithParameters'
- resp = requests.post(url, headers=headers, data=data, auth=HTTPBasicAuth(JENKINS_USER, JENKINS_KEY))
+ url = f"{app.config['JENKINS_HOST']}/job/{app.config['JENKINS_PROJECT']}/buildWithParameters"
+ resp = requests.post(url, headers=headers, data=data, auth=HTTPBasicAuth(app.config['JENKINS_USER'], app.config['JENKINS_KEY']))
return redirect(request.referrer)
From 9edb485f6d54f026937b347d8069aa844047bf7f Mon Sep 17 00:00:00 2001
From: bkaiserinfosec <49665796+bkaiserinfosec@users.noreply.github.com>
Date: Fri, 22 Mar 2024 08:04:28 -0700
Subject: [PATCH 49/51] Feature/jenkins updates (#519)
* Update security_quality_gate.py
* Update Jenkinsfile
* Update security_quality_gate.py
* update settings and groups
* add function for table updates
* updated function for db updates
* Update updates.py
* Update updates.py
* Update updates.py
* Update settings.py
* update to settings update without restart
* Update run.py
* Update pipeline-config.yaml
---
pipeline-config.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pipeline-config.yaml b/pipeline-config.yaml
index 2a9eb073..d19730b0 100644
--- a/pipeline-config.yaml
+++ b/pipeline-config.yaml
@@ -9,7 +9,7 @@ stages:
branches:
- release
unitTesting:
- enabled: false
+ enabled: true
branches: []
secretScanning:
enabled: false
From 76926b35975dcf8330a2d17ec2bc87fec6fa4605 Mon Sep 17 00:00:00 2001
From: bkaiserinfosec <49665796+bkaiserinfosec@users.noreply.github.com>
Date: Fri, 22 Mar 2024 10:37:27 -0700
Subject: [PATCH 50/51] Feature/jenkins updates (#521)
* Update security_quality_gate.py
* Update Jenkinsfile
* Update security_quality_gate.py
* update settings and groups
* add function for table updates
* updated function for db updates
* Update updates.py
* Update updates.py
* Update updates.py
* Update settings.py
* update to settings update without restart
* Update run.py
* Update pipeline-config.yaml
* Update __init__.py
---
src/vr/__init__.py | 85 ++++++++++++++++++++++------------------------
1 file changed, 41 insertions(+), 44 deletions(-)
diff --git a/src/vr/__init__.py b/src/vr/__init__.py
index 2f3ccf73..90fe1b09 100644
--- a/src/vr/__init__.py
+++ b/src/vr/__init__.py
@@ -214,50 +214,47 @@ def connect_to_db():
return cur, db
def getPersistentConfig():
- try:
- cur, db = connect_to_db()
- sql = 'SELECT * FROM AppConfig WHERE 1=1'
- cur.execute(sql)
- row = cur.fetchone()
- if row[2]:
- app.config['APP_EXT_URL'] = row[3]
- app.config['AUTH_TYPE'] = row[4]
- app.config['AZAD_AUTHORITY'] = row[5]
- app.config['AZAD_CLIENT_ID'] = row[6]
- app.config['AZAD_CLIENT_SECRET'] = row[7]
- app.config['AZURE_KEYVAULT_NAME'] = row[8]
- app.config['ENV'] = row[9]
- app.config['INSECURE_OAUTH'] = row[10]
- app.config['JENKINS_ENABLED'] = row[37]
- app.config['JENKINS_HOST'] = row[11]
- app.config['JENKINS_KEY'] = row[12]
- app.config['JENKINS_PROJECT'] = row[13]
- app.config['JENKINS_STAGING_PROJECT'] = row[14]
- app.config['JENKINS_TOKEN'] = row[15]
- app.config['JENKINS_USER'] = row[16]
- app.config['LDAP_BASE_DN'] = row[17]
- app.config['LDAP_BIND_USER_DN'] = row[18]
- app.config['LDAP_BIND_USER_PASSWORD'] = row[19]
- app.config['LDAP_GROUP_DN'] = row[20]
- app.config['LDAP_HOST'] = row[21]
- app.config['LDAP_PORT'] = row[22]
- app.config['LDAP_USER_DN'] = row[23]
- app.config['LDAP_USER_LOGIN_ATTR'] = row[24]
- app.config['LDAP_USER_RDN_ATTR'] = row[25]
- app.config['PROD_DB_URI'] = row[26]
- app.config['SMTP_ADMIN_EMAIL'] = row[27]
- app.config['SMTP_HOST'] = row[28]
- app.config['SMTP_PASSWORD'] = row[29]
- app.config['SMTP_USER'] = row[30]
- app.config['SNOW_ENABLED'] = row[38]
- app.config['SNOW_CLIENT_ID'] = row[31]
- app.config['SNOW_CLIENT_SECRET'] = row[32]
- app.config['SNOW_INSTANCE_NAME'] = row[33]
- app.config['SNOW_PASSWORD'] = row[34]
- app.config['SNOW_USERNAME'] = row[35]
- app.config['VERSION'] = row[36]
- except:
- print('AppConfig Database table is either unreachable or not setup.')
+ cur, db = connect_to_db()
+ sql = 'SELECT * FROM AppConfig WHERE 1=1'
+ cur.execute(sql)
+ row = cur.fetchone()
+ if row[2]:
+ app.config['APP_EXT_URL'] = row[3]
+ app.config['AUTH_TYPE'] = row[4]
+ app.config['AZAD_AUTHORITY'] = row[5]
+ app.config['AZAD_CLIENT_ID'] = row[6]
+ app.config['AZAD_CLIENT_SECRET'] = row[7]
+ app.config['AZURE_KEYVAULT_NAME'] = row[8]
+ app.config['ENV'] = row[9]
+ app.config['INSECURE_OAUTH'] = row[10]
+ app.config['JENKINS_ENABLED'] = row[37]
+ app.config['JENKINS_HOST'] = row[11]
+ app.config['JENKINS_KEY'] = row[12]
+ app.config['JENKINS_PROJECT'] = row[13]
+ app.config['JENKINS_STAGING_PROJECT'] = row[14]
+ app.config['JENKINS_TOKEN'] = row[15]
+ app.config['JENKINS_USER'] = row[16]
+ app.config['LDAP_BASE_DN'] = row[17]
+ app.config['LDAP_BIND_USER_DN'] = row[18]
+ app.config['LDAP_BIND_USER_PASSWORD'] = row[19]
+ app.config['LDAP_GROUP_DN'] = row[20]
+ app.config['LDAP_HOST'] = row[21]
+ app.config['LDAP_PORT'] = row[22]
+ app.config['LDAP_USER_DN'] = row[23]
+ app.config['LDAP_USER_LOGIN_ATTR'] = row[24]
+ app.config['LDAP_USER_RDN_ATTR'] = row[25]
+ app.config['PROD_DB_URI'] = row[26]
+ app.config['SMTP_ADMIN_EMAIL'] = row[27]
+ app.config['SMTP_HOST'] = row[28]
+ app.config['SMTP_PASSWORD'] = row[29]
+ app.config['SMTP_USER'] = row[30]
+ app.config['SNOW_ENABLED'] = row[38]
+ app.config['SNOW_CLIENT_ID'] = row[31]
+ app.config['SNOW_CLIENT_SECRET'] = row[32]
+ app.config['SNOW_INSTANCE_NAME'] = row[33]
+ app.config['SNOW_PASSWORD'] = row[34]
+ app.config['SNOW_USERNAME'] = row[35]
+ app.config['VERSION'] = row[36]
getPersistentConfig()
From 7dd90fa11418004ade7ff847c0665f491aa17906 Mon Sep 17 00:00:00 2001
From: bkaiserinfosec <49665796+bkaiserinfosec@users.noreply.github.com>
Date: Fri, 22 Mar 2024 11:19:14 -0700
Subject: [PATCH 51/51] Feature/jenkins updates (#523)
* Update security_quality_gate.py
* Update Jenkinsfile
* Update security_quality_gate.py
* update settings and groups
* add function for table updates
* updated function for db updates
* Update updates.py
* Update updates.py
* Update updates.py
* Update settings.py
* update to settings update without restart
* Update run.py
* Update pipeline-config.yaml
* Update __init__.py
* Update __init__.py
---
src/vr/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/vr/__init__.py b/src/vr/__init__.py
index 90fe1b09..e184511e 100644
--- a/src/vr/__init__.py
+++ b/src/vr/__init__.py
@@ -218,7 +218,7 @@ def getPersistentConfig():
sql = 'SELECT * FROM AppConfig WHERE 1=1'
cur.execute(sql)
row = cur.fetchone()
- if row[2]:
+ if row and row[2]:
app.config['APP_EXT_URL'] = row[3]
app.config['AUTH_TYPE'] = row[4]
app.config['AZAD_AUTHORITY'] = row[5]