-
Notifications
You must be signed in to change notification settings - Fork 14
Configuration checks fixes #134
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
Configuration checks fixes #134
Conversation
…ze primary NIC check
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.
Pull Request Overview
This pull request enhances the robustness and reliability of configuration check modules by improving string validation logic and making command execution more resilient to missing dependencies.
Key Changes:
- Normalized whitespace in string validation to handle formatting variations consistently
- Added conditional checks for Microsoft Defender ATP commands to gracefully handle missing installations
- Improved shell script portability and reliability in network configuration checks using safer parsing practices
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/modules/configuration_check_module.py |
Added whitespace normalization to string validator using regex substitution for more robust comparisons |
src/roles/configuration_checks/tasks/files/virtual_machine.yml |
Wrapped mdatp commands with existence checks to prevent failures when Microsoft Defender is not installed |
src/roles/configuration_checks/tasks/files/network.yml |
Refactored shell script to use read -r, improved variable handling, and more robust field parsing with explicit whitespace normalization |
… SUSE command for resource ID retrieval
…n pre-validation tasks
hdamecharla
left a comment
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.
@devanshjainms Approved
8c8c0f4
into
Azure:development-oct-2025
This pull request introduces several improvements to the configuration check modules and related Ansible tasks, focusing on better handling of string validation and enhanced robustness in command execution for virtual machine and network checks.
String validation improvements:
validate_stringinconfiguration_check_module.pyto normalize whitespace in both expected and collected strings, making string comparisons more robust against formatting differences.remodule import inconfiguration_check_module.pyto support the new whitespace normalization logic.Virtual machine checks robustness:
virtual_machine.ymlto check if themdatpcommand exists before running it, outputting a clear message if Microsoft Defender is not installed. This prevents errors when the command is missing. [1] [2]Network check script improvements:
network.ymlfor listing NICs and their IP configurations to use more robust and portable shell scripting practices, including use ofread -r, improved variable handling, and normalization of output for primary/secondary IPs.