Skip to content

feat: Add PyPI Inspector link for remote PyPI scans with issues#730

Open
xxiaoxiong wants to merge 1 commit into
DataDog:mainfrom
xxiaoxiong:add-pypi-inspector-link
Open

feat: Add PyPI Inspector link for remote PyPI scans with issues#730
xxiaoxiong wants to merge 1 commit into
DataDog:mainfrom
xxiaoxiong:add-pypi-inspector-link

Conversation

@xxiaoxiong
Copy link
Copy Markdown

Description

This PR implements the feature requested in #67.

When scanning a remote PyPI package and issues are found, GuardDog now displays a link to PyPI Inspector for easier investigation.

Changes

  • cli.py: Added is_remote, ecosystem, and scanned_version fields to scan results for remote scans
  • human_readable.py: Display PyPI Inspector link when:
    • Scanning a remote PyPI package (not local files)
    • At least one issue is found
    • Version information is available
  • test_human_readable.py: Added 5 test cases to verify:
    • Link is shown for remote PyPI scans with issues
    • Link is NOT shown for local scans
    • Link is NOT shown when no issues found
    • Link is NOT shown for other ecosystems (npm, etc.)
    • Link is NOT shown when version is None

Example Output

Found 2 potentially malicious indicators in requests

some-rule: found suspicious behavior

For more details, see: https://inspector.pypi.io/project/requests/2.28.1

Testing

All new tests pass. The implementation follows the existing code style and patterns.

Fixes #67

当扫描远程 PyPI 包并发现问题时,在输出中显示 PyPI Inspector 链接。

修改内容:
- cli.py: 为远程扫描添加 is_remote、ecosystem 和 scanned_version 标记
- human_readable.py: 在有问题时显示 PyPI Inspector 链接
- test_human_readable.py: 添加 5 个测试用例验证功能

Fixes DataDog#67
@xxiaoxiong xxiaoxiong requested a review from a team as a code owner May 7, 2026 04:18
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.

Show direct link to package files on file matches

1 participant