security

package
v0.52.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 18 Imported by: 15

Documentation

Overview

Package security implements cryptographic certificates and auth token

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(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.

Jump to

Keyboard shortcuts

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