missing zlib #2435
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!2435
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2435/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: #1967
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/1967
Original created: 2025-11-20T05:44:48Z
Original updated: 2025-11-20T05:46:04Z
Original head: carverauto/serviceradar:chore/more_kong_crap
Original base: main
Original merged: 2025-11-20T05:45:04Z 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
Add zlib dependency detection and auto-installation
Support multiple package managers (apt-get, yum, dnf, apk)
Check for existing zlib headers before attempting install
Integrate zlib validation into Kong build process
Diagram Walkthrough
File Walkthrough
build-kong-vendor.sh
Add zlib dependency detection and installationscripts/build-kong-vendor.sh
ensure_zlib()function to detect and install zlibdevelopment files
ensure_zlibafter
ensure_ccImported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1967#issuecomment-3555967540
Original created: 2025-11-20T05:45:09Z
PR Compliance Guide 🔍
(Compliance updated until commit
github.com/carverauto/serviceradar@6b398671bd)Below is a summary of compliance checks for this PR:
Supply-chain risk
Description: The script installs packages via apt-get/yum/dnf without pinning versions or verifying
repository integrity, which can be exploited if package mirrors or repos are compromised
(supply-chain risk); consider pinning versions and verifying with checksums or using a
trusted, prebuilt base image.
build-kong-vendor.sh [147-169]
Referred Code
Privilege escalation risk
Description: Use of sudo for package installation inherits the caller’s environment and PATH,
potentially allowing PATH hijacking or misconfiguration to escalate privileges; invoke
sudo with an absolute path and sanitized PATH (e.g., /usr/bin/sudo env -i
PATH=/usr/sbin:/usr/bin ...) or avoid sudo in non-interactive build environments.
build-kong-vendor.sh [148-155]
Referred Code
Unpinned apk install
Description: The apk add command runs with --update and no repository pinning or signature verification
enforcement, increasing risk of fetching untrusted indexes or packages; prefer --no-cache
with pinned repositories and ensure signature verification is enabled.
build-kong-vendor.sh [171-174]
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 audit logs: The added package installation actions (detecting and installing zlib) are not logged to
an audit trail beyond console output, which may be insufficient for reconstructing events.
Referred Code
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation
Status:
Install failure handling: Package manager install commands redirect output to /dev/null and do not check command
exit codes, potentially causing silent failures without actionable context.
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 6b39867
Unverified package install
Description: The script auto-installs packages with apt-get/yum/dnf/apk without verifying package
authenticity (no checksum/pin), potentially allowing supply-chain attacks if repositories
are compromised or MITM occurs; consider pinning, verifying signatures, or requiring user
confirmation.
build-kong-vendor.sh [147-175]
Referred Code
Implicit privilege escalation
Description: Running package installs with sudo (if present) and otherwise as the current user may
escalate privileges or run unexpected commands in environments where PATH or sudo
configuration is untrusted; restrict execution context and avoid implicit sudo use.
build-kong-vendor.sh [149-155]
Referred Code
Insecure dependency resolution
Description: Reliance on /usr/include or /usr/local/include zlib.h presence to decide skipping
installation may allow header/library mismatches leading to linking against unintended
system libraries, which can be exploited in poisoned build environments; prefer pkg-config
with version checks and controlled paths.
build-kong-vendor.sh [142-145]
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:
Missing audit logs: The new zlib detection/installation steps do not produce structured or durable audit logs
of critical actions (e.g., package installation) beyond ephemeral console output.
Referred Code
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation
Status:
Silent install errors: Package manager commands are run with output suppressed and without checking individual
command exit codes, risking silent failures and limited error context.
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: The script emits human-readable console messages rather than structured logs, which may
hinder auditing and automated monitoring.
Referred Code
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1967#issuecomment-3555970973
Original created: 2025-11-20T05:46:04Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Avoid automatic system dependency installation
The build script should not automatically install system dependencies like
zlib.Instead, it should check if they are present and, if not, provide clear
installation instructions to the user.
Examples:
scripts/build-kong-vendor.sh [141-179]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 9
__
Why: This suggestion addresses a critical design flaw, as build scripts automatically installing system packages is a bad practice that can cause permission issues and unexpected side effects.
Use sudo for package installation
Use
sudoforyumanddnfpackage installations if available, consistent with theapt-getimplementation. Also, check the command exit codes to handle potentialinstallation failures.
scripts/build-kong-vendor.sh [159-169]
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly points out that
yumanddnfcommands will likely fail withoutsudofor non-root users, which is a significant correctness issue. The proposed change to addsudoand error checking makes the script more robust and reliable across different environments.Verify package installation was successful
Check the exit code after running
apt-get installto ensure the packageinstallation was successful. If it fails, exit the script with an error message
to prevent subsequent failures.
scripts/build-kong-vendor.sh [147-157]
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies that the script does not check the exit code of
apt-get install, which could lead to silent failures. Adding a check improves the script's robustness and provides clearer error feedback.