Aller au contenu
login
arrow_backRetour aux issues
kubescape/kubescape #3401

feat: Native Slack/Teams/webhook notifier for scan results (--notify)

ecoDébutant feature help wanted

descriptionDescription

Problem Kubescape has no built-in way to push a scan summary to a chat tool or generic webhook. Teams that want scan results in Slack or Microsoft Teams today have to write custom CI scripting around kubescape scan --format json output and post it themselves. This is boilerplate every team using Kubescape in CI ends up rebuilding independently. Proposed solution Add a --notify flag on kubescape scan that posts a compact, formatted summary of the scan (compliance score, count of new/total failed controls, top failing controls) to the given destination after the scan completes. Support Slack incoming webhook URLs and Microsoft Teams webhook URLs natively (auto-detected by URL pattern), and fall back to a generic JSON POST for any other webhook URL. Implementation notes Slack: format as Slack Block Kit message (score, pass/fail counts, top 5 failing controls, link to full report if --output was also used). Teams: format as an Adaptive Card with equivalent content. Generic webhook: POST the existing JSON summary object (subset of the full report, not the entire raw report) as application/json. Should run as a best-effort post-scan step; a failed notification must not affect the scan's own exit code. Support multiple --notify flags to post to more than one destination in a single run. Respect --min-severity / --severity-threshold so noisy low-severity findings don't spam the channel by default. Acceptance criteria kubescape scan --notify https://hooks.slack.com/... posts a readable summary to the Slack channel. kubescape scan --notify https://mycompany.example.com/webhook posts a generic JSON payload. Notification failures are logged as warnings and do not change the scan's exit code. Documented with example payloads for both Slack and generic webhook formats.
codeOuvre sur GitHub