Skip to content

Harden the meshcentral chart - #64

Merged
viktor-flamingo merged 9 commits into
masterfrom
refactor/harden-docker-image
Aug 6, 2026
Merged

Harden the meshcentral chart#64
viktor-flamingo merged 9 commits into
masterfrom
refactor/harden-docker-image

Conversation

@viktor-flamingo

@viktor-flamingo viktor-flamingo commented Aug 5, 2026

Copy link
Copy Markdown

Read-only rootfs and non-root on the meshcentral containers.

Uploads and user files now go to the data volume.

Summary by CodeRabbit

  • Security

    • Strengthened container security with non-root execution, reduced privileges, read-only filesystems, and restrictive runtime settings.
    • Made pod and container security behavior configurable through deployment values.
  • Deployment

    • Improved temporary file handling and writable workspace support.
    • Added configurable Kubernetes service account support.
    • Updated MeshCentral file storage configuration for more reliable deployments.
  • Build and Release

    • Updated the container base image and streamlined runtime package handling.
    • Improved automated testing and releases with change-based multi-image workflows.
  • Documentation

    • Expanded MeshCentral setup, architecture, requirements, and integration guidance.

Read-only rootfs and non-root on both meshcentral containers (uid 1000)
and on wait-mongodb (uid 999, the mongo image's own user).

Uploads and user files have to move off the rootfs for that to work:
TMPDIR gets its own emptyDir, and --filespath points at the data volume.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: deabd463-c85d-4b04-960a-e545bf707be0

📥 Commits

Reviewing files that changed from the base of the PR and between 7b5964a and 027b6e3.

📒 Files selected for processing (1)
  • docker/Dockerfile
🚧 Files skipped from review as they are similar to previous changes (1)
  • docker/Dockerfile

📝 Walkthrough

Walkthrough

The pull request adds reusable dynamic change detection, matrix-based release and test workflows, hardened Docker and Helm runtime settings, service-account configuration, and updated MeshCentral documentation.

Changes

CI change routing

Layer / File(s) Summary
Change detection workflow
.github/workflows/changes.yaml
The reusable workflow exposes image, component, timestamp, and commit outputs. It generates path filters and publishes structured change data.
Release and test matrix consumers
.github/workflows/release.yml, .github/workflows/test.yml, .dockerignore
Release and test workflows use image matrices and component flags for conditional image and Helm jobs. .dockerignore excludes charts/.

Container and Helm runtime hardening

Layer / File(s) Summary
Container image runtime setup
docker/Dockerfile
The Dockerfile updates Alpine versions, runtime packages, directory ownership, and file-copy ownership.
Helm security contexts and writable storage
charts/meshcentral/values.yaml, charts/meshcentral/templates/*
Helm values define service-account and restrictive security settings. Deployment templates apply them, set TMPDIR, add the MeshCentral files path, and mount writable storage.

Project documentation

Layer / File(s) Summary
MeshCentral README
readme.md
The README documents MeshCentral features, architecture, installation, system requirements, OpenFrame integration, and contribution resources.

Estimated code review effort: 4 (Complex) | ~45 minutes

Suggested reviewers: ivan-flamingo

Sequence Diagram(s)

sequenceDiagram
  participant ReleaseTest as Release and test workflows
  participant Changes as changes.yaml
  participant Filter as dorny/paths-filter
  participant ImageBuild as Matrix image builds
  ReleaseTest->>Changes: Call reusable workflow
  Changes->>Filter: Evaluate generated component filters
  Filter-->>Changes: Return changed component flags
  Changes-->>ReleaseTest: Return images_matrix and changes
  ReleaseTest->>ImageBuild: Run changed matrix entries
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the pull request's primary change to harden the MeshCentral Helm chart.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/harden-docker-image

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/changes.yaml:
- Around line 50-57: Update the path filter in the workflow configuration so
plugin-only changes are included in the image build trigger. In the changes YAML
path list near the existing docker, translate, views, and public globs, add the
plugins glob using the same pattern style so changes under plugins/ are not
skipped by the test and release workflows.

In @.github/workflows/release.yml:
- Around line 179-183: Update the release header generation around IMAGES and
the Helm release reference to include only artifacts built in the current
release: filter images_matrix entries using needs.changes.outputs.changes, and
include the Helm release reference only when the corresponding Helm change flag
is enabled. Preserve the existing image formatting and version tagging for
included entries.

In `@charts/meshcentral/templates/deployment.yaml`:
- Around line 61-64: Update the meshcentral-init command arguments to include
--filespath /opt/mesh/meshcentral-files alongside the existing --datapath
argument, matching the main container configuration. Keep the existing init
behavior and securityContext unchanged.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 717760ff-7d48-4a9a-9d81-a4430c331f13

📥 Commits

Reviewing files that changed from the base of the PR and between cad646d and def24f1.

📒 Files selected for processing (8)
  • .dockerignore
  • .github/workflows/changes.yaml
  • .github/workflows/changes.yml
  • .github/workflows/release.yml
  • .github/workflows/test.yml
  • charts/meshcentral/templates/deployment.yaml
  • charts/meshcentral/values.yaml
  • docker/Dockerfile
💤 Files with no reviewable changes (1)
  • .github/workflows/changes.yml

Comment thread .github/workflows/changes.yaml
Comment thread .github/workflows/release.yml
Comment thread charts/meshcentral/templates/deployment.yaml
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@charts/meshcentral/templates/_helpers.tpl`:
- Around line 13-15: Update the default branch in the
meshcentral.serviceAccountName helper to derive the ServiceAccount name from the
Helm release identity rather than only .Chart.Name, ensuring separate releases
generate unique names. Preserve the existing .Values.serviceAccount.name
override when explicitly provided.

In `@readme.md`:
- Around line 99-105: The Option 1 installation command installs upstream
MeshCentral without the OpenFrame integration. Update the “Install via npm”
instructions to install the OpenFrame-aware scoped fork package or use a source
install from this repository, ensuring users receive the endpoints implemented
by plugins/openframe.js.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e2d10f6a-f500-43a0-ad6d-d19d513fcf10

📥 Commits

Reviewing files that changed from the base of the PR and between cad646d and 1f91168.

📒 Files selected for processing (11)
  • .dockerignore
  • .github/workflows/changes.yaml
  • .github/workflows/changes.yml
  • .github/workflows/release.yml
  • .github/workflows/test.yml
  • charts/meshcentral/templates/_helpers.tpl
  • charts/meshcentral/templates/deployment.yaml
  • charts/meshcentral/templates/sa.yaml
  • charts/meshcentral/values.yaml
  • docker/Dockerfile
  • readme.md
💤 Files with no reviewable changes (1)
  • .github/workflows/changes.yml
🚧 Files skipped from review as they are similar to previous changes (4)
  • .dockerignore
  • docker/Dockerfile
  • charts/meshcentral/templates/deployment.yaml
  • charts/meshcentral/values.yaml

Comment thread charts/meshcentral/templates/_helpers.tpl
Comment thread readme.md
@viktor-flamingo
viktor-flamingo merged commit 6f6c769 into master Aug 6, 2026
5 checks passed
@viktor-flamingo
viktor-flamingo deleted the refactor/harden-docker-image branch August 6, 2026 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants