keyreminder

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package keyreminder sends a scheduled notice when encryption keys are older than the operator's maximum key age policy.

Index

Constants

View Source
const DefaultInterval = 6 * time.Hour

DefaultInterval is how often the policy is checked, not how often a notice goes out.

Variables

This section is empty.

Functions

func NoticeText

func NoticeText(maxDays int, masterOverdue bool, apps []string) string

NoticeText is the plain-text reminder: names and counts, never key material.

Types

type Channels

type Channels interface {
	ListNotificationChannels(ctx context.Context) ([]alerting.NotificationChannel, error)
}

Channels lists notification channels. *alerting.DB satisfies it.

type Notifier

type Notifier interface {
	SendNotice(ctx context.Context, c alerting.NotificationChannel, text string) error
}

Notifier sends one plain-text notice. *alerting.DeployDispatcher satisfies it.

type Reminder

type Reminder struct {
	Source   Source
	Channels Channels
	Notifier Notifier
	Logger   *slog.Logger
	Now      func() time.Time
}

Reminder notifies about keys past the policy's maximum age.

func (*Reminder) Run

func (r *Reminder) Run(ctx context.Context, interval time.Duration) error

Run ticks until ctx is done.

func (*Reminder) Tick

func (r *Reminder) Tick(ctx context.Context) error

Tick sends one notice when something is overdue and the last notice is older than the policy's repeat interval. It stays unmarked when no channel accepted it, so the next tick retries.

type Source

type Source interface {
	GetSecretKeyPolicy(ctx context.Context) (store.SecretKeyPolicy, error)
	MarkSecretKeyReminded(ctx context.Context, at time.Time) error
	ListServiceDEKStatus(ctx context.Context) ([]store.ServiceDEKStatus, error)
	GetMasterKeyRotatedAt(ctx context.Context) (time.Time, bool, error)
}

Source is the store surface the reminder reads. *store.DB satisfies it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL