bazel updates for rh9 build targets/RBE platform #2534
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!2534
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2534/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: #2093
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/2093
Original created: 2025-12-09T19:18:42Z
Original updated: 2025-12-10T04:51:44Z
Original head: carverauto/serviceradar:chore/alma9_sysmon_issues
Original base: main
Original merged: 2025-12-10T04:46:44Z 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, Tests
Description
Add EL9 (Enterprise Linux 9) Bazel build configuration for RHEL/AlmaLinux/Rocky/Oracle Linux 9 compatibility
Create GitHub Actions workflow for building and pushing RBE executor Docker image
Define new
rbe_linux_el9platform with Oracle Linux 9 RBE executor containerRefactor sysmon Dockerfile to use separate musl and Rocky 9 build stages for universal binary compatibility
Diagram Walkthrough
File Walkthrough
.bazelrc
Add EL9 Bazel build configuration.bazelrc
el9build configuration for EL9-compatible buildsrbe_linux_el9build-rbe-image-el9.yml
New workflow for EL9 RBE executor image.github/workflows/build-rbe-image-el9.yml
image
docker/Dockerfile.rbe-ora9on main branch andPRs
BUILD.bazel
Define rbe_linux_el9 platform for EL9 buildsbuild/platforms/BUILD.bazel
rbe_linux_el9platform definition for Oracle Linux 9architecture, and pool
Dockerfile.rpm.sysmon
Refactor sysmon build with musl and Rocky 9 stagesdocker/rpm/Dockerfile.rpm.sysmon
musl-builderstage using Alpine Rust forstatic universal binaries
zfs-builderstage using Rocky Linux 9 for ZFS-enabledEL9-compatible binaries
Linux distro
EL9 binary
verification steps
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2093#issuecomment-3633892209
Original created: 2025-12-09T19:19:16Z
PR Compliance Guide 🔍
Below is a summary of compliance checks for this PR:
CI secrets misuse
Description: The workflow logs into GHCR using
${{ secrets.GHCR_TOKEN != '' && secrets.GHCR_TOKEN ||secrets.GITHUB_TOKEN }}, which may push images on non-default branches and exposesregistry write access during PR-triggered runs; this increases supply-chain risk because
forked PRs cannot access repo secrets and defaulting to
GITHUB_TOKENcan still enableunintended publishing if branch protections or environment restrictions are misconfigured.
build-rbe-image-el9.yml [38-40]
Referred Code
Host network in RBE
Description: The RBE platform sets
exec_propertieswithdockerNetwork: "host", which disables containernetwork isolation and can allow the remote build executor to access host network services,
increasing risk of lateral movement or data exfiltration if build steps are compromised.
BUILD.bazel [100-105]
Referred Code
Unsigned downloads
Description: The Dockerfile downloads and executes the Rust installer and protoc via curl without
pinning checksums or signatures, making the build supply-chain vulnerable to MITM or
tampered artifacts.
Dockerfile.rpm.sysmon [44-51]
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: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation
Status:
Network install errors: Package installation and curl-based downloads lack explicit retry/backoff or failure
handling, which may cause flaky builds without clear remediation.
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:
Secret handling: The workflow references registry credentials and a ghcr_token secret; while masked by
GitHub, ensure no steps echo these values to logs and validate least-privilege tokens.
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:
Unpinned downloads: The Dockerfile downloads toolchains and protoc via curl without checksums or signature
verification, which lacks integrity validation for external inputs.
Referred Code
Compliance status legend
🟢 - Fully Compliant🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/2093#issuecomment-3633896001
Original created: 2025-12-09T19:20:28Z
PR Code Suggestions ✨
Explore these optional code suggestions:
✅
Decouple RBE image version from codeSuggestion Impact:
The workflow now defines a VERSION variable and generates multiple dynamic tags (including branch, PR, SHA, and latest on main) instead of a single hardcoded v1.0.20 tag. Although it still uses VERSION=v1.0.20 as the primary tag, it adds dynamic tagging, partially addressing the suggestion in the workflow. No Bazel platform changes are shown in this diff.code diff:
The RBE executor image version is hardcoded in the GitHub workflow and Bazel
platform definition, creating a maintenance issue. It should be replaced with a
dynamic approach, like using a
latesttag or image digests, to avoid manualupdates in multiple files.
Examples:
.github/workflows/build-rbe-image-el9.yml [50]
build/platforms/BUILD.bazel [100]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly identifies that hardcoding the RBE image version
v1.0.20in both the Bazel platform and the GitHub workflow creates a significant maintenance burden and risk of build inconsistencies.✅
Avoid using a hardcoded mutable tagSuggestion Impact:
The workflow removed the docker/metadata-action block that included the hardcoded tag entry and replaced it with a custom tag generation step. Although a VERSION env var (v1.0.20) was introduced, the specific hardcoded tag within the metadata extraction was eliminated per the suggestion.code diff:
Remove the hardcoded Docker tag
v1.0.20from the metadata extraction step. Usinga mutable, hardcoded tag is a bad practice that harms build reproducibility,
especially since it is referenced elsewhere in the codebase.
.github/workflows/build-rbe-image-el9.yml [41-51]
[Suggestion processed]Suggestion importance[1-10]: 8
__
Why: This suggestion correctly identifies a critical issue with build reproducibility. Using a hardcoded, mutable tag (
v1.0.20) that is also referenced in the Bazel build configuration (build/platforms/BUILD.bazel) can lead to inconsistent and non-reproducible builds. This is a significant architectural flaw that should be addressed.Simplify container registry login credentials
Simplify the
docker/login-actionstep by removing the complex conditional logicfor credentials. Instead, directly use
github.actorfor the username andsecrets.GITHUB_TOKENfor the password, which is standard for GHCR..github/workflows/build-rbe-image-el9.yml [34-39]
Suggestion importance[1-10]: 5
__
Why: The suggestion correctly identifies that the login logic can be simplified, improving readability and maintainability. While the original code offers more flexibility by allowing overrides via secrets, the proposed change aligns with the common and recommended practice for GHCR authentication in GitHub Actions.
Remove rustup installer after use
In the
zfs-builderstage, remove therustupinstallation files after installingRust to reduce the Docker layer size. This can be done by adding
&& rm -rf/root/.rustupto the sameRUNcommand that installs Rust.docker/rpm/Dockerfile.rpm.sysmon [43-45]
Suggestion importance[1-10]: 4
__
Why: The suggestion proposes a valid optimization to reduce the Docker image layer size by cleaning up the
rustupinstallation files. This is a good practice for creating leaner builder images, although its impact is minor as it only affects an intermediate build stage.