-
Notifications
You must be signed in to change notification settings - Fork 4
RORDEV-1629 reproduction #86
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 all commits
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 |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| -----BEGIN CERTIFICATE----- | ||
| MIICyTCCAbGgAwIBAgIJAPBXGOZLL6X6MA0GCSqGSIb3DQEBCwUAMBQxEjAQBgNV | ||
| BAMMCWxvY2FsaG9zdDAeFw0yNTEwMTEwNDMzMDdaFw0yODAxMTQwNDMzMDdaMBQx | ||
| EjAQBgNVBAMMCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC | ||
| ggEBALZAVV3iMJc/3R7E1Cn4WnPHYBDFSqP6rznKuS56pfk2MACX+X6jdsrTTZMn | ||
| I8gQWwnPIPm2m6CFAoEqI17u+qGUTmZS0Ph9qmWLFPR18zyX+bpLLmoNBzRjZJce | ||
| 3EULVqdzRSvXq/aSnNn0VbBk6PA3Wmf8pduiYmMKST4ZYz9lxAP1iWa6GmqLi8ZU | ||
| EWbRaiTdfsyME/HrYLjdhUrTHO0hHPEIsHCrHJYH3J9PJqL6BJXuTOEiZKyQJBxX | ||
| bzh8KAemOU1gNdm0x19PDJ9n4GthiSDON0uBEETIswMETywsdFBDBf/npWYyFsSY | ||
| wIKEVTDsgYTgg10yvCMcSWZaFLUCAwEAAaMeMBwwGgYDVR0RBBMwEYIJbG9jYWxo | ||
| b3N0hwR/AAABMA0GCSqGSIb3DQEBCwUAA4IBAQAfA5Inuxr32WkWda03CXayL1Uf | ||
| CVii5BAdniEjAUm67My9qxSNaffUQr6kCnyWFWRzwbaYdSrBJSEyxzPoyTKR7FRh | ||
| ELYtKmedfBMMYA1skAqBolTjHdz8nULIV3OerSyLtAdSHwbGpjBKwmrY/RmB7bFe | ||
| p9kNUwQU9mVRrgJ6xt/1Ms0k0d6etPBguFYEhVdyT1M6Gj608KP2gvkP4hjsTP8Q | ||
| Lxm0nVg6A7wiwFPmbanO3BfisfngxMHs3DdK68Oiy1HrJqxY46D+qnkbpleyCyOd | ||
| nK8xg3WoRlhvzNvWK/FGxYXqwZGcJi3TySBKlvQpngjOc7EimHVsuho0jSao | ||
| -----END CERTIFICATE----- |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| -----BEGIN PRIVATE KEY----- | ||
| MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC2QFVd4jCXP90e | ||
| xNQp+Fpzx2AQxUqj+q85yrkueqX5NjAAl/l+o3bK002TJyPIEFsJzyD5tpughQKB | ||
| KiNe7vqhlE5mUtD4faplixT0dfM8l/m6Sy5qDQc0Y2SXHtxFC1anc0Ur16v2kpzZ | ||
| 9FWwZOjwN1pn/KXbomJjCkk+GWM/ZcQD9Ylmuhpqi4vGVBFm0Wok3X7MjBPx62C4 | ||
| 3YVK0xztIRzxCLBwqxyWB9yfTyai+gSV7kzhImSskCQcV284fCgHpjlNYDXZtMdf | ||
| TwyfZ+BrYYkgzjdLgRBEyLMDBE8sLHRQQwX/56VmMhbEmMCChFUw7IGE4INdMrwj | ||
| HElmWhS1AgMBAAECggEAAaVzH/X7GmKpTK3afMaRipoyc/RUSEbrbko2ggT5mtay | ||
| eE7nIg239P0TplCkMhpzuBL26UqM/VY2P5Rx3VmrSepdCu+Uk6oO7/vhpJOsLs/w | ||
| oY4sTSjw97guIG9W7gi8L6cK6Op50zBf2lgqrf07XXAikO3nUaSV3u8o2jbAfsIY | ||
| pjT/XLWsYF3XYXfH8RMRKv+tQNhCAch2Un/tug3N1tXSTcbjGwIay97Ytj8pYPcd | ||
| +1hZay9t5MXa5CAVOusrwbfShQ+sXpWenH13DqvvQX8GA/zd8bA3UV5oaDvQpw3v | ||
| HTLMr7EiFsAExc7vPr6E8X8hLfju2BdKTu0i8z7fwQKBgQDw9eyfui3jSI2EE08H | ||
| wLvLT6pZSrJ2TIQd75c9mdL04YkCwxTMCufvZwYj7PG0srRdNNlO1UTxEQNoAJ03 | ||
| U2C1qjjOQG9X71+Fj1+mtv8V8KllpZFxiItySZOpLYJe4GbqXkef/dMG+/JZ6KwY | ||
| gJuEQeiXc+LBFAYWrx9goXoQRwKBgQDBoFmIEidr3020+JJEFvIOXzZ/OkcV2Do+ | ||
| C8K4/wqUvectYVRgHlH2tTcXW+7ngVrdqnPMFeBxylxymnD7yUIS2GuV6WXeqzPg | ||
| CPuzr8OiE634qmxemj3UpbRFO3ctU00/8SeOcbnnHTrBQhrnSBC8K4Y3bXutFhba | ||
| Hb3T2NfNIwKBgQCqPxdQQ1romvphtsK/14zXuRHCxOQScT1naUCSZXyHSFJlgS/Q | ||
| emQk4cWU3HRqF1kYAZ8H8+ch68NcWBK8ZEyQDhTUpPIGTzpOQ15xjBnuhnspNjHs | ||
| 5Wyg8xtBDMZwAly0eqhgghX3eUth+uKc7UDz0R1k5JvxjxQ+Mr0YqP51QQKBgCVm | ||
| hsS81PaGPKlPNlmGoRzbkVhD9oUmriFb/jHjubR/dg8S9MxYLvbbjBer/1qiZt3Y | ||
| VeO++gqgzvioEljgSC4Btc5QNggrw6prscrEkaJV8M3OhX5EhtrzYv3Yfa24oHxQ | ||
| ZZajKwiUYcwAq9eu2OSv943vTOtjD+jzw74O7ahHAoGAS3T27W6SkloZi9t+SFSY | ||
| BeINYvV3ciRNGN48k00v28+5sFJ7uaqkxkd+t8RGn7nGaA7n+nJNXexyiJzVVKjS | ||
| zL5WaQuduTDJHpW5HbAQp3bMpCrYhI6YL9EzXEedWkLaTh+Ox9yVc3nDBNx0lGw3 | ||
| yRdF/RqO80s0HbQhbJMtcMQ= | ||
| -----END PRIVATE KEY----- | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #!/bin/bash | ||
| # Script to set Elasticsearch disk watermarks dynamically | ||
|
|
||
| ES_URL="https://localhost:29200" | ||
| AUTH="elastic:elastic" | ||
|
|
||
| # Set transient disk watermarks | ||
| curl -k -u $AUTH -X PUT "$ES_URL/_cluster/settings" \ | ||
|
Comment on lines
+5
to
+8
Contributor
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 issue: Hardcoded credentials and insecure TLS verification. This script contains multiple security vulnerabilities that must be addressed before use:
Refactor to use environment variables and proper credential handling: -#!/bin/bash
-# Script to set Elasticsearch disk watermarks dynamically
-
-ES_URL="https://localhost:29200"
-AUTH="elastic:elastic"
-
-# Set transient disk watermarks
-curl -k -u $AUTH -X PUT "$ES_URL/_cluster/settings" \
+#!/bin/bash
+# Script to set Elasticsearch disk watermarks dynamically
+
+# Use environment variables for configuration
+ES_URL="${ES_URL:-https://localhost:9200}"
+ES_USERNAME="${ES_USERNAME:-elastic}"
+ES_PASSWORD="${ES_PASSWORD}"
+
+if [ -z "$ES_PASSWORD" ]; then
+ echo "Error: ES_PASSWORD environment variable is not set" >&2
+ exit 1
+fi
+
+# Set transient disk watermarks
+# Use --user for secure credential passing and verify SSL certificates
+curl -u "${ES_USERNAME}:${ES_PASSWORD}" -X PUT "$ES_URL/_cluster/settings" \
-H "Content-Type: application/json" \
-d '{
"transient": {
"cluster.routing.allocation.disk.watermark.low": "5%",
"cluster.routing.allocation.disk.watermark.high": "10%",
"cluster.routing.allocation.disk.watermark.flood_stage": "15%"
}
}'
+
+if [ $? -ne 0 ]; then
+ echo "Error: Failed to update Elasticsearch disk watermarks" >&2
+ exit 1
+fi
+
+echo "Successfully updated Elasticsearch disk watermarks"Alternatively, consider using a
🤖 Prompt for AI Agents |
||
| -H "Content-Type: application/json" \ | ||
| -d '{ | ||
| "transient": { | ||
| "cluster.routing.allocation.disk.watermark.low": "5%", | ||
| "cluster.routing.allocation.disk.watermark.high": "10%", | ||
| "cluster.routing.allocation.disk.watermark.flood_stage": "15%" | ||
| } | ||
| }' | ||
|
Comment on lines
+8
to
+16
Contributor
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. Add error handling and input validation. The script lacks error checking and does not validate whether the API call succeeded, potentially masking failures silently. Apply this diff to add error handling: # Set transient disk watermarks
-curl -k -u $AUTH -X PUT "$ES_URL/_cluster/settings" \
+RESPONSE=$(curl -s -w "\n%{http_code}" -u "${ES_USERNAME}:${ES_PASSWORD}" \
+ -X PUT "$ES_URL/_cluster/settings" \
-H "Content-Type: application/json" \
-d '{
"transient": {
"cluster.routing.allocation.disk.watermark.low": "5%",
"cluster.routing.allocation.disk.watermark.high": "10%",
"cluster.routing.allocation.disk.watermark.flood_stage": "15%"
}
- }'
+ }')
+
+HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
+BODY=$(echo "$RESPONSE" | head -n-1)
+
+if [ "$HTTP_CODE" != "200" ]; then
+ echo "Error: API request failed with HTTP $HTTP_CODE" >&2
+ echo "Response: $BODY" >&2
+ exit 1
+fi
+
+echo "Successfully updated disk watermarks: $BODY"
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🚨 Critical: Remove private key from version control immediately.
Committing private keys to any repository—even demo environments—is a critical security vulnerability. Once exposed in version control (especially public repositories), the key is compromised and should be rotated.
Actions required:
Remove this file from the repository:
Add certificate/key files to
.gitignore:Generate the private key locally during deployment (e.g., via a setup script):
Document the local generation process in setup instructions.
If this key was ever used in production, rotate it immediately.
Verify that the related certificate file (
server.crt) is also not committed to the repository, or if it is, that it doesn't contain sensitive data.🏁 Script executed:
Length of output: 533
🚨 Critical: Remove private key and certificate from version control immediately.
Committing private keys to any repository—even demo environments—is a critical security vulnerability. Once exposed in version control (especially public repositories), the key is compromised and must be rotated. The related certificate file is also present.
Actions required:
Remove both files from the repository:
Add certificate/key files to
.gitignore:Generate the key and certificate locally during deployment:
Document the local generation process in setup instructions.
If this key was ever used in production, rotate it immediately.
🧰 Tools
🪛 Gitleaks (8.29.0)
[high] 1-28: Identified a Private Key, which may compromise cryptographic security and sensitive data encryption.
(private-key)
🤖 Prompt for AI Agents