Skip to content

fix(alerts): encrypt webhook secrets with the server Fernet key, as every other secret (backport 2.1 #37817) - #37860

Merged
manerow merged 1 commit into
2.1from
fix/webhook-secrets-one-server-key-2.1
Nov 16, 2026
Merged

manerow merged 1 commit into
2.1from
fix/webhook-secrets-one-server-key-2.1

Conversation

@manerow

@manerow manerow commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Cherry-pick of #37817 to 2.1. No linked issue, as for #37817.

The cherry-pick applied cleanly, and its patch is identical to the merged commit on main (same git patch-id). #36939, which this reverts to the server Fernet key, is in 2.1.0-rc2, so 2.1 needs the same change before 2.1.0 ships.

What it does, in short (the full description is in #37817):

  • Webhook secrets on alert destinations and on user and team profiles are encrypted with the server's Fernet keys again, like every other stored secret. The per-destination and per-profile key from fix(alerts): encrypt webhook secrets for the destination or profile webhook that holds them #36939 (BoundCiphertext) is removed.
  • The 2.1.0 steps are renamed encryptAlertDestinationSecrets and encryptProfileWebhookSecrets, so databases that ran 2.1.0-rc2 run them too. Credentials that releases before 2.1 encrypted stay as stored; every other value is encrypted as stored; a value rc2 wrote in its per-holder format is converted back. Each step runs once, in one transaction with its marker.
  • Two small fixes: listing alerts with fields=statusDetails returns each destination's status, and a statusDetails sent on create, PUT or PATCH is no longer stored.

Decision record: docs/decisions/2026-11-14-webhook-secrets-are-encrypted-with-the-server-fernet-key.md.

Type of change:

  • Bug fix

High-level design:

Same as #37817. No conflicts and no 2.1-specific changes.

Tests:

Run on this branch (2.1 + the cherry-pick):

Unit tests

  • StoredWebhookSecretsTest, DestinationSecretsTest, ProfileWebhookSecretsTest, DestinationValidationTest, AlertLimitsTest, AlertDiagnosticsStatusTest, IngestionPipelineMigrationEntryPointTest: 85 run, 0 failed.

Backend integration tests

  • WebhookSecretsIT, WebhookSecretsMigrationIT, ProfileWebhookSecretsIT, EventSubscriptionResourceIT on mysql-elasticsearch: 298 run, 0 failed, 38 skipped (the same counts as on main).

Not run: Postgres, and the full affected scope.

Playwright (UI) tests

  • Not applicable (no UI change).

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation> (no issue for this PR)
  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

RetriggerView in GreptileConfidence Score: 4/5

The earlier Java-guide finding must be addressed before merging; no new blocking behavior was found.

Findings

  1. P2 New code breaks Java requirements ▶

Summary

This backport returns webhook secrets to the server's Fernet keys.

  • Webhook secrets now use the server’s Fernet keys across alerts and profiles.
  • The 2.1 migration converts stored webhook secrets in one-time steps.
  • Alert lists show saved destination status, not status supplied on writes.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Stored webhook secret] --> B{Pre-release bound format?}
  B -->|Yes| C{Opens with its holder and configured keys?}
  C -->|Yes| D[Encrypt with server Fernet key]
  C -->|No| E[Keep stored value]
  B -->|No| F{Older encrypted credential?}
  F -->|Yes| E
  F -->|No| D
  D --> G[Commit changes and completion marker together]
  E --> G
Loading

Reviews (2) · Last reviewed commit: "fix(alerts): encrypt webhook secrets wit..." · Reviewed by Greptile

@manerow
manerow requested a review from a team as a code owner November 16, 2026 08:32
@manerow
manerow requested review from mohityadav766 and removed request for a team November 16, 2026 08:32
@manerow manerow added the skip-pr-checks Bypass PR metadata validation check label Nov 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@manerow
manerow merged commit bfeec97 into 2.1 Nov 16, 2026
54 of 56 checks passed
@manerow
manerow deleted the fix/webhook-secrets-one-server-key-2.1 branch November 16, 2026 08:33
Comment on lines +52 to +59
public static Map<UUID, Map<String, DestinationHealth>> healthOf(List<UUID> alertIds) {
Map<UUID, Map<String, DestinationHealth>> health = new HashMap<>();
for (List<UUID> chunk : Lists.partition(alertIds, HEALTH_READ_BATCH)) {
List<AlertExtension> rows =
dao()
.listAlertsExtensions(
chunk.stream().map(UUID::toString).toList(),
List.of(LedgerKeys.POSITION, LedgerKeys.HEALTH));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 New code breaks Java requirements

The repository's Java guide requires methods of about 15 lines, final on unchanged locals and parameters, and tests that assert results rather than internal calls. The new healthOf() exceeds that method limit and introduces unchanged variables without final. The new status test also mocks AlertRecord statically and checks its internal calls.

Split the health read into focused helpers, apply final, and keep the status assertions without checking internal calls. These repository requirements must be satisfied before merging.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant