Skip to content

feat(cli): add manus-agent threat-feeds subcommand for threat intelligence feed lookup - #126

Open
manus-use wants to merge 1 commit into
mainfrom
feat/cli-threat-feeds
Open

feat(cli): add manus-agent threat-feeds subcommand for threat intelligence feed lookup#126
manus-use wants to merge 1 commit into
mainfrom
feat/cli-threat-feeds

Conversation

@manus-use

Copy link
Copy Markdown
Owner

Summary

Adds manus-agent threat-feeds <CVE-ID> CLI subcommand that wires the existing query_threat_intelligence_feeds Strands tool to the terminal.

What was added

  • threat-feeds CLI subcommand — queries curated open-source threat intelligence feeds (CISA advisories, etc.) for mentions of a given CVE ID
    • _build_threat_feeds_parser(): positional CVE-ID, --output {text,json} (default text)
    • _run_threat_feeds(argv): CVE ID validation, feed query, text/JSON output
    • Text output: structured display with feed name, URL, snippet (truncated at 200 chars for readability), and error reporting
    • JSON output: full payload with summary, intelligence array, and errors array
  • Refactored tool module — extracted fetch_threat_intelligence() as a standalone reusable function from the Strands tool wrapper, enabling both CLI and agent access without synthetic ToolUse dicts
    • Added DEFAULT_THREAT_FEEDS constant for configurability
    • Error collection (previously swallowed via print()) now returned in structured errors list
  • README update — TOC entry + CLI reference section between blast-radius and silent-patches
  • 28 new tests in tests/test_cli_threat_feeds.py — 100% mocked, covering:
    • Parser construction and validation
    • CVE ID format validation
    • No-results text/JSON output
    • Results with single and multiple feeds
    • Error display in text/JSON
    • Snippet truncation logic
    • Snippet bounds (CVE at start of content)
    • Custom feeds parameter
    • Case-insensitive matching
    • Main dispatch integration

Test results

1186 passed, 3 deselected, 3 warnings in 25.56s

(Baseline 1158 + 28 new, 0 failures)

Open PRs checked (no overlap)

Checked all 50 open PRs: #51, #53, #54, #58, #60, #64, #65, #67, #74–90, #96, #98, #100, #103–125.

Usage

# Text output (default)
manus-agent threat-feeds CVE-2024-3094

# JSON output
manus-agent threat-feeds CVE-2024-3094 --output json | jq .intelligence

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.

1 participant