Skip to content

Dedupe Findings in Output / globally respect no_color / --no-color cli option#3074

Merged
liquidsec merged 7 commits into
devfrom
dedupe-stdout-findings
Jun 1, 2026
Merged

Dedupe Findings in Output / globally respect no_color / --no-color cli option#3074
liquidsec merged 7 commits into
devfrom
dedupe-stdout-findings

Conversation

@liquidsec

@liquidsec liquidsec commented May 4, 2026

Copy link
Copy Markdown
Collaborator

This PR does three things to the "human" output.

  1. Stop the duplicate lines. Instead of a standard line and a colored line, only the colored line shows up now. This happens without affecting the output in output.txt. The output going to the TTY takes a totally separate path than data going to output.txt.

  2. Link severity with boldness. Currently severity is linked to the color, but there was no visual way to perceive the confidence. Now the boldness of the text will correspond to the confidence.

  3. Changes color of critical to purple and low to yellow. Previously they were the same color as high/medium.

image (upped brightness a bit)

Follow-ups

Standardized the finding color palette. Severity and confidence colors were defined in three separate places: emoji on the FINDING event (Slack/Discord), hardcoded Adaptive Card styles in the Teams module, and the new ANSI palette in stdout. They now live in one place on the FINDING event class as the single source of truth, all following the blue/yellow/orange/red/purple convention. stdout, webhook, and teams consume it instead of carrying their own maps. INFO is now blue everywhere (it was inconsistently white in the emoji map).

NO_COLOR support. colorize() and the stdout module now honor the NO_COLOR convention, which disables all bbot terminal color (live log and findings). Added a --no-color CLI switch that sets it.

Findings were printed twice — once colored to stderr via log_to_stderr
and once plain to stdout. Drop the stderr emission and colorize the
single stdout line directly: severity selects the hue, confidence
scales the brightness (CONFIRMED also bold). Gated on isatty() so
piped/redirected stdout stays plain text. output.txt is unaffected
(written by the separate txt module).
@liquidsec liquidsec requested a review from TheTechromancer May 4, 2026 15:57
liquidsec added 2 commits May 4, 2026 11:57
Match the 🟦🟨🟧🟥🟪 convention from FINDING.severity_colors instead
of collapsing LOW+MEDIUM and HIGH+CRITICAL onto shared hues.
Bump base RGB so every severity's brightest channel is 255 (INFO blue
113,161,255 and CRITICAL purple 207,0,255 were below max). Raise the
UNKNOWN/LOW multipliers so the dimmest cells stay legible on dark
terminals — brightest channel never drops below ~115.
@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

📊 Performance Benchmark Report

Comparing dev (baseline) vs dedupe-stdout-findings (current)

📈 Detailed Results (All Benchmarks)

📋 Complete results for all benchmarks - includes both significant and insignificant changes

🧪 Test Name 📏 Base 📏 Current 📈 Change 🎯 Status
Bloom Filter Dns Mutation Tracking Performance 4.27ms 4.28ms +0.1%
Bloom Filter Large Scale Dns Brute Force 17.65ms 17.67ms +0.1%
Large Closest Match Lookup 342.34ms 332.26ms -2.9%
Realistic Closest Match Workload 178.12ms 178.36ms +0.1%
Event Memory Medium Scan 1394 B/event 1395 B/event +0.1%
Event Memory Large Scan 1517 B/event 1519 B/event +0.1%
Event Validation Full Scan Startup Small Batch 373.58ms 394.00ms +5.5%
Event Validation Full Scan Startup Large Batch 503.01ms 512.25ms +1.8%
Make Event Autodetection Small 19.81ms 19.78ms -0.2%
Make Event Autodetection Large 201.92ms 202.11ms +0.1%
Make Event Explicit Types 8.36ms 8.17ms -2.2%
Excavate Single Thread Small 3.083s 3.157s +2.4%
Excavate Single Thread Large 8.553s 8.609s +0.7%
Excavate Parallel Tasks Small 3.323s 3.374s +1.5%
Excavate Parallel Tasks Large 5.858s 5.889s +0.5%
Intercept Throughput Small 990.24ms 1.020s +3.0%
Intercept Throughput Medium 969.58ms 999.19ms +3.1%
Is Ip Performance 2.24ms 2.26ms +0.8%
Make Ip Type Performance 202.80µs 198.16µs -2.3%
Mixed Ip Operations 2.33ms 2.33ms +0.2%
Memory Use Web Crawl 402.5 MB 397.1 MB -1.3%
Memory Use Subdomain Enum 29.2 MB 29.2 MB +0.0%
Memory Use Deep Chain 8.5 MB 8.5 MB +0.0%
Memory Use Parallel Chains 23.1 MB 21.7 MB -6.3%
Scan Throughput 100 2.756s 3.007s +9.1%
Scan Throughput 1000 19.941s 20.177s +1.2%
Typical Queue Shuffle 5.52µs 5.46µs -1.2%
Priority Queue Shuffle 27.14µs 26.90µs -0.9%

🎯 Performance Summary

No significant performance changes detected (all changes <10%)


🐍 Python Version 3.11.15

@codecov

codecov Bot commented May 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.57143% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 90%. Comparing base (4dcd99a) to head (e759ac0).
⚠️ Report is 8 commits behind head on dev.

Files with missing lines Patch % Lines
bbot/scanner/scanner.py 0% 5 Missing ⚠️
bbot/cli.py 86% 1 Missing ⚠️
bbot/modules/output/stdout.py 93% 1 Missing ⚠️
bbot/modules/output/teams.py 50% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##             dev   #3074   +/-   ##
=====================================
+ Coverage     90%     90%   +1%     
=====================================
  Files        441     441           
  Lines      38841   38886   +45     
=====================================
+ Hits       34749   34798   +49     
+ Misses      4092    4088    -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ausmaster ausmaster requested review from ausmaster and removed request for TheTechromancer May 20, 2026 18:38
@ausmaster ausmaster added this to the BBOT 3.0 - blazed_elijah milestone May 20, 2026
Comment thread bbot/modules/output/stdout.py Outdated
liquidsec added 4 commits May 26, 2026 01:14
Move the finding color palette (ANSI, emoji, Teams card styles) onto the
FINDING event class as the single source of truth, standardized on the
blue/yellow/orange/red/purple convention. stdout, webhook, and teams now
consume it instead of each defining their own.

Honor the NO_COLOR env var in colorize() and stdout, and add a --no-color
CLI switch.
@liquidsec liquidsec changed the title Dedupe Findings in Output Dedupe Findings in Output / globally respect no_color / --no-color cli option Jun 1, 2026

@ausmaster ausmaster left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Privately submitted feedback, nice.

@liquidsec liquidsec merged commit f295dcf into dev Jun 1, 2026
20 checks passed
@liquidsec liquidsec deleted the dedupe-stdout-findings branch June 1, 2026 16:37
@liquidsec liquidsec mentioned this pull request Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants