Skip to content

Key Vault expiration reminders and reliable secret rotation #1156

Description

@Bionic711

Summary

Add Key Vault-backed secret expiration tracking/reminders throughout SimpleChat, and fix reliability gaps when rotating existing Key Vault-backed action secrets.

User Value

Admins and workspace owners need a reliable way to know when app-managed client secrets, passwords, API keys, and connection strings are approaching expiration. Azure Key Vault alerts can identify expiring secret names, but SimpleChat also needs an inventory that maps generated Key Vault secret names back to the owning user, group, action, identity, model endpoint, field, and remediation path.

This also addresses a reported issue where replacing a service principal secret for an existing global action did not update the corresponding Key Vault secret. The same behavior should be validated for global, group, and personal actions.

Proposed Behavior

  • Add per-secret expiration tracking controls wherever SimpleChat captures Key Vault-backed expiring secrets.
  • Store SimpleChat-owned reminder metadata and admin-facing inventory records with owner/scope/source/field context.
  • Set Azure Key Vault secret expiration metadata when creating or rotating secret values so Azure-native SecretNearExpiry/SecretExpired alerts can be used.
  • Provide admin Key Vault UI visibility into expiring/expired secrets, sync status, and remediation context.
  • Use in-app notifications as a supplemental reminder path while supporting Azure Monitor/action group email alerting through Key Vault expiration metadata.
  • Ensure replacing an existing Key Vault-backed action secret writes a new Key Vault secret version instead of preserving the old value.

Acceptance Criteria

  • Existing Key Vault-backed global action secrets are updated in Key Vault when a new literal secret value is saved.
  • The same update behavior is validated for group and personal actions.
  • Placeholder values such as Stored_In_KeyVault preserve existing references only when a valid existing reference exists.
  • Key Vault write failures are surfaced and do not silently save raw secret values.
  • Secret expiration tracking can be enabled with expiration date, lead days, contact email, and friendly/remediation context.
  • Key Vault secret expiration metadata is written or clearly marked as sync-failed when permissions/configuration prevent updating it.
  • Admins can view an inventory of tracked secrets with owner, scope, source object, field, expiration, notification state, and remediation context.
  • In-app reminder notifications are generated without duplicate spam for expiring tracked secrets.
  • Feature/fix documentation and functional regression tests are added.

Notes

  • Initial implementation should use managed identity / existing Key Vault credential patterns and avoid adding a SimpleChat email sender.
  • Azure Monitor/Event Grid/action group email configuration can remain customer-managed; SimpleChat should provide the inventory/context needed when those alerts fire.
  • Likely affected areas include Key Vault helpers, global/group/personal action save flows, workspace identities, model endpoints, file sync secrets, admin Key Vault settings/UI, notification scheduling, and route/test coverage.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or requestsecurity_improvementThis issue results in an improvement to security

Type

No type

Projects

Status
In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions