security

package
v0.0.0-...-c4caace Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertTemplate

func CertTemplate() (*x509.Certificate, error)

CertTemplate create x509 certificate template

func CreateOrFetchToken

func CreateOrFetchToken() (string, error)

CreateOrFetchToken gets the authentication token from the auth token file & creates one if it doesn't exist Requires that the config has been set up before calling

func CreateOrGetClusterAgentAuthToken

func CreateOrGetClusterAgentAuthToken() (string, error)

CreateOrGetClusterAgentAuthToken load the authentication token from: 1st. the configuration value of "cluster_agent.auth_token" in datadog.yaml 2nd. from the filesystem If using the token from the filesystem, the token file must be next to the datadog.yaml with the filename: cluster_agent.auth_token, if such file does not exist it will be created and populated with a newly generated token.

func DeleteAuthToken

func DeleteAuthToken() error

DeleteAuthToken removes auth_token file (test clean up)

func FetchAuthToken

func FetchAuthToken() (string, error)

FetchAuthToken gets the authentication token from the auth token file & creates one if it doesn't exist Requires that the config has been set up before calling

func GenerateKeyPair

func GenerateKeyPair(bits int) (*rsa.PrivateKey, error)

GenerateKeyPair create a public/private keypair

func GenerateRootCert

func GenerateRootCert(hosts []string, bits int) (
	cert *x509.Certificate, certPEM []byte, rootKey *rsa.PrivateKey, err error)

GenerateRootCert generates a root certificate

func GetAuthTokenFilepath

func GetAuthTokenFilepath() string

GetAuthTokenFilepath returns the path to the auth_token file.

func GetClusterAgentAuthToken

func GetClusterAgentAuthToken() (string, error)

GetClusterAgentAuthToken load the authentication token from: 1st. the configuration value of "cluster_agent.auth_token" in datadog.yaml 2nd. from the filesystem If using the token from the filesystem, the token file must be next to the datadog.yaml with the filename: cluster_agent.auth_token, it will fail if the file does not exist

Types

This section is empty.

Jump to

Keyboard shortcuts

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