CLI-871 Add MDM deployment scripts as public reference#601
CLI-871 Add MDM deployment scripts as public reference#601kirill-knize-sonarsource wants to merge 1 commit into
Conversation
✅ Deploy Preview for sonarqube-cli canceled.
|
| verify_sha256() { | ||
| local binary="$1" version="$2" | ||
| local platform os base url expected actual | ||
| platform="$(cdn_platform)" | ||
| os="$(cdn_os)" | ||
| if [[ -z "$platform" || -z "$os" ]]; then | ||
| echo "Warning: unsupported platform — skipping SHA256 check." >&2 | ||
| return | ||
| fi | ||
| base="sonarqube-cli-${version}-${platform}" | ||
| url="${ARTIFACT_BASE_URL}/${version}/${os}/${base}.bin.sha256" | ||
| expected="$(curl -fsSL --proto "$HTTPS_ONLY" --proto-redir "$HTTPS_ONLY" "$url" 2>/dev/null | awk '{print $1}')" | ||
| if [[ -z "$expected" ]]; then | ||
| echo "Error: could not fetch SHA256 from $url — aborting." >&2 | ||
| exit 1 |
There was a problem hiding this comment.
💡 Security: SHA256 fetched from same origin as binary gives no supply-chain protection
verify_sha256 / Test-BinarySha256 download the .sha256 file from the same artifact host as the binary itself over the same channel. This only guards against transport corruption; an attacker who can tamper with (or MITM) the artifact server can replace both the binary and its published hash, so the check provides no integrity guarantee against a compromised source. Consider verifying a detached signature against a pinned public key, or pinning the expected hash out-of-band, rather than trusting a hash served alongside the artifact.
Was this helpful? React with 👍 / 👎
853fd39 to
7dc58db
Compare
Mirrors the JumpCloud install/update/rollback/remove scripts for macOS, Linux, and Windows, so the customer-facing MDM deployment guide can link to a reviewable source instead of internal tooling.
7dc58db to
e46b229
Compare
Code Review 👍 Approved with suggestions 3 resolved / 4 findingsIntroduces automated MDM deployment scripts with binary lifecycle management and integrity verification. Consider fetching SHA256 checksums from an independent source to improve supply-chain security. 💡 Security: SHA256 fetched from same origin as binary gives no supply-chain protection📄 mdm-scripts/linux/install.sh:42-56 📄 mdm-scripts/windows/install.ps1:34-48 verify_sha256 / Test-BinarySha256 download the ✅ 3 resolved✅ Bug: Machine PATH update bakes in expanded env vars, corrupting PATH
✅ Bug: update.ps1 version check never matches, re-downloads every run
✅ Edge Case: remove.sh loop can delete unrelated binaries named 'sonar'
🤖 Prompt for agentsOptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|



Summary by Gitar
Linux,macOS, andWindowsto automatesonarqube-cliinstallation via MDM.install.sh/install.ps1,update.sh/update.ps1,rollback.sh/rollback.ps1, andremove.sh/remove.ps1for managing binary distribution.PATH.SHA256checksum verification during download to ensure integrity of fetched binaries.This will update automatically on new commits.