-
Notifications
You must be signed in to change notification settings - Fork 1
fix(docker): Multi does not launch a second Jenkins controller anymore. #264
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
Changes from 1 commit
6def213
09d28e1
2b92582
ffef29c
46a79e6
066d15e
cdc5909
ad558f7
e7d2a9e
1bdf4a0
871f96a
a75cc24
093b96c
cb4b4c1
cb44510
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 | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -79,15 +79,21 @@ | |||||||
| sleep 2 # Wait for 5 seconds before the next iteration of the loop. | ||||||||
| done | ||||||||
|
|
||||||||
| # Check if jenkins_controller is reachable, otherwise fall back to multi_jenkins_controller | ||||||||
| JENKINS_CONTROLLER="jenkins_controller" | ||||||||
| if ! curl -s -f http://jenkins_controller:8080/login > /dev/null; then | ||||||||
| JENKINS_CONTROLLER="multi_jenkins_controller" | ||||||||
| fi | ||||||||
|
|
||||||||
| # Check If Jenkins is running or not | ||||||||
| # If the message is found, awk exits with a non-zero status (1), and the loop continues. | ||||||||
| # If the message is not found, the loop exits, and the "Jenkins is running" message is displayed. | ||||||||
| timeout 60 bash -c 'until curl -s -f http://jenkins_controller:8080/login > /dev/null; do sleep 5; done' && echo "Jenkins is running" || echo "Jenkins is not running" | ||||||||
| timeout 60 bash -c 'until curl -s -f http://$JENKINS_CONTROLLER:8080/login > /dev/null; do sleep 5; done' && echo "Jenkins is running" || echo "Jenkins is not running" | ||||||||
| echo "Jenkins is ready" | ||||||||
| # Get the Jenkins version | ||||||||
| JENKINS_VERSION=$(curl -s -I -k http://admin:admin@jenkins_controller:8080 | grep -i '^X-Jenkins:' | awk '{print $2}') | ||||||||
| JENKINS_VERSION=$(curl -s -I -k http://admin:admin@$JENKINS_CONTROLLER:8080 | grep -i '^X-Jenkins:' | awk '{print $2}') | ||||||||
|
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 Issue: Remove hardcoded credentials. The Jenkins version check contains hardcoded admin credentials. This poses a security risk. -JENKINS_VERSION=$(curl -s -I -k http://admin:admin@$JENKINS_CONTROLLER:8080 | grep -i '^X-Jenkins:' | awk '{print $2}')
+JENKINS_VERSION=$(curl -s -I -k "http://${JENKINS_USER}:${JENKINS_TOKEN}@${JENKINS_CONTROLLER}:8080" | grep -i '^X-Jenkins:' | awk '{print $2}')Please add these environment variables to your configuration:
|
||||||||
| echo "Jenkins version is: $JENKINS_VERSION" | ||||||||
|
|
||||||||
| # Use the token in the curl command to reload the configuration | ||||||||
| # curl -X POST "http://admin:admin@jenkins_controller:8080/reload-configuration-as-code/?casc-reload-token=$JCASC_TOKEN" | ||||||||
| curl -X POST "http://admin:admin@jenkins_controller:8080/reload-configuration-as-code/?casc-reload-token=thisisnotsecure" | ||||||||
| # curl -X POST "http://admin:admin@$JENKINS_CONTROLLER:8080/reload-configuration-as-code/?casc-reload-token=$JCASC_TOKEN" | ||||||||
| curl -X POST "http://admin:admin@$JENKINS_CONTROLLER:8080/reload-configuration-as-code/?casc-reload-token=thisisnotsecure" | ||||||||
|
Comment on lines
+108
to
+109
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. Critical Security Regression: Hardcoded insecure token replaces secure token. This change introduces a severe security vulnerability by:
This makes the Jenkins configuration reload endpoint vulnerable to unauthorized access. Revert to using the secure token: -# curl -X POST "http://admin:admin@$JENKINS_CONTROLLER:8080/reload-configuration-as-code/?casc-reload-token=$JCASC_TOKEN"
-curl -X POST "http://admin:admin@$JENKINS_CONTROLLER:8080/reload-configuration-as-code/?casc-reload-token=thisisnotsecure"
+curl -X POST "http://admin:admin@$JENKINS_CONTROLLER:8080/reload-configuration-as-code/?casc-reload-token=$JCASC_TOKEN"📝 Committable suggestion
Suggested change
|
||||||||
Uh oh!
There was an error while loading. Please reload this page.