-
Notifications
You must be signed in to change notification settings - Fork 4
feat(waf): fastly slack alerting #443
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
base: main
Are you sure you want to change the base?
Changes from all commits
8fb3ea4
cc6491b
614bda0
635661e
2731264
413ff23
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -133,3 +133,15 @@ variable "ngwaf_percent_enabled" { | |
| type = number | ||
| default = 100 | ||
| } | ||
|
|
||
| variable "slack_logging_webhook_url" { | ||
| type = string | ||
| sensitive = true | ||
| default = "TBD" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bkochendorfer Would it make more sense to:
What do you think?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is a good way to retrieve the data. The url will still be written to terraform state in plain text in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct. I think the impact is not too high though: someone retrieving the URL will be able to post messages to that channel.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Terraform does have a method for dealing with secrets like this https://www.hashicorp.com/en/blog/ephemeral-values-in-terraform, but it would require the sigsci provider to modify that slack url to be "write only" as well. If they did you could do something like the following. You could also create the secret object here in this module and have the secret persisted outside of Terraform. We might need to think of a more centralized approach here as these URLs are likely the same per channel and you might have multiple notifications bound to one channel? ephemeral "google_secret_manager_secret_version" "slack_waf_webhook" {
count = var.enable_slack_alerting ? 1 : 0
project = var.slack_webhook_secret_project
secret = "slack-waf-webhook-url"
}
resource "sigsci_site_integration" "slack_logging_mode_alerts" {
count = var.enable_slack_logging_mode_alerts ? 1 : 0
site_short_name = sigsci_site.ngwaf_edge_site.short_name
type = "slack"
url = ephemeral.google_secret_manager_secret_version..slack_logging_webhook_url
events = ["loggingModeChanged"]
}
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
+1 on that. I was suggesting above to host this in webservices, but... i don't have any strong feelings on that, so can be in our security-infra as well for example.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sseehra After talking with @bkochendorfer on this, we think we should change our approach. I'll post more details in the Jira ticket. |
||
| } | ||
|
|
||
| variable "enable_slack_logging_mode_alerts" { | ||
| description = "Enable or disable the Slack integration for logging mode change alerts" | ||
| type = bool | ||
| default = true | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.