Skip to content

Add stable pseudonymous telemetry identifiers#140

Merged
de1987 merged 1 commit intomainfrom
telemetry-pseudo-ids
Mar 30, 2026
Merged

Add stable pseudonymous telemetry identifiers#140
de1987 merged 1 commit intomainfrom
telemetry-pseudo-ids

Conversation

@de1987
Copy link
Copy Markdown
Contributor

@de1987 de1987 commented Mar 26, 2026

Description

Replaces the volatile user_unique_id (which changed on every server restart) with three new stable, privacy-preserving telemetry fields:

  • user_pseudo_id: HMAC-SHA-256 of the user's ansible_id from the /api/gateway/v1/me/ endpoint. Stable across restarts. Falls back to literal "anonymous" when ansible_id is unavailable.
  • installer_pseudo_id: HMAC-SHA-256 of the INSTALLER_ID env var (injected by the Operator or Containerized installer). Defaults to "unknown" when not set.
  • user_type: "internal" or "external" based on email domain matching against INTERNAL_EMAIL_DOMAINS (defaults to redhat.com,ibm.com,ansible.com).

All pseudonymous identifiers use HMAC-SHA-256 with a persistent secret key (TELEMETRY_HMAC_KEY), making brute-force reversal infeasible. No PII is transmitted in any telemetry event.

@de1987 de1987 self-assigned this Mar 26, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 26, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 85.98% 761 / 885
🔵 Statements 85.52% 786 / 919
🟢 Functions 90.81% (🎯 70%) 168 / 185
🟢 Branches 75.84% (🎯 70%) 405 / 534
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/analytics-validation-plugin.ts 96.29% 96.47% 100% 96.29% 139-144, 172-176
src/analytics.ts 77.96% 72.72% 66.66% 76.78% 46, 58-59, 65-66, 78-79, 98, 137, 184, 222, 254, 274
src/index.ts 80% 58.62% 91.83% 79.82% 39, 103-106, 132-134, 146-153, 190, 206, 215, 244-247, 282-285, 311, 334, 344, 375, 383, 387, 401-402, 413, 425-428, 458-461, 533-538, 544-548, 555-567, 582, 587-591, 610-620, 643-645, 666-679, 768-769, 803, 863-889, 893-894
src/pseudo-identity.ts 100% 100% 100% 100%
src/session.ts 95.12% 85.18% 100% 96.29% 76, 181, 190, 199
Generated in workflow #394 for commit 2b13a43 by the Vitest Coverage Report Action

@de1987 de1987 requested a review from shanemcd March 26, 2026 21:17
@de1987
Copy link
Copy Markdown
Contributor Author

de1987 commented Mar 26, 2026

#141
this PR will fix the audit check

@de1987 de1987 force-pushed the telemetry-pseudo-ids branch 2 times, most recently from 01dff15 to 63d80b1 Compare March 26, 2026 22:05
@omaciel
Copy link
Copy Markdown
Contributor

omaciel commented Mar 26, 2026

Rebase

@de1987 de1987 force-pushed the telemetry-pseudo-ids branch from 63d80b1 to 8e679d4 Compare March 26, 2026 22:14
Comment thread src/pseudo-identity.ts Outdated
Comment thread src/pseudo-identity.ts Outdated
Copy link
Copy Markdown
Contributor

@TamiTakamiya TamiTakamiya left a comment

Choose a reason for hiding this comment

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

While I left two comments, they are minor and I think it is good overall. Thanks!

@de1987 de1987 force-pushed the telemetry-pseudo-ids branch 2 times, most recently from ddcc626 to 5c19fed Compare March 30, 2026 16:21
Copy link
Copy Markdown
Member

@mabashian mabashian left a comment

Choose a reason for hiding this comment

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

lgtm

@de1987 de1987 force-pushed the telemetry-pseudo-ids branch from 5c19fed to 2b13a43 Compare March 30, 2026 19:30
@de1987 de1987 enabled auto-merge (squash) March 30, 2026 19:37
@de1987 de1987 merged commit ff8da0f into main Mar 30, 2026
8 checks passed
@de1987 de1987 deleted the telemetry-pseudo-ids branch March 30, 2026 19:40
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.

5 participants