appsec

package
v1.34.0-rc.3 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(*Config)

Start AppSec when enabled is enabled by both using the appsec build tag and setting the environment variable DD_APPSEC_ENABLED to true.

func Status

func Status() string

Status returns the AppSec status string: "enabled" when both the appsec build tag is enabled and the env var DD_APPSEC_ENABLED is set to true, or "disabled" otherwise.

func Stop

func Stop()

Stop AppSec.

Types

type APIError

type APIError struct {
	Response *http.Response
}

APIError is the generic request error returned when the request status code is unknown.

func (APIError) Error

func (e APIError) Error() string

Error return the error string representation.

type AuthTokenError

type AuthTokenError APIError

AuthTokenError is a request error returned when the request could not be authenticated.

func (AuthTokenError) Error

func (e AuthTokenError) Error() string

Error return the error string representation.

type Config

type Config struct {
	// Client is the HTTP client to use to perform HTTP requests to the agent. This value is mandatory.
	Client *http.Client
	// AgentURL is the datadog agent URL the API client should use.
	AgentURL string
	// ServiceConfig is the information about the running service we currently protect.
	Service ServiceConfig
	// Tags is the list of tags that should be added to security events (eg. pid, os name, etc.).
	Tags map[string]interface{}
	// Hostname of the machine we run in.
	Hostname string
	// Version of the Go client library
	Version string

	// MaxBatchLen is the maximum batch length the event batching loop should use. The event batch is sent when
	// this length is reached. Defaults to 1024.
	MaxBatchLen int
	// MaxBatchStaleTime is the maximum amount of time events are kept in the batch. This allows to send the batch
	// after this amount of time even if the maximum batch length is not reached yet. Defaults to 1 second.
	MaxBatchStaleTime time.Duration
	// contains filtered or unexported fields
}

Config is the AppSec configuration.

type InvalidSignalError

type InvalidSignalError APIError

InvalidSignalError is a request error returned when one or more signal(s) sent are invalid.

func (InvalidSignalError) Error

func (e InvalidSignalError) Error() string

Error return the error string representation.

type ServiceConfig

type ServiceConfig struct {
	// Name of the service.
	Name string
	// Version of the service.
	Version string
	// Environment of the service (eg. dev, staging, prod, etc.)
	Environment string
}

ServiceConfig is the optional context about the running service.

Directories

Path Synopsis
instrumentation/httpinstr
Package httpinstr defines the HTTP operation that can be listened to using dyngo's operation instrumentation.
Package httpinstr defines the HTTP operation that can be listened to using dyngo's operation instrumentation.
waf
include
Package include is required to help go tools support vendoring.
Package include is required to help go tools support vendoring.
lib/darwin-amd64
Package vendor is required to help go tools support vendoring.
Package vendor is required to help go tools support vendoring.
lib/linux-amd64
Package vendor is required to help go tools support vendoring.
Package vendor is required to help go tools support vendoring.

Jump to

Keyboard shortcuts

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