Skip to content

feat: [criminal_ip] add IP and domain report enrichment - #1060

Merged
adulau merged 2 commits into
mainfrom
codex/enrich-criminal_ip
Oct 30, 2026
Merged

adulau merged 2 commits into
mainfrom
codex/enrich-criminal_ip

Conversation

@adulau

@adulau adulau commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Analysts can retrieve Criminal IP IPv4 reports and the latest available domain report, or retrieve a report by numeric scan ID. An explicit submit_unknown setting permits a domain scan when no report exists. Submissions return a receipt without polling or automatic retries. Provider risk fields retain their original values.

Includes a usage guide and focused adapter tests.

Validation: 21 passed, 1 warning in 0.76s with pytest -q tests/test_criminal_ip.py; flake8 passed for the module. The combined enrichment regression check passed 389 tests.

Authenticated provider API validation remains pending. Tests use sanitized fixtures; no provider credentials are included.

Review updates: Select only reports whose normalized hostname matches the requested domain, request full IP report rows before applying the local cap, and preserve IP direction.

Updated validation: 22 passed, 1 warning in 0.67s; module lint passed. Combined regression validation passed 409 tests.

@adulau
adulau marked this pull request as ready for review October 29, 2026 22:10
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-29T22:13:08.404156Z db91878 Draft marked ready
🔒 Security Review ✅ Completed 2026-10-29T22:12:36.972147Z db91878 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db918780b4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

_annotation(event, attribute, "Domain scan submitted", receipt)
return
if rows:
scan_id = str(rows[0]["scan_id"])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Match search results to the requested domain

When this keyword query returns multiple reports, selecting rows[0] without checking its url can attach a scan for a different URL or hostname to the source attribute. Criminal IP documents Domain Search as a keyword/filter search, and /v1/domain/reports can return up to 100 results, so common or suffix-overlapping names can produce non-exact matches. Filter the rows by the normalized hostname/domain and select an appropriate exact match before fetching its scan ID.

Useful? React with 👍 / 👎.

if kind in ("ip-src", "ip-dst"):
if ipaddress.ip_address(value).version != 4:
raise ModuleError("Criminal IP IP reports require IPv4.")
data = _response("GET", "/v1/asset/ip/report", config, params={"ip": value})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Fetch enough IP rows to honor max_results

For the default max_results=25, and for every configured value from 21 through 100, this request cannot supply enough rows: Criminal IP's IP report documentation states that omitting full=true returns at most 20 data items. Consequently, the later slice can never honor these supported limits and the retained provider JSON is also truncated; request full data before applying the local limit, or cap and document the option at 20.

Useful? React with 👍 / 👎.

@adulau
adulau merged commit ce769b9 into main Oct 30, 2026
7 checks passed
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