Skip to content

Commit 486f03c

Browse files
authored
Merge pull request #5 from ncode/juliano/slack
Migrate from mattermost to slack notification and small test update
2 parents 561bf08 + 51cae94 commit 486f03c

File tree

8 files changed

+95
-2276
lines changed

8 files changed

+95
-2276
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
- **Supports Multiple Operations**: Filters common Vault operations, including KV operations, metadata updates, and deletion events.
1515
- **Performance-Oriented**: Built with `gnet` to handle high concurrency.
1616
- **Flexible Forwarding**: Forward filtered audit logs to specified UDP addresses for further processing or monitoring.
17-
- **Messaging Integration**: Send notifications about matched audit logs to messaging platforms like Mattermost.
17+
- **Messaging Integration**: Send notifications about matched audit logs to messaging platforms like Slack.
1818

1919
## Table of Contents
2020

@@ -81,8 +81,8 @@ Once you have built the project, you can run the `vault-audit-filter` executable
8181
enabled: true
8282
address: "127.0.0.1:9001"
8383
messaging:
84-
type: "mattermost_webhook"
85-
webhook_url: "https://your-mattermost-instance.com/hooks/your-webhook-id"
84+
type: "slack_webhook"
85+
webhook_url: "https://your-slack-instance.com/hooks/your-webhook-id"
8686

8787
- name: "critical_events"
8888
rules:
@@ -98,8 +98,8 @@ Once you have built the project, you can run the `vault-audit-filter` executable
9898
enabled: true
9999
address: "127.0.0.1:9002"
100100
messaging:
101-
type: "mattermost"
102-
url: "https://your-mattermost-instance.com"
101+
type: "slack"
102+
url: "https://slack.com/api/"
103103
token: "your-bot-token"
104104
channel: "your-channel-id"
105105

@@ -122,11 +122,11 @@ Once you have built the project, you can run the `vault-audit-filter` executable
122122
- `log_file.compress`: Whether to compress the old log files.
123123
- `forwarding.enabled`: Whether to enable forwarding for this rule group.
124124
- `forwarding.address`: The UDP address to forward matching audit logs to.
125-
- `messaging.type`: The type of messaging integration ("mattermost" or "mattermost_webhook").
126-
- `messaging.webhook_url`: The webhook URL for Mattermost (when using "mattermost_webhook" type).
127-
- `messaging.url`: The Mattermost server URL (when using "mattermost" type).
128-
- `messaging.token`: The bot token for Mattermost (when using "mattermost" type).
129-
- `messaging.channel`: The channel ID for Mattermost messages (when using "mattermost" type).
125+
- `messaging.type`: The type of messaging integration ("slack" or "slack_webhook").
126+
- `messaging.webhook_url`: The webhook URL for Slack (when using "slack_webhook" type).
127+
- `messaging.url`: The Slack API base URL (when using "slack" type).
128+
- `messaging.token`: The bot token for Slack (when using "slack" type).
129+
- `messaging.channel`: The channel ID for Slack messages (when using "slack" type).
130130

131131
### Rule Syntax
132132

go.mod

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,22 @@ require (
66
github.com/bytedance/sonic v1.13.2
77
github.com/expr-lang/expr v1.16.9
88
github.com/hashicorp/vault/api v1.14.0
9-
github.com/mattermost/mattermost-server/v6 v6.7.2
109
github.com/panjf2000/gnet v1.6.7
10+
github.com/slack-go/slack v0.16.0
1111
github.com/spf13/cobra v1.8.0
1212
github.com/spf13/viper v1.18.2
13-
github.com/stretchr/testify v1.8.4
13+
github.com/stretchr/testify v1.10.0
1414
gopkg.in/natefinch/lumberjack.v2 v2.0.0
1515
)
1616

1717
require (
18-
github.com/blang/semver v3.5.1+incompatible // indirect
1918
github.com/bytedance/sonic/loader v0.2.4 // indirect
2019
github.com/cenkalti/backoff/v3 v3.0.0 // indirect
2120
github.com/cloudwego/base64x v0.1.5 // indirect
2221
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
23-
github.com/dustin/go-humanize v1.0.0 // indirect
24-
github.com/dyatlov/go-opengraph v0.0.0-20210112100619-dae8665a5b09 // indirect
25-
github.com/francoispqt/gojay v1.2.13 // indirect
2622
github.com/fsnotify/fsnotify v1.7.0 // indirect
27-
github.com/go-asn1-ber/asn1-ber v1.5.3 // indirect
2823
github.com/go-jose/go-jose/v4 v4.0.1 // indirect
29-
github.com/go-test/deep v1.0.4 // indirect
30-
github.com/google/uuid v1.4.0 // indirect
31-
github.com/gorilla/websocket v1.5.0 // indirect
32-
github.com/graph-gophers/graphql-go v1.3.0 // indirect
24+
github.com/gorilla/websocket v1.5.3 // indirect
3325
github.com/hashicorp/errwrap v1.1.0 // indirect
3426
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
3527
github.com/hashicorp/go-multierror v1.1.1 // indirect
@@ -40,45 +32,23 @@ require (
4032
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
4133
github.com/hashicorp/hcl v1.0.0 // indirect
4234
github.com/inconshreveable/mousetrap v1.1.0 // indirect
43-
github.com/json-iterator/go v1.1.12 // indirect
44-
github.com/klauspost/compress v1.17.0 // indirect
4535
github.com/klauspost/cpuid/v2 v2.0.12 // indirect
4636
github.com/magiconair/properties v1.8.7 // indirect
47-
github.com/mattermost/go-i18n v1.11.1-0.20211013152124-5c415071e404 // indirect
48-
github.com/mattermost/ldap v0.0.0-20201202150706-ee0e6284187d // indirect
49-
github.com/mattermost/logr/v2 v2.0.15 // indirect
50-
github.com/minio/md5-simd v1.1.2 // indirect
51-
github.com/minio/minio-go/v7 v7.0.24 // indirect
52-
github.com/minio/sha256-simd v1.0.0 // indirect
5337
github.com/mitchellh/go-homedir v1.1.0 // indirect
5438
github.com/mitchellh/mapstructure v1.5.0 // indirect
55-
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
56-
github.com/modern-go/reflect2 v1.0.2 // indirect
57-
github.com/opentracing/opentracing-go v1.2.0 // indirect
58-
github.com/pborman/uuid v1.2.1 // indirect
59-
github.com/pelletier/go-toml v1.9.4 // indirect
6039
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
61-
github.com/philhofer/fwd v1.1.1 // indirect
62-
github.com/pkg/errors v0.9.1 // indirect
6340
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
64-
github.com/rs/xid v1.4.0 // indirect
6541
github.com/ryanuber/go-glob v1.0.0 // indirect
6642
github.com/sagikazarmark/locafero v0.4.0 // indirect
6743
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
68-
github.com/sirupsen/logrus v1.8.1 // indirect
6944
github.com/sourcegraph/conc v0.3.0 // indirect
7045
github.com/spf13/afero v1.11.0 // indirect
7146
github.com/spf13/cast v1.6.0 // indirect
7247
github.com/spf13/pflag v1.0.5 // indirect
73-
github.com/stretchr/objx v0.5.0 // indirect
48+
github.com/stretchr/objx v0.5.2 // indirect
7449
github.com/subosito/gotenv v1.6.0 // indirect
75-
github.com/tinylib/msgp v1.1.6 // indirect
7650
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
7751
github.com/valyala/bytebufferpool v1.0.0 // indirect
78-
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
79-
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
80-
github.com/wiggin77/merror v1.0.3 // indirect
81-
github.com/wiggin77/srslog v1.0.1 // indirect
8252
go.uber.org/atomic v1.9.0 // indirect
8353
go.uber.org/multierr v1.9.0 // indirect
8454
go.uber.org/zap v1.21.0 // indirect

0 commit comments

Comments
 (0)