-
Notifications
You must be signed in to change notification settings - Fork 141
🔒 Implement markdown security scanner for workflows #15208
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 pull request implements a comprehensive markdown security scanner for workflow files to detect and prevent various malicious content injection techniques. The scanner is designed to protect against workflow injection attacks by blocking dangerous patterns when workflows are added via gh aw add, during trial mode, and when importing files during compilation.
Changes:
- Added
ScanMarkdownSecurity()function with detection for 6 categories of threats: Unicode abuse, hidden content, obfuscated links, HTML abuse, embedded files, and social engineering patterns - Integrated security scanning into the workflow add command, trial mode, and import processing during compilation
- Added comprehensive test suite with 40+ test cases covering various attack vectors and edge cases
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/markdown_security_scanner.go | Core implementation of security scanner with pattern detection for multiple attack categories |
| pkg/workflow/markdown_security_scanner_test.go | Comprehensive test suite with coverage for all security categories and edge cases |
| pkg/workflow/compiler_orchestrator_engine.go | Integration of security scanning for imported workflow files during compilation |
| pkg/cli/add_command.go | Security scanning integration when adding workflows via gh aw add |
| pkg/cli/trial_repository.go | Security scanning integration for trial mode workflow installation |
| docs/src/content/docs/reference/markdown.md | Documentation of security scanning feature and threat categories |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| "github.com/github/gh-aw/pkg/constants" | ||
| "github.com/github/gh-aw/pkg/logger" | ||
| "github.com/github/gh-aw/pkg/tty" | ||
| workflowpkg "github.com/github/gh-aw/pkg/workflow" |
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.
weird keyword, it's not commonly used
|
Can we have a cli flag to turn it off? |
pelikhan
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.
@copilot add cli flag --disable-security-scanner to disable this check
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Summary
Key Changes
ScanMarkdownSecurity()function inpkg/workflow/markdown_security_scanner.goSecurity Implications
This security scanner provides a robust defense against potential workflow injection attacks by:
gh aw addor trial mode