Skip to content

feat(license): support configurable machine fingerprint for containers#5427

Merged
markphelps merged 2 commits into
v2from
feat/configurable-machine-fingerprint
Feb 25, 2026
Merged

feat(license): support configurable machine fingerprint for containers#5427
markphelps merged 2 commits into
v2from
feat/configurable-machine-fingerprint

Conversation

@markphelps

@markphelps markphelps commented Feb 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a license.machine_id config option (and corresponding FLIPT_LICENSE_MACHINE_ID env var) that overrides the auto-detected machine fingerprint
  • Fixes license validation failures in containerd-based Kubernetes environments (GKE, EKS, Fargate, Cloud Run) where the machineid library cannot detect a machine ID
  • Logs when the override is used for visibility

Changes

  • internal/config/license.go: Added MachineID field to LicenseConfig
  • internal/coss/license/license.go: Added ProtectedMachineID helper (HMAC-SHA256, matching machineid.ProtectedID behavior); updated NewManager to use configured machine ID with info log
  • cmd/flipt/license.go: Updated CLI license wizard to respect configured machine ID
  • config/flipt.schema.{cue,json}: Added machine_id to license schema
  • internal/coss/license/license_test.go: Added tests for ProtectedMachineID and configured fingerprinter

Security Note

This does not introduce a new way to circumvent license seat counting. The configured value is still HMAC-SHA256 hashed with the app ID before being sent to Keygen, preserving the same fingerprint protection as auto-detection. A user who wanted to bypass seat limits could already do so via the existing workaround of mounting the same /etc/machine-id file across containers, or by patching the binary. This change simply removes a blocker for legitimate deployments on containerd-based runtimes where auto-detection fails.

Usage

license:
  key: "..."
  machine_id: "any-stable-identifier"

Or via environment variable:

FLIPT_LICENSE_MACHINE_ID=any-stable-identifier

Fixes #5426

Add a `license.machine_id` config option (and corresponding
FLIPT_LICENSE_MACHINE_ID env var) that overrides the auto-detected
machine fingerprint. This fixes license validation failures in
containerd-based Kubernetes environments (GKE, EKS) where the
machineid library cannot detect a machine ID.

Fixes #5426

Signed-off-by: Mark Phelps <[email protected]>
@markphelps
markphelps requested a review from a team as a code owner February 25, 2026 16:10
@markphelps markphelps added the v2 Flipt v2 label Feb 25, 2026
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 25, 2026
@dosubot

dosubot Bot commented Feb 25, 2026

Copy link
Copy Markdown

Related Documentation

Checked 4 published document(s) in 1 knowledge base(s). No updates required.

How did I do? Any feedback?  Join Discord

@codecov

codecov Bot commented Feb 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.40%. Comparing base (2048b01) to head (a41ed2c).
⚠️ Report is 1 commits behind head on v2.

Files with missing lines Patch % Lines
cmd/flipt/license.go 0.00% 8 Missing ⚠️
internal/coss/license/license.go 60.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##               v2    #5427      +/-   ##
==========================================
+ Coverage   60.38%   60.40%   +0.01%     
==========================================
  Files         140      140              
  Lines       13892    13906      +14     
==========================================
+ Hits         8389     8400      +11     
- Misses       4788     4791       +3     
  Partials      715      715              
Flag Coverage Δ
integrationtests 34.23% <11.11%> (+0.04%) ⬆️
unittests 51.75% <22.22%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@markphelps
markphelps merged commit 2917a74 into v2 Feb 25, 2026
61 of 64 checks passed
@markphelps
markphelps deleted the feat/configurable-machine-fingerprint branch February 25, 2026 17:20
@github-project-automation github-project-automation Bot moved this to Done in Flipt V2 Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files. v2 Flipt v2

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

feat: support configurable machine fingerprint for license validation in containers

2 participants