Skip to content

Commit

Permalink
Add audit entries for vulnerabilities and add missing file for deploy…
Browse files Browse the repository at this point in the history
… key audit entries
  • Loading branch information
christeredvartsen committed Nov 14, 2024
1 parent 79cb854 commit 9d039e0
Show file tree
Hide file tree
Showing 5 changed files with 704 additions and 86 deletions.
28 changes: 28 additions & 0 deletions internal/deployment/audit.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package deployment

import (
"fmt"

"github.com/nais/api/internal/audit"
)

const (
auditResourceTypeDeployKey audit.AuditResourceType = "DEPLOY_KEY"
)

func init() {
audit.RegisterTransformer(auditResourceTypeDeployKey, func(entry audit.GenericAuditEntry) (audit.AuditEntry, error) {
switch entry.Action {
case audit.AuditActionUpdated:
return TeamDeployKeyUpdatedAuditEntry{
GenericAuditEntry: entry.WithMessage("Updated deployment key"),
}, nil
default:
return nil, fmt.Errorf("unsupported deploy key audit entry action: %q", entry.Action)
}
})
}

type TeamDeployKeyUpdatedAuditEntry struct {
audit.GenericAuditEntry
}
Loading

0 comments on commit 9d039e0

Please sign in to comment.