From 87abbe9396fb063afa03675d265b29a195360210 Mon Sep 17 00:00:00 2001 From: James Houlahan Date: Thu, 19 Jan 2023 18:02:07 +0100 Subject: [PATCH] Other: Report corrupt and/or insecure vaults to sentry --- internal/app/app.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/internal/app/app.go b/internal/app/app.go index 0b62a154..92289afa 100644 --- a/internal/app/app.go +++ b/internal/app/app.go @@ -206,6 +206,16 @@ func run(c *cli.Context) error { //nolint:funlen return withSingleInstance(locations, version, func() error { // Unlock the encrypted vault. return WithVault(locations, func(vault *vault.Vault, insecure, corrupt bool) error { + // Report insecure vault. + if insecure { + _ = reporter.ReportMessageWithContext("Vault is insecure", map[string]interface{}{}) + } + + // Report corrupt vault. + if corrupt { + _ = reporter.ReportMessageWithContext("Vault is corrupt", map[string]interface{}{}) + } + if !vault.Migrated() { // Migrate old settings into the vault. if err := migrateOldSettings(vault); err != nil {