Skip to content

feat(waf): fastly slack alerting#443

Open
sseehra wants to merge 6 commits intomainfrom
sseehra-fastly-slack_alerting
Open

feat(waf): fastly slack alerting#443
sseehra wants to merge 6 commits intomainfrom
sseehra-fastly-slack_alerting

Conversation

@sseehra
Copy link

@sseehra sseehra commented Mar 2, 2026

Description

This PR adds Slack Alerting functionality for any sites that change their Agent Mode (Blocking --> Not Blocking, vice versa)

Related Tickets & Documents

https://mozilla-hub.atlassian.net/browse/INFRASEC-2395

@sseehra sseehra changed the title Sseehra fastly slack alerting feat(waf): fastly slack alerting Mar 2, 2026
variable "slack_logging_webhook_url" {
type = string
sensitive = true
default = "TBD"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bkochendorfer Would it make more sense to:

  • Have main.tf read the secret from a specific GCP project. Example:
data "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"
}
  • and create that secret in webservices?

What do you think?

Copy link
Member

Choose a reason for hiding this comment

The 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 sigsci_site_integration so I'm not sure I would consider this entire approach optimal

Copy link
Contributor

Choose a reason for hiding this comment

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

  • If not doing it this way: what approach would you recommend?
  • If doing it this way, we still need to figure out where in webservices do we store this secret 🤔

Copy link
Member

Choose a reason for hiding this comment

The 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"]
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might need to think of a more centralized approach here as these URLs are likely the same per channel

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@github-actions github-actions bot added the minor This PR will increment a minor version label Mar 3, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Release plan

Directory Previous version New version
google_fastly_waf 2.16.1 2.17.0

@sseehra sseehra requested a review from Tibap March 3, 2026 16:34
…o conditionally return ID based on enable_slack_logging_mode_alerts variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor This PR will increment a minor version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants