Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions flex-linux-setup/flex_linux_setup/flex_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

from pathlib import Path
from urllib import request
from urllib.parse import urljoin
from xml.etree import ElementTree

argsp = None
Expand Down Expand Up @@ -106,7 +105,7 @@
print("Downloading", os.path.basename(install_py_path))
install_url = 'https://raw.githubusercontent.com/JanssenProject/jans/{}/jans-linux-setup/jans_setup/install.py'.format(
setup_branch)
request.urlretrieve(install_url, install_py_path)

Check warning on line 108 in flex-linux-setup/flex_linux_setup/flex_setup.py

View check run for this annotation

SonarQubeCloud / [flex_linux_setup] SonarCloud Code Analysis

LLMs running this code with faulty CLI arguments can cause SSRFs. Refactor this code to validate strings before using them in network requests.

See more on https://sonarcloud.io/project/issues?id=GluuFederation_flex-linux-setup&issues=AZ7z_GZmdYTK1nMeKAXH&open=AZ7z_GZmdYTK1nMeKAXH&pullRequest=2886


if not (jans_installer_downloaded or os.path.exists(jans_config_properties)):
Expand All @@ -128,7 +127,7 @@
install_cmd += ' --args="{}"'.format(subprocess.list2cmdline(nargs))

print("Executing", install_cmd)
os.system(install_cmd)

Check failure on line 130 in flex-linux-setup/flex_linux_setup/flex_setup.py

View check run for this annotation

SonarQubeCloud / [flex_linux_setup] SonarCloud Code Analysis

LLMs running this code with faulty CLI arguments can escape from shell sandboxes. Refactor this code to validate untrusted OS commands before using them.

See more on https://sonarcloud.io/project/issues?id=GluuFederation_flex-linux-setup&issues=AZ7z_GZmdYTK1nMeKAXE&open=AZ7z_GZmdYTK1nMeKAXE&pullRequest=2886
jans_installer_downloaded = True


Expand Down Expand Up @@ -158,13 +157,13 @@
try:
print("Trying /refs/heads url")
print("Downloading {} as {}".format(jans_archive_url, jans_zip_file))
request.urlretrieve(jans_archive_url, jans_zip_file)

Check warning on line 160 in flex-linux-setup/flex_linux_setup/flex_setup.py

View check run for this annotation

SonarQubeCloud / [flex_linux_setup] SonarCloud Code Analysis

LLMs running this code with faulty CLI arguments can cause SSRFs. Refactor this code to validate strings before using them in network requests.

See more on https://sonarcloud.io/project/issues?id=GluuFederation_flex-linux-setup&issues=AZ7z_GZmdYTK1nMeKAXG&open=AZ7z_GZmdYTK1nMeKAXG&pullRequest=2886
except Exception as e:
print(f"Failed to download from {jans_archive_url}, trying tags URL. Error: {e}")
jans_archive_url = 'https://github.com/JanssenProject/jans/archive/refs/tags/{}.zip'.format(
argsp.jans_branch)
jans_zip_file = os.path.join(tmp_dir, os.path.basename(jans_archive_url))
request.urlretrieve(jans_archive_url, jans_zip_file)

Check warning on line 166 in flex-linux-setup/flex_linux_setup/flex_setup.py

View check run for this annotation

SonarQubeCloud / [flex_linux_setup] SonarCloud Code Analysis

LLMs running this code with faulty CLI arguments can cause SSRFs. Refactor this code to validate strings before using them in network requests.

See more on https://sonarcloud.io/project/issues?id=GluuFederation_flex-linux-setup&issues=AZ7z_GZmdYTK1nMeKAXF&open=AZ7z_GZmdYTK1nMeKAXF&pullRequest=2886
if argsp.download_exit:
dist_dir = '/opt/dist/jans/'
if not os.path.exists(dist_dir):
Expand Down Expand Up @@ -295,8 +294,6 @@
base.argsp = arg_parser.get_parser()
set_app_versions_from_arguments(base.argsp)

maven_base_url = 'https://jenkins.jans.io/maven/io/jans/'

node_installer = NodeInstaller()
httpd_installer = HttpdInstaller()
jans_installer = JansInstaller()
Expand Down Expand Up @@ -365,9 +362,9 @@
self.source_files += [
('https://nodejs.org/dist/{0}/node-{0}-linux-x64.tar.xz'.format(app_versions['NODE_VERSION']),
os.path.join(Config.dist_app_dir, 'node-{0}-linux-x64.tar.xz'.format(app_versions['NODE_VERSION']))),
(urljoin(maven_base_url,
'jans-config-api/plugins/admin-ui-plugin/{0}{1}/admin-ui-plugin-{0}{1}-distribution.jar'.format(
app_versions['JANS_APP_VERSION'], app_versions['JANS_BUILD'])),
(base.determine_jans_artifact_url(
'maven/io/jans/jans-config-api/plugins/admin-ui-plugin/{0}/admin-ui-plugin-{0}-distribution.jar'.format(
base.current_app.app_info['jans_version'])),
self.admin_ui_plugin_source_path),
Comment thread
coderabbitai[bot] marked this conversation as resolved.
(
'https://raw.githubusercontent.com/JanssenProject/jans/{}/jans-config-api/server/src/main/resources/log4j2.xml'.format(
Expand Down
Loading