Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new config Datadog.Host for using the Datadog EU site #59

Merged
merged 1 commit into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ falcosidekick
config.yaml
.env
.vscode
.idea
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

# 2.12.3 - 2020-04-21
#### Enhancement
- Allow using Datadog EU site by specifying new configuration *datadog.host*.

## 2.12.2 - 2020-04-21
#### Fix
- Typo in query to Datadog ([PR#58](https://github.com/falcosecurity/falcosidekick/pull/58) thanks to [@DrPhil](https://github.com/DrPhil))
Expand Down Expand Up @@ -178,4 +182,4 @@
- Fix cert errors in alpine ([PR#1](https://github.com/falcosecurity/falcosidekick/pull/1) thanks to [@palmerabollo](https://github.com/palmerabollo))

## 1.0.0 - 2018-10-10
- First tagged release
- First tagged release
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ teams:
minimumpriority: "debug" # minimum priority of event for using this output, order is emergency|alert|critical|error|warning|notice|informational|debug or "" (default)

datadog:
#apikey: "" # Datadog API Key, if not empty, Datadog output is enabled
# apikey: "" # Datadog API Key, if not empty, Datadog output is enabled
# host: "" # Datadog host. Override if you are on the Datadog EU site. Defaults to american site with "https://api.datadoghq.com"
# minimumpriority: "" # minimum priority of event for using this output, order is emergency|alert|critical|error|warning|notice|informational|debug or "" (default)

alertmanager:
Expand Down Expand Up @@ -200,6 +201,7 @@ The *env vars* "match" field names in *yaml file with this structure (**take car
* **TEAMS_OUTPUTFORMAT** : `all` (default), `text` (only text is displayed in Teams), `facts` (only facts are displayed in Teams)
* **TEAMS_MINIMUMPRIORITY** : minimum priority of event for using use this output, order is `emergency|alert|critical|error|warning|notice|informational|debug or "" (default)`
* **DATADOG_APIKEY** : Datadog API Key, if not `empty`, Datadog output is *enabled*
* **DATADOG_HOST** : Datadog host. Override if you are on the Datadog EU site. Defaults to american site with "https://api.datadoghq.com"
* **DATADOG_MINIMUMPRIORITY** : minimum priority of event for using this output, order is `emergency|alert|critical|error|warning|notice|informational|debug or "" (default)`
* **ALERTMANAGER_HOSTPORT** : AlertManager http://host:port, if not `empty`, AlertManager is *enabled*
* **ALERTMANAGER_MINIMUMPRIORITY** : minimum priority of event for using this output, order is `emergency|alert|critical|error|warning|notice|informational|debug or "" (default)`
Expand Down Expand Up @@ -245,7 +247,7 @@ The *env vars* "match" field names in *yaml file with this structure (**take car
#### Slack Message Formatting

The `SLACK_MESSAGEFORMAT` environment variable and `slack.messageformat` YAML value accept a [Go template](https://golang.org/pkg/text/template/) which can be used to format the text of a slack alert. These templates are evaluated on the JSON data from each Falco event - the following fields are available:

| Template Syntax | Description |
|----------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `{{ .Output }}` | A formatted string from Falco describing the event. |
Expand Down
1 change: 1 addition & 0 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func getConfig() *types.Configuration {
v.SetDefault("Teams.OutputFormat", "all")
v.SetDefault("Teams.MinimumPriority", "")
v.SetDefault("Datadog.APIKey", "")
v.SetDefault("Datadog.Host", "https://api.datadoghq.com")
v.SetDefault("Datadog.MinimumPriority", "")
v.SetDefault("Alertmanager.HostPort", "")
v.SetDefault("Alertmanager.MinimumPriority", "")
Expand Down
12 changes: 4 additions & 8 deletions config_example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ teams:
minimumpriority: "debug" # minimum priority of event for using this output, order is emergency|alert|critical|error|warning|notice|informational|debug or "" (default)

datadog:
#apikey: "" # Datadog API Key, if not empty, Datadog output is enabled
# apikey: "" # Datadog API Key, if not empty, Datadog output is enabled
# host: "" # Datadog host. Override if you are on the Datadog EU site. Defaults to american site with "https://api.datadoghq.com"
# minimumpriority: "" # minimum priority of event for using this output, order is emergency|alert|critical|error|warning|notice|informational|debug or "" (default)

alertmanager:
Expand All @@ -32,7 +33,7 @@ elasticsearch:
# index: "falco" # index (default: falco)
# type: "event"
# minimumpriority: "" # minimum priority of event for using this output, order is emergency|alert|critical|error|warning|notice|informational|debug or "" (default)
# suffix: "daily" # date suffix for index rotation : daily (default), monthly, annually, none
# suffix: "daily" # date suffix for index rotation : daily (default), monthly, annually, none

influxdb:
# hostport: "" # http://{domain or ip}:{port}, if not empty, Influxdb output is enabled
Expand Down Expand Up @@ -69,11 +70,6 @@ smtp:
# outputformat: "" # html (default), text
# minimumpriority: "" # minimum priority of event for using this output, order is emergency|alert|critical|error|warning|notice|informational|debug or "" (default)

opsgenie:
# apikey: "" # Opsgenie API Key, if not empty, Opsgenie output is enabled
# region: "eu" # (us|eu) region of your domain
# minimumpriority: "" # minimum priority of event for using this output, order is emergency|alert|critical|error|warning|notice|informational|debug or "" (default)

statsd:
forwarder: "" # The address for the StatsD forwarder, in the form "host:port", if not empty StatsD is enabled
namespace: "falcosidekick." # A prefix for all metrics (default: "falcosidekick.")
Expand All @@ -91,4 +87,4 @@ opsgenie:

webhook:
# address: "" # Webhook address, if not empty, Webhook output is enabled
# minimumpriority: "" # minimum priority of event for using this output, order is emergency|alert|critical|error|warning|notice|informational|debug or "" (default)
# minimumpriority: "" # minimum priority of event for using this output, order is emergency|alert|critical|error|warning|notice|informational|debug or "" (default)
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func init() {
}
if config.Datadog.APIKey != "" {
var err error
datadogClient, err = outputs.NewClient("Datadog", outputs.DatadogURL+"?api_key="+config.Datadog.APIKey, config, stats, statsdClient, dogstatsdClient)
datadogClient, err = outputs.NewClient("Datadog", config.Datadog.Host+outputs.DatadogPath+"?api_key="+config.Datadog.APIKey, config, stats, statsdClient, dogstatsdClient)
if err != nil {
config.Datadog.APIKey = ""
} else {
Expand Down
4 changes: 2 additions & 2 deletions outputs/datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
)

const (
// DatadogURL is default URL of Datadog's API
DatadogURL string = "https://api.datadoghq.com/api/v1/events"
// DatadogPath is the path of Datadog's event API
DatadogPath string = "/api/v1/events"
)

type datadogPayload struct {
Expand Down
1 change: 1 addition & 0 deletions types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ type teamsOutputConfig struct {

type datadogOutputConfig struct {
APIKey string
Host string
MinimumPriority string
}

Expand Down