Documentation
¶
Index ¶
- Variables
- func EncryptDecrypt(rawStr string, decrypt, strip bool, wrapper wrapping.Wrapper) (string, error)
- func GetAEADKMSFunc(opts *wrapping.WrapperOptions, kms *KMS) (wrapping.Wrapper, map[string]string, error)
- func GetAliCloudKMSFunc(opts *wrapping.WrapperOptions, kms *KMS) (wrapping.Wrapper, map[string]string, error)
- func GetAzureKeyVaultKMSFunc(opts *wrapping.WrapperOptions, kms *KMS) (wrapping.Wrapper, map[string]string, error)
- func GetGCPCKMSKMSFunc(opts *wrapping.WrapperOptions, kms *KMS) (wrapping.Wrapper, map[string]string, error)
- func GetOCIKMSKMSFunc(opts *wrapping.WrapperOptions, kms *KMS) (wrapping.Wrapper, map[string]string, error)
- func ParseEntropy(result *SharedConfig, list *ast.ObjectList, blockName string) error
- type EntSharedConfig
- type Entropy
- type EntropyMode
- type KMS
- type SharedConfig
Constants ¶
This section is empty.
Variables ¶
var ( ParseTelemetry = func(*ast.ObjectList) (interface{}, error) { return nil, nil } SanitizeTelemetry = func(interface{}) map[string]interface{} { return nil } )
These two functions are overridden if metricsutil is invoked, but keep this module from needing to depend on metricsutil and its various deps otherwise. Import the metricsutil module, e.g.
_ "github.com/hashicorp/shared-secure-libs/metricsutil"
in order to have telemetry be parsed.
var ( ConfigureWrapper = configureWrapper CreateSecureRandomReaderFunc = createSecureRandomReader )
var GetAWSKMSFunc = func(opts *wrapping.WrapperOptions, kms *KMS) (wrapping.Wrapper, map[string]string, error) { wrapper := awskms.NewWrapper(opts) wrapperInfo, err := wrapper.SetConfig(kms.Config) if err != nil { return nil, nil, err } info := make(map[string]string) if wrapperInfo != nil { info["AWS KMS Region"] = wrapperInfo["region"] info["AWS KMS KeyID"] = wrapperInfo["kms_key_id"] if endpoint, ok := wrapperInfo["endpoint"]; ok { info["AWS KMS Endpoint"] = endpoint } } return wrapper, info, nil }
var GetTransitKMSFunc = func(opts *wrapping.WrapperOptions, kms *KMS) (wrapping.Wrapper, map[string]string, error) { wrapper := transit.NewWrapper(opts) wrapperInfo, err := wrapper.SetConfig(kms.Config) if err != nil { return nil, nil, err } info := make(map[string]string) if wrapperInfo != nil { info["Transit Address"] = wrapperInfo["address"] info["Transit Mount Path"] = wrapperInfo["mount_path"] info["Transit Key Name"] = wrapperInfo["key_name"] if namespace, ok := wrapperInfo["namespace"]; ok { info["Transit Namespace"] = namespace } } return wrapper, info, nil }
Functions ¶
func EncryptDecrypt ¶
func GetAEADKMSFunc ¶
func GetAliCloudKMSFunc ¶
func GetAzureKeyVaultKMSFunc ¶
func GetGCPCKMSKMSFunc ¶
func GetOCIKMSKMSFunc ¶
func ParseEntropy ¶
func ParseEntropy(result *SharedConfig, list *ast.ObjectList, blockName string) error
Types ¶
type EntSharedConfig ¶
type EntSharedConfig struct { }
func (*EntSharedConfig) ParseConfig ¶
func (ec *EntSharedConfig) ParseConfig(list *ast.ObjectList) error
type Entropy ¶
type Entropy struct {
Mode EntropyMode
}
type EntropyMode ¶
type EntropyMode int
Entropy contains Entropy configuration for the server
const ( EntropyUnknown EntropyMode = iota EntropyAugmentation )
type KMS ¶
type KMS struct { Type string // Purpose can be used to allow a string-based specification of what this // KMS is designated for, in situations where we want to allow more than // one KMS to be specified Purpose []string `hcl:"-"` Disabled bool Config map[string]string }
KMS contains KMS configuration for the server
func LoadConfigKMSes ¶
func ParseKMSes ¶
type SharedConfig ¶
type SharedConfig struct { // LogFormat specifies the log format. Valid values are "standard" and // "json". The values are case-insenstive. If no log format is specified, // then standard format will be used. }
SharedConfig contains some shared values
func LoadConfigFile ¶
func LoadConfigFile(path string) (*SharedConfig, error)
LoadConfigFile loads the configuration from the given file.
func ParseConfig ¶
func ParseConfig(d string) (*SharedConfig, error)
func (*SharedConfig) Merge ¶
func (c *SharedConfig) Merge(c2 *SharedConfig) *SharedConfig
func (*SharedConfig) Sanitized ¶
func (c *SharedConfig) Sanitized() map[string]interface{}
Sanitized returns a copy of the config with all values that are considered sensitive stripped. It also strips all `*Raw` values that are mainly used for parsing.
Specifically, the fields that this method strips are: - KMS.Config - Telemetry.CirconusAPIToken