generated from Ostorlab/template_agent
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved IPv6 Handling for Nmap Agent #113
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #113 +/- ##
==========================================
+ Coverage 94.74% 94.94% +0.20%
==========================================
Files 9 9
Lines 932 970 +38
==========================================
+ Hits 883 921 +38
Misses 49 49 ☔ View full report in Codecov by Sentry. |
ohachimOs
reviewed
Dec 2, 2024
3asm
requested changes
Dec 2, 2024
adnaneserrar
reviewed
Dec 2, 2024
elyousfi5
reviewed
Dec 3, 2024
deadly-panda
reviewed
Dec 3, 2024
mohsinenar
reviewed
Dec 3, 2024
amine3
reviewed
Dec 4, 2024
ErebusZ
reviewed
Dec 6, 2024
IPV6_CIDR_LIMIT = 112 | ||
IPV6_MIN_PREFIX = 8 # Minimum safe prefix length for IPv6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not used anywhere
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Enhancements to IPv6 Handling in NmapAgent
This PR introduces several improvements and enhancements to the IPv6 handling logic in the
NmapAgent
class. The changes include validation of IPv6 settings, normalization of IPv6 addresses, and updates to subnet handling during the scanning process. Additionally, the PR modifies theprocess
method to ensure that invalid or misconfigured IPv6 addresses and subnets are properly handled.Key Changes:
IPv6 Validation Enhancements:
_validate_ipv6_settings
method to validate IPv6-specific settings.max_network_mask_ipv6
is within the allowed range (IPV6_MIN_PREFIX
to128
).ValueError
is raised with an appropriate error message.IPv6 Address Normalization:
_normalize_ipv6_address
method to normalize IPv6 addresses into their compressed format.ipaddress.IPv6Address
class to validate and compress IPv6 addresses. If an invalid address is provided, it raises anAddressValueError
, which is logged with an error message.IPv6 Subnet Handling:
process
method, added logic to handle IPv6 subnets:IPV6_CIDR_LIMIT
, aValueError
is raised to prevent further processing.IPV6_CIDR_LIMIT
) are properly handled with an error message.IPv6 Scan Options:
_get_ipv6_scan_options
method to retrieve IPv6-specific scan options, including parameters likeping_timeout
,min_rate
,max_rate
,max_retries
, andfragment_mtu
.Logging and Error Reporting: