fixing kong build #2433
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!2433
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2433/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: #1965
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/1965
Original created: 2025-11-20T04:47:18Z
Original updated: 2025-12-08T06:54:44Z
Original head: carverauto/serviceradar:chore/fix_1_0_54_rel
Original base: main
Original merged: 2025-11-20T04:47:37Z 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
Bug fix, Enhancement
Description
Add C compiler detection and installation logic to Kong build script
Automatically resolve missing gcc/clang by checking environment and installing build-essential
Ensure CC environment variable is properly set before Kong compilation
Call new ensure_cc function in main build pipeline
Diagram Walkthrough
File Walkthrough
build-kong-vendor.sh
Add C compiler detection and auto-installation logicscripts/build-kong-vendor.sh
ensure_cc()function to detect and configure C compilerauto-installs build-essential if needed
ensure_cccall into main build pipeline afterensure_cloneImported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1965#issuecomment-3555771129
Original created: 2025-11-20T04:47:37Z
PR Compliance Guide 🔍
(Compliance updated until commit
github.com/carverauto/serviceradar@803b06a893)Below is a summary of compliance checks for this PR:
Insecure package install
Description: Unconditional package installation with apt-get (including sudo) based solely on PATH
checks can be abused if PATH is compromised or if running in an unintended environment;
restrict PATH, use absolute paths (/usr/bin/apt-get, /usr/bin/sudo), and validate
non-interactive, trusted environment before installing packages.
build-kong-vendor.sh [79-87]
Referred Code
Untrusted compiler path
Description: Trusting CC environment variable or first gcc/clang found on PATH without validation may
allow use of a malicious compiler if PATH or CC is attacker-influenced; consider
whitelisting known locations, checking file ownership/permissions, or hashing binaries.
build-kong-vendor.sh [60-76]
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: Comprehensive Audit Trails
Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.
Status:
Missing audit logs: Newly added compiler detection/installation steps perform critical system actions (package
installation) without emitting structured audit logs tying actions to a user or including
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:
Limited error context: The failure path prints a generic message and exits without capturing command failures
(e.g., apt-get install failing) or logging actionable context like return codes.
Referred Code
Generic: Security-First Input Validation and Data Handling
Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities
Status:
Package install risk: Auto-installing build-essential via apt-get without verification or user confirmation may
introduce supply-chain risks and lacks validation of environment and package integrity.
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 803b06a
Unverified package install
Description: Installing packages non-interactively via apt-get without verifying sources or pinning
versions could be abused in compromised environments (e.g., poisoned mirrors or tampered
PATH/sudo), leading to supply-chain risk; consider validating environment, using trusted
repos, and minimizing privilege usage.
build-kong-vendor.sh [79-87]
Referred Code
PATH hijack risk
Description: Trusting CC from the environment or first gcc/clang found in PATH without validation can
allow PATH hijacking to execute a malicious compiler binary; validate that CC resolves to
an expected absolute path and resides in trusted directories.
build-kong-vendor.sh [60-76]
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: 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 auditing: The new compiler detection/installation flow performs system actions (package
installation) without emitting structured audit logs capturing user, timestamp, action,
and outcome.
Referred Code
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation
Status:
Limited errors: Failure to install or detect a compiler results in a generic exit without capturing
actionable context (e.g., which step failed, apt-get exit code) for debugging.
Referred Code
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:
Unstructured logs: Newly added informational messages are plain text written to stderr and not structured,
which may hinder auditing and log parsing.
Referred Code
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1965#issuecomment-3555772824
Original created: 2025-11-20T04:48:30Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Avoid automatic system package installation
The build script should not automatically install system packages like
build-essential. Instead, it should verify dependencies and fail with a clearerror message if they are missing, leaving installation to the user or a
provisioning system.
Examples:
scripts/build-kong-vendor.sh [79-93]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 9
__
Why: This suggestion correctly identifies a major design flaw, as build scripts should not have side effects like installing system packages, which harms portability and violates the principle of separation of concerns.
Improve package installation error handling
Refactor the
build-essentialinstallation logic to improve error handling byremoving command duplication, checking for
sudoor root privileges, andvalidating the exit status of
apt-getto provide clearer error messages onfailure.
scripts/build-kong-vendor.sh [81-87]
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly identifies that redirecting
apt-getoutput to/dev/nullhides installation errors and proposes a robust solution that checks forsudoor root privileges and validates the command's exit status, significantly improving error handling and user feedback.