kms.go 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Package kms provides Key Management Services support
  2. package kms
  3. // SecretStatus defines the statuses of a Secret object
  4. type SecretStatus = string
  5. const (
  6. // SecretStatusPlain means the secret is in plain text and must be encrypted
  7. SecretStatusPlain SecretStatus = "Plain"
  8. // SecretStatusAES256GCM means the secret is encrypted using AES-256-GCM
  9. SecretStatusAES256GCM SecretStatus = "AES-256-GCM"
  10. // SecretStatusSecretBox means the secret is encrypted using a locally provided symmetric key
  11. SecretStatusSecretBox SecretStatus = "Secretbox"
  12. // SecretStatusGCP means we use keys from Google Cloud Platform’s Key Management Service
  13. // (GCP KMS) to keep information secret
  14. SecretStatusGCP SecretStatus = "GCP"
  15. // SecretStatusAWS means we use customer master keys from Amazon Web Service’s
  16. // Key Management Service (AWS KMS) to keep information secret
  17. SecretStatusAWS SecretStatus = "AWS"
  18. // SecretStatusVaultTransit means we use the transit secrets engine in Vault
  19. // to keep information secret
  20. SecretStatusVaultTransit SecretStatus = "VaultTransit"
  21. // SecretStatusAzureKeyVault means we use Azure KeyVault to keep information secret
  22. SecretStatusAzureKeyVault SecretStatus = "AzureKeyVault"
  23. // SecretStatusRedacted means the secret is redacted
  24. SecretStatusRedacted SecretStatus = "Redacted"
  25. )
  26. // Scheme defines the supported URL scheme
  27. type Scheme = string
  28. // supported URL schemes
  29. const (
  30. SchemeLocal Scheme = "local"
  31. SchemeBuiltin Scheme = "builtin"
  32. SchemeAWS Scheme = "awskms"
  33. SchemeGCP Scheme = "gcpkms"
  34. SchemeVaultTransit Scheme = "hashivault"
  35. SchemeAzureKeyVault Scheme = "azurekeyvault"
  36. )
  37. // BaseSecret defines the base struct shared among all the secret providers
  38. type BaseSecret struct {
  39. Status SecretStatus `json:"status,omitempty"`
  40. Payload string `json:"payload,omitempty"`
  41. Key string `json:"key,omitempty"`
  42. AdditionalData string `json:"additional_data,omitempty"`
  43. // 1 means encrypted using a master key
  44. Mode int `json:"mode,omitempty"`
  45. }