-
Notifications
You must be signed in to change notification settings - Fork 246
Updates to enrichment plugins and funcapp #202
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
base: main
Are you sure you want to change the base?
Conversation
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 PR updates KQL queries and function app configurations for Microsoft Defender XDR enrichment plugins, specifically enhancing user-related security analysis capabilities. The changes improve query accuracy, add new functionality, and enhance documentation.
- Standardized case-insensitive user principal name matching across all queries
- Enhanced failed sign-in analysis with date-specific filtering and improved structure
- Added comprehensive 48-hour user sign-in activity monitoring capability
Comments suppressed due to low confidence (1)
Plugins/Community Based Plugins/Microsoft Defender XDR Custom Plugin Scenarios/EnrichmentPlugins/UserEnrichment.yaml:698
- [nitpick] Variable naming inconsistency: 'UPN' is used here while other queries use lowercase 'upn'. Consider using consistent naming convention across all queries.
let UPN = "{{upn}}";
| Description: User principal name. i.e., mscott@woodgrove.ms | ||
| Description: User principal name (e.g., mscott@woodgrove.ms) | ||
| Required: true | ||
| - Name: date |
Copilot
AI
Jul 22, 2025
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.
The 'date' parameter lacks input validation in the KQL template. Consider adding validation to ensure the date format matches YYYY-MM-DD and handle invalid date inputs gracefully to prevent query errors.
| Template: |- | ||
| // Query failed sign-in attempts for a specific user on a specific UTC date. | ||
| // user_context: {{user_context}} | ||
| let startDate = datetime("{{date}}"); // Parse the input date (YYYY-MM-DD, UTC) |
Copilot
AI
Jul 22, 2025
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.
Direct string interpolation of user input into datetime() function without validation could lead to injection issues or query failures. Consider validating the date format before using it in the KQL query.
| let startDate = datetime("{{date}}"); // Parse the input date (YYYY-MM-DD, UTC) | |
| let isValidDate = tostring("{{date}}") matches regex @"^\d{4}-\d{2}-\d{2}$"; // Validate date format (YYYY-MM-DD) | |
| let startDate = isValidDate ? datetime("{{date}}") : datetime(null); // Parse the input date or set to null if invalid | |
| let endDate = startDate + 1d; // Compute the end of the day window (exclusive) |
Updates to KQL and the function app powering the user submitted phishing email logicapp