Documentation
¶
Overview ¶
Package security implements cryptographic certificates and auth token
Index ¶
- func CertTemplate() (*x509.Certificate, error)
- func CreateOrFetchToken(config configModel.Reader) (string, error)
- func CreateOrGetClusterAgentAuthToken(config configModel.Reader) (string, error)
- func FetchAuthToken(config configModel.Reader) (string, error)
- func GenerateKeyPair(bits int) (*rsa.PrivateKey, error)
- func GenerateRootCert(hosts []string, bits int) (cert *x509.Certificate, certPEM []byte, rootKey *rsa.PrivateKey, err error)
- func GetAuthTokenFilepath(config configModel.Reader) string
- func GetClusterAgentAuthToken(config configModel.Reader) (string, error)
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(config configModel.Reader) (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(config configModel.Reader) (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 FetchAuthToken ¶
func FetchAuthToken(config configModel.Reader) (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(config configModel.Reader) string
GetAuthTokenFilepath returns the path to the auth_token file.
func GetClusterAgentAuthToken ¶
func GetClusterAgentAuthToken(config configModel.Reader) (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.