-
Notifications
You must be signed in to change notification settings - Fork 37
Updated security campaign worker workflows to discover and address all security alerts (not just critical/high severity) #12005
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
Conversation
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
|
@copilot Should this not be part of the specific security alert orchestrator pre-compute/frontmatter/or markdown description? |
You're absolutely right. The security alert discovery logic should be campaign-specific rather than built into the generic The current implementation automatically detects "security" in the campaign ID and adds security alerts to all such campaigns, which creates tight coupling. A better approach would be to:
This would make the architecture cleaner and more maintainable. Would you like me to refactor this to use a campaign-specific discovery script instead? |
|
@copilot Contemplate getting rid of the pre-defined discovery test in favor of specific scenarios per campaign. |
- Reverted generic campaign_discovery.cjs changes to remove coupling - Created security_alert_discovery.cjs as campaign-specific script - Moved all security alert discovery logic to dedicated file - Added comprehensive tests (7 tests, all passing) - Original campaign_discovery tests still pass (34 tests) Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Done. I've refactored the implementation to use campaign-specific discovery scripts instead of embedding security logic in the generic Changes in commit cc8ad1b:
The generic discovery system now stays focused on discovering worker-created issues/PRs, while security campaigns can opt-in to security alert discovery by adding the custom script to their workflow steps. |
|
@copilot The discovery should come from based on what the workers label not a hard coded script? Every campaign will have a different need. |
You're absolutely right - I misunderstood the problem. The discovery system working based on worker labels is the correct architecture. The real issue isn't that discovery is broken (it correctly found 5 labeled items). The issue is that workers haven't yet created issues/PRs for all 22 security alerts. The solution should be for workers to create properly-labeled issues for each security alert, then the existing discovery will find them automatically. Should I revert the |
|
@copilot Revert security_alert_discovery.cjs script and instead focus on ensuring workers create labeled issues for all security alerts |
…stead Remove security_alert_discovery.cjs and tests per architectural feedback. The correct approach is for workers to create labeled issues/PRs for each security alert, then the existing generic discovery finds them. Discovery should be based on worker labels, not hard-coded scripts. Each campaign has different needs - the generic label-based discovery provides the flexibility needed. Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Done in commit 323ccef. Reverted the The label-based discovery architecture is now restored. Workers should create properly-labeled issues/PRs for each security alert, and the existing generic discovery will find them automatically. |
|
@copilot Investigate individual worker workflows for this campaign and their latest run to understand why they haven't yet created issues/PRs for all 22 security alerts. |
I've investigated the worker workflows and found several key insights: Discovery findings (from run 21389242618):
Worker behavior:
Why only 4 PRs for 22 alerts:
Conclusion: The architecture is working as designed. Discovery finds what workers create and label. To address all 22 alerts, workers need to continue running over time, creating PRs incrementally until all critical/high alerts are addressed. |
Update code-scanning-fixer workflow to handle all security alert severities instead of only critical/high. This enables the worker to create PRs for all 22 security alerts, not just the highest severity subset. Changes: - Remove severity filtering - list ALL open alerts - Prioritize by severity (critical > high > medium > low > warning > note > error) - Update description, mission, and instructions - Update exit messages to reflect all severities - Recompiled workflow lock file Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Update Workers to Discover All Security Alerts ✅
Problem Solved
Workers were only targeting critical and high severity alerts, missing alerts with other severities. Out of 22 total security alerts, workers could only address the critical/high subset due to severity filtering.
Solution Implemented
code-scanning-fixer.mdto discover all severity levelssecurity-fix-pr.md(already supports all severities - no changes needed)Key Changes
Before:
After:
Impact
The
code-scanning-fixerworker will now:z_campaign_security-alert-burndown)Architecture
This maintains the correct label-based discovery architecture:
Validation
Security Summary
No security vulnerabilities introduced. Changes are documentation/instruction updates to the worker workflow markdown files, enabling broader alert coverage while maintaining security best practices and severity-based prioritization.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.