Send security scan notifications and alerts to Slack, Discord, and Microsoft Teams. Keep your team informed about security status in real-time.
- 🔔 Multi-Platform Support - Slack, Discord, and Microsoft Teams
- 🎨 Rich Formatting - Color-coded severity levels with emojis
- 📄 Report Attachments - Send full security reports directly
- ⚡ Automatic Notifications - Auto-notify on scan completion
- ⚙️ Flexible Configuration - Per-platform or broadcast to all
- 🛡️ Severity Levels - Critical, warning, info, success
Run the interactive setup wizard:
cd integrations
./setup-integrations.shThis will guide you through configuring webhooks for each platform.
./notify.sh --platform slack --message "Security scanner is now integrated!"Run scans with auto-notification:
./auto-notify.sh comprehensiveCreate ~/.ai-security-scanner/integrations.conf:
# Slack webhook URL
SLACK_WEBHOOK_URL="https://hooks.slack.com/services/XXX/YYY/ZZZ"
# Discord webhook URL
DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/XXX/YYY"
# Microsoft Teams webhook URL
TEAMS_WEBHOOK_URL="https://outlook.office.com/webhook/XXX/YYY"
# Default platform (slack|discord|teams|all)
DEFAULT_PLATFORM="slack"
# Enable/disable notifications
NOTIFICATIONS_ENABLED="true"- Go to https://api.slack.com/apps
- Create a new app or select existing
- Navigate to "Incoming Webhooks"
- Activate and add new webhook
- Copy the webhook URL
- Open Discord → Server Settings
- Click "Integrations" → "Webhooks"
- Click "Create Webhook"
- Choose channel and copy URL
- Open Teams → Channel
- Click "..." → "Connectors"
- Search "Incoming Webhook"
- Configure and copy URL
./notify.sh \
--platform slack \
--message "Security scan completed successfully"./notify.sh \
--platform discord \
--title "Critical Alert" \
--message "Intrusion attempt detected from IP 192.168.1.100" \
--severity critical./notify.sh \
--platform all \
--title "Daily Security Report" \
--file ~/security-reports/security_analysis_20250112.md \
--severity warning# Send to all configured platforms
./notify.sh --platform all --message "System update completed"Wrap your scans to automatically send notifications:
# Comprehensive scan with auto-notification
./auto-notify.sh comprehensive
# Code review with auto-notification
./auto-notify.sh code-review /path/to/code
# Security monitoring with alerts
./auto-notify.sh monitor# Choose platform
NOTIFY_PLATFORM=discord ./auto-notify.sh comprehensive
# Disable success notifications
NOTIFY_ON_SUCCESS=false ./auto-notify.sh comprehensive
# Disable error notifications
NOTIFY_ON_ERROR=false ./auto-notify.sh comprehensiveAdd to crontab for automated security alerts:
crontab -eAdd these lines:
# Daily comprehensive scan at 3:30 AM with Slack notification
30 3 * * * cd /path/to/ai-security-scanner && ./integrations/auto-notify.sh comprehensive
# Hourly monitoring alerts to Discord
0 * * * * cd /path/to/ai-security-scanner && NOTIFY_PLATFORM=discord ./integrations/auto-notify.sh monitor
# Weekly code review (Sundays at 8 PM) to all platforms
0 20 * * 0 cd /path/to/ai-security-scanner && NOTIFY_PLATFORM=all ./integrations/auto-notify.sh code-review /var/wwwNotifications support different severity levels with color coding:
| Severity | Color | Emoji | Use Case |
|---|---|---|---|
critical |
Red | 🚨 | Security breaches, intrusions |
warning |
Orange | Vulnerabilities, misconfigurations | |
info |
Blue | ℹ️ | General information, updates |
success |
Green | ✅ | Successful scans, fixes applied |
#!/bin/bash
# daily-security-summary.sh
cd /path/to/ai-security-scanner
# Run comprehensive scan
./scripts/security-scanner.sh
# Find latest report
LATEST_REPORT=$(ls -t ~/security-reports/security_analysis_*.md | head -1)
# Extract critical findings count
CRITICAL_COUNT=$(grep -c "CRITICAL" "$LATEST_REPORT" || echo "0")
# Determine severity
if [ "$CRITICAL_COUNT" -gt 0 ]; then
SEVERITY="critical"
TITLE="⚠️ Daily Security Report - $CRITICAL_COUNT Critical Issues"
elif [ "$CRITICAL_COUNT" -gt 5 ]; then
SEVERITY="warning"
TITLE="⚠️ Daily Security Report - Issues Found"
else
SEVERITY="success"
TITLE="✅ Daily Security Report - All Clear"
fi
# Send notification
./integrations/notify.sh \
--platform all \
--title "$TITLE" \
--file "$LATEST_REPORT" \
--severity "$SEVERITY"#!/bin/bash
# monitor-failed-logins.sh
FAILED_LOGINS=$(grep "Failed password" /var/log/auth.log | tail -10)
if [ -n "$FAILED_LOGINS" ]; then
./integrations/notify.sh \
--platform slack \
--title "🚨 Failed Login Attempts Detected" \
--message "$FAILED_LOGINS" \
--severity critical
fi#!/bin/bash
# after-system-update.sh
./integrations/notify.sh \
--platform teams \
--title "System Updated" \
--message "Server $(hostname) has been updated and rebooted. Running security scan..." \
--severity info
# Run post-update security scan
./integrations/auto-notify.sh comprehensiveThe Web UI can also trigger notifications. Add webhook support in the Web UI by:
- Install the integration module in web-ui:
cd web-ui
npm install- Configure webhooks in the Web UI settings
- Enable auto-notifications for scan completions
- Check configuration:
cat ~/.ai-security-scanner/integrations.conf- Test webhook manually:
curl -X POST YOUR_WEBHOOK_URL \
-H "Content-Type: application/json" \
-d '{"text":"Test message"}'- Check notifications are enabled:
grep NOTIFICATIONS_ENABLED ~/.ai-security-scanner/integrations.conf- Ensure no extra spaces or quotes in webhook URL
- Verify webhook is still active in platform settings
- Regenerate webhook if necessary
Reports are automatically truncated:
- Slack: 2000 characters
- Discord: 4000 characters
- Teams: 3000 characters
For full reports, use file attachments or link to Web UI.
- Protect Configuration File:
chmod 600 ~/.ai-security-scanner/integrations.conf-
Rotate Webhooks Regularly - Regenerate webhook URLs periodically
-
Use Private Channels - Send security alerts to private/restricted channels
-
Limit Webhook Permissions - Only grant necessary permissions
-
Monitor Webhook Usage - Check for unauthorized usage
Edit notify.sh to customize message format:
# Around line 150 in notify.sh
local payload=$(cat <<EOF
{
"text": "Custom formatted message",
"attachments": [...]
}
EOF
)# Only notify on critical findings
CRITICAL_FOUND=$(grep -c "CRITICAL" report.md)
if [ "$CRITICAL_FOUND" -gt 0 ]; then
./notify.sh --platform all --message "Critical issues found!" --severity critical
fiCreate separate config files:
# Production team
INTEGRATIONS_CONF=~/.ai-security-scanner/prod-team.conf ./notify.sh --message "Prod scan"
# Dev team
INTEGRATIONS_CONF=~/.ai-security-scanner/dev-team.conf ./notify.sh --message "Dev scan"Be aware of platform rate limits:
- Slack: 1 message per second
- Discord: 30 messages per 60 seconds
- Teams: 4 messages per second
For high-frequency monitoring, consider batching notifications.
| Option | Required | Description |
|---|---|---|
-p, --platform |
Yes | Platform (slack|discord|teams|all) |
-m, --message |
Yes* | Message text |
-f, --file |
No | File to attach/send |
-s, --severity |
No | Severity level (default: info) |
-t, --title |
No | Notification title |
-c, --config |
No | Show configuration guide |
-h, --help |
No | Show help |
*Required unless file is provided
./auto-notify.sh <scan-type> [scan-arguments]Scan types: comprehensive, code-review, monitor
Want to add more platforms? Check CONTRIBUTING.md for guidelines.
Possible additions:
- Email notifications
- PagerDuty integration
- SMS via Twilio
- Custom webhooks
- Telegram bot
MIT License - see LICENSE file
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Stay secure and stay notified! 🔔🛡️