re-use bazel #2437
No reviewers
Labels
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar!2437
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2437/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from GitHub pull request.
Original GitHub pull request: #1969
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/1969
Original created: 2025-11-20T06:13:49Z
Original updated: 2025-11-20T06:14:58Z
Original head: carverauto/serviceradar:update/kong_missing_bzel
Original base: main
Original merged: 2025-11-20T06:14:16Z by @mfreeman451
User description
IMPORTANT: Please sign the Developer Certificate of Origin
Thank you for your contribution to ServiceRadar. Please note, when contributing, the developer must include
a DCO sign-off statement indicating the DCO acceptance in one commit message. Here
is an example DCO Signed-off-by line in a commit message:
Describe your changes
Issue ticket number and link
Code checklist before requesting a review
PR Type
Enhancement
Description
Improve bazel provisioning with multiple fallback strategies
Check for existing bazelisk/bazel in PATH before downloading
Add retry logic with exponential backoff for downloads
Refactor download logic into reusable function with error handling
Diagram Walkthrough
File Walkthrough
build-kong-vendor.sh
Refactor bazel provisioning with PATH lookup and retriesscripts/build-kong-vendor.sh
bazelisk/bazel before downloading
download_bazelisk()function withretry mechanism
for download failures
make check-bazela fallback option with error handling instead ofprimary method
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1969#issuecomment-3556079174
Original created: 2025-11-20T06:14:08Z
PR Compliance Guide 🔍
(Compliance updated until commit
github.com/carverauto/serviceradar@b4482b9a37)Below is a summary of compliance checks for this PR:
Untrusted PATH executable
Description: Symlinking
bazeliskorbazelfrom PATH into${KONG_CLONE_DIR}/bin/bazelwithout validatingthe target path or ownership can be abused if PATH is user-controlled or contains a
malicious executable, leading to execution of an attacker-supplied binary.
build-kong-vendor.sh [218-228]
Referred Code
Unsigned binary download
Description: Downloading
bazeliskover HTTPS without verifying the checksum or signature (only relyingon curl success) risks supply-chain attacks or tampering if the release asset is
compromised or MITM occurs.
build-kong-vendor.sh [243-251]
Referred Code
🎫 No ticket provided
Codebase context is not defined
Follow the guide to enable codebase context checks.
Generic: Meaningful Naming and Self-Documenting Code
Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting
Status: Passed
Generic: Secure Error Handling
Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.
Status: Passed
Generic: Secure Logging Practices
Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.
Status: Passed
Generic: Security-First Input Validation and Data Handling
Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities
Status: Passed
Generic: Comprehensive Audit Trails
Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.
Status:
Missing auditing: The new provisioning logic (checking PATH, symlinking, downloading with retries) performs
critical environment changes without emitting structured audit logs linking actions to a
user or outcome details.
Referred Code
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation
Status:
Retry fallback gaps: Download failures are retried but final failure after all attempts lacks contextual error
details (e.g., HTTP status) and make fallback errors are not surfaced, which may hinder
diagnostics.
Referred Code
Compliance status legend
🟢 - Fully Compliant🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label
Previous compliance checks
Compliance check up to commit b4482b9
No security concerns identified
No security vulnerabilities detected by AI analysis. Human verification advised for critical code.🎫 No ticket provided
Codebase context is not defined
Follow the guide to enable codebase context checks.
Generic: Meaningful Naming and Self-Documenting Code
Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting
Status: Passed
Generic: Secure Error Handling
Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.
Status: Passed
Generic: Secure Logging Practices
Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.
Status: Passed
Generic: Security-First Input Validation and Data Handling
Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities
Status: Passed
Generic: Comprehensive Audit Trails
Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.
Status:
No audit logs: The added provisioning logic performs system actions (downloads, symlinks) without
emitting structured audit entries identifying actor, timestamp, action, and outcome, which
may be required for critical operations in some environments.
Referred Code
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation
Status:
Retry limits result: Download retries with exponential backoff are added but failures from curl are not logged
with error detail and the function’s non-zero return is not explicitly checked before
proceeding to final executable check, making diagnosis of failure reasons harder.
Referred Code
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1969#issuecomment-3556081375
Original created: 2025-11-20T06:14:58Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Avoid using system
bazeldirectlyThe logic that symlinks to a system-installed
bazelshould be removed. Thischange bypasses
bazelisk, which is used to enforce a specific Bazel version andensure reproducible builds.
Examples:
scripts/build-kong-vendor.sh [223-229]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 9
__
Why: This suggestion correctly identifies a critical design flaw that undermines build reproducibility by bypassing the
bazeliskversion-enforcement mechanism, which is a core reason for usingbazelisk.Check function return value to fail-fast
Check the return value of the
download_bazeliskfunction and exit immediately onfailure to provide clearer error context and fail faster.
scripts/build-kong-vendor.sh [258-265]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies that the return code of the
download_bazeliskfunction is ignored. Checking the return code and exiting on failure is a good practice that improves script robustness and provides clearer error reporting.Refactor duplicate code into a single block
Refactor the duplicated code blocks that check for
bazeliskandbazelin thePATHinto a single, more concise block to improve maintainability.scripts/build-kong-vendor.sh [215-229]
Suggestion importance[1-10]: 5
__
Why: The suggestion correctly identifies duplicated code for handling
bazeliskandbazelfromPATHand proposes a valid refactoring that improves code conciseness and maintainability.