Skip to content

Fixing exclusion with eh#1431

Merged
Mzack9999 merged 1 commit intodevfrom
bugfix-1398-eh
Mar 24, 2025
Merged

Fixing exclusion with eh#1431
Mzack9999 merged 1 commit intodevfrom
bugfix-1398-eh

Conversation

@Mzack9999
Copy link
Copy Markdown
Member

@Mzack9999 Mzack9999 commented Mar 20, 2025

Closes #1398

Summary by CodeRabbit

  • Refactor
    • Streamlined the process for filtering out excluded IP addresses during host discovery.
    • Enhanced error handling during shutdown, providing clearer feedback when closing scanning processes.

@Mzack9999 Mzack9999 added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Mar 20, 2025
@Mzack9999 Mzack9999 self-assigned this Mar 20, 2025
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 88f631c and 96180f8.

📒 Files selected for processing (2)
  • pkg/runner/runner.go (6 hunks)
  • pkg/scan/scan.go (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build-linux
🔇 Additional comments (5)
pkg/scan/scan.go (1)

193-198: Improved error handling in Close method

The method signature has been updated to return an error type, enhancing error handling capability while maintaining backward compatibility by returning nil. This change is part of a broader effort to improve error handling across the codebase, which is also reflected in the runner.go file.

pkg/runner/runner.go (4)

34-34: Added dependency on networkpolicy package

This import adds the networkpolicy package for improved IP filtering/validation capabilities.


55-55: Added NetworkPolicy field for IP exclusion handling

The new field excludedIpsNP will store a pointer to a NetworkPolicy instance, which provides more robust and standardized IP filtering capabilities compared to the previous map-based approach.


115-123: Enhanced IP exclusion mechanism

The code now creates a NetworkPolicy instance when excluded IPs are provided, offering a more structured approach to IP filtering compared to the previous implementation. This change aligns with issue #1398 mentioned in the PR objectives.


702-724: Improved error handling in Close method

The Close method has been updated to return errors from various operations, providing better error handling and reporting capabilities. This change is part of a consistent approach also implemented in the Scanner's Close method.

@projectdiscovery projectdiscovery deleted a comment from coderabbitai bot Mar 20, 2025
@Mzack9999 Mzack9999 merged commit d4d8e92 into dev Mar 24, 2025
12 checks passed
@Mzack9999 Mzack9999 deleted the bugfix-1398-eh branch March 24, 2025 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The host in cidr format excludes an IP address, which is not effective in version 2.3.4

1 participant