remove unused email notification from alert-handler#190
Closed
hippogr wants to merge 1 commit into
Closed
Conversation
Email notification is no longer used in production (not in actions-available). Removing nodemailer and all related code eliminates the S360 CVE for nodemailer without needing a major version upgrade of an unused dependency. Removed: - nodemailer, email-templates, ejs dependencies - mail model/controller and 3 email routes - email EJS templates (deploy/alert-templates/) - SMTP env vars and template volume mount from deployment - email webhook URLs from alertmanager configmap - alert-templates configmap creation/deletion from start/stop scripts - nodemailer/mailparser resolutions from job-status-change-notification Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the unused email-notification feature from the alert-manager “alert-handler” service to eliminate the nodemailer CVE surface area and simplify deployment/runtime configuration.
Changes:
- Removed alert-handler email routes/controllers/models and their dependencies (nodemailer, email-templates, ejs).
- Removed Kubernetes/deploy wiring for email templates (configmaps, volume mounts, SMTP env vars, alertmanager webhook URLs).
- Cleaned up related lockfile/resolutions entries (including nodemailer/mailparser pins).
Reviewed changes
Copilot reviewed 23 out of 24 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/alert-manager/src/job-status-change-notification/package.json | Drops unused nodemailer / mailparser resolution pins. |
| src/alert-manager/src/alert-handler/yarn.lock | Removes lock entries for deleted email-related dependencies. |
| src/alert-manager/src/alert-handler/routes/actions.js | Removes /send-email-* API routes from alert-handler. |
| src/alert-manager/src/alert-handler/package.json | Removes direct email dependencies and related overrides/resolutions. |
| src/alert-manager/src/alert-handler/models/mail.js | Deletes email transport/template rendering logic. |
| src/alert-manager/src/alert-handler/controllers/mail.js | Deletes email endpoints implementation. |
| src/alert-manager/deploy/stop.sh | Removes deletion of the alert-templates configmap. |
| src/alert-manager/deploy/start.sh.template | Removes creation of the alert-templates configmap. |
| src/alert-manager/deploy/alert-templates/kill-low-efficiency-job-alert/subject.ejs | Deletes email subject template. |
| src/alert-manager/deploy/alert-templates/kill-low-efficiency-job-alert/html.ejs | Deletes email HTML template. |
| src/alert-manager/deploy/alert-templates/job-status-change/subject.ejs | Deletes email subject template. |
| src/alert-manager/deploy/alert-templates/job-status-change/html.ejs | Deletes email HTML template. |
| src/alert-manager/deploy/alert-templates/general-templates/subject.ejs | Deletes email subject template. |
| src/alert-manager/deploy/alert-templates/general-templates/html.ejs | Deletes email HTML template. |
| src/alert-manager/deploy/alert-templates/cluster-usage/subject.ejs | Deletes email subject template. |
| src/alert-manager/deploy/alert-templates/cluster-usage/html.ejs | Deletes email HTML template. |
| src/alert-manager/deploy/alert-templates/cluster-report-lucia/subject.ejs | Deletes email subject template. |
| src/alert-manager/deploy/alert-templates/cluster-report-lucia/html.ejs | Deletes email HTML template. |
| src/alert-manager/deploy/alert-templates/cert-expiration/subject.ejs | Deletes email subject template. |
| src/alert-manager/deploy/alert-templates/cert-expiration/html.ejs | Deletes email HTML template. |
| src/alert-manager/deploy/alert-templates/adjust-user-quota/subject.ejs | Deletes email subject template. |
| src/alert-manager/deploy/alert-templates/adjust-user-quota/html.ejs | Deletes email HTML template. |
| src/alert-manager/deploy/alert-manager-deployment.yaml.template | Removes SMTP env vars and templates volume mount/volume from deployment. |
| src/alert-manager/deploy/alert-manager-configmap.yaml.template | Removes alertmanager webhook configs that called the removed email routes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
20
to
24
| pushd $(dirname "$0") > /dev/null | ||
|
|
||
| # create configmap for alert-templates | ||
| {% if cluster_cfg["alert-manager"]["alert-handler"]["configured"] -%} | ||
| {% if 'email-admin' in cluster_cfg["alert-manager"]["actions-available"] -%} | ||
| kubectl create configmap alert-templates \ | ||
| {% for template in cluster_cfg["alert-manager"]["alert-handler"]["email-configs"]["templates"] -%} | ||
| --from-file={{ template }}-html.ejs=alert-templates/{{ template }}/html.ejs \ | ||
| --from-file={{ template }}-subject.ejs=alert-templates/{{ template }}/subject.ejs \ | ||
| {% endfor -%} | ||
| --dry-run=client -o yaml | kubectl apply --overwrite=true -f - || exit $? | ||
| {% endif -%} | ||
| {% endif -%} | ||
|
|
||
| # create configmap for node-recycler | ||
| {% if cluster_cfg["alert-manager"]["node-recycler"]["configured"] -%} | ||
| {% if "icm" in cluster_cfg["alert-manager"]["node-recycler"] -%} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Email notification is no longer used in production (not in actions-available). Removing nodemailer and all related code eliminates the S360 CVE for nodemailer without needing a major version upgrade of an unused dependency.
Removed: