Skip to content

feat: Add automated AWS Backup feature discovery#222

Merged
lgallard merged 3 commits intomasterfrom
feat/weekly-feature-discovery
Aug 25, 2025
Merged

feat: Add automated AWS Backup feature discovery#222
lgallard merged 3 commits intomasterfrom
feat/weekly-feature-discovery

Conversation

@lgallard
Copy link
Copy Markdown
Owner

Summary

This PR introduces automated weekly feature discovery for the terraform-aws-backup module using Claude Code with enhanced MCP server integration.

What's Added

  • GitHub Actions Workflow (.github/workflows/feature-discovery.yml)
    • Weekly automated scans every Sunday at 00:00 UTC
    • Manual trigger support with configurable options
    • Dry-run mode for testing
  • Issue Templates for structured discovery reporting
    • New AWS Backup features (.github/ISSUE_TEMPLATE/new-backup-feature.md)
    • Deprecation notices (.github/ISSUE_TEMPLATE/backup-deprecation.md)
    • Bug fix tracking (.github/ISSUE_TEMPLATE/backup-bug-fix.md)
  • Feature Tracking Database (.github/feature-tracker/backup-features.json)
    • Tracks current implementation state
    • Maintains discovery history and statistics
  • Discovery Prompts (.github/scripts/discovery-prompt.md)
    • Standardized analysis procedures for consistent results

How It Works

  1. MCP Server Integration: Uses Terraform and Context7 MCP servers for up-to-date documentation
  2. Intelligent Analysis: Compares AWS provider Backup resources with current module implementation
  3. Automated Issue Creation: Creates structured GitHub issues for new features, deprecations, and important bug fixes
  4. Progress Tracking: Maintains comprehensive database of discoveries and actions taken

Key Features

  • Backup-Specific Focus: Analyzes AWS Backup vault, plan, selection, framework, and compliance features
  • Smart Filtering: Avoids false positives and duplicate issue creation
  • Manual Controls: Supports manual execution with provider version specification
  • Comprehensive Documentation: Updates README with automation details

Manual Execution

# Standard weekly discovery
gh workflow run feature-discovery.yml

# Dry run mode (no issues created)
gh workflow run feature-discovery.yml -f dry_run=true

# Specific provider version
gh workflow run feature-discovery.yml -f provider_version=5.82.0

Integration

  • Compatible with existing release-please workflow
  • Uses conventional commit format for automatic changelog generation
  • Respects existing issue templates and labeling system
  • No impact on current development workflow

This automation ensures the module stays current with AWS Backup service evolution while maintaining high code quality and comprehensive documentation.

- Add weekly GitHub Actions workflow for Backup feature discovery
- Use Claude Code with Terraform and Context7 MCP servers
- Create structured issue templates for features, deprecations, and bug fixes
- Add comprehensive feature tracking database
- Include manual trigger and dry-run capabilities
- Update README with automation documentation

[skip ci]
- Fix trailing whitespace in issue templates
- Add missing newlines at end of files
- Clean up formatting in workflow and documentation files

[skip ci]
@lgallard
Copy link
Copy Markdown
Owner Author

codebot hunt

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Aug 24, 2025

Claude finished @lgallard's task —— View job


🕵️ Bug Hunt Analysis Complete

Analysis Tasks

  • Review GitHub Actions workflow for security and logic issues
  • Check feature tracker JSON for potential problems
  • Examine issue templates for critical issues
  • Review discovery prompt for security concerns
  • Check README changes for accuracy
  • Provide concise bug report with actionable feedback

🚨 Critical Security Issues Found

1. Secret Exposure Risk (CRITICAL)

  • Location: .github/workflows/feature-discovery.yml:64
  • Issue: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} exposes secret name in workflow logs
  • Risk: Secret name could be leaked in GitHub Actions logs, making it easier for attackers to target
  • Fix: Use a generic secret name or ensure proper log filtering

2. Excessive Permissions (HIGH)

  • Location: .github/workflows/feature-discovery.yml:30-34
  • Issue: Workflow has contents: write + issues: write + id-token: write
  • Risk: If compromised, could modify repository and create unlimited spam issues
  • Fix: Use contents: read unless commits are actually needed

3. Unvalidated Input Injection (MEDIUM)

  • Location: .github/workflows/feature-discovery.yml:10-24
  • Issue: provider_version input passed directly to commands without validation
  • Risk: Could allow command injection if malicious input provided
  • Fix: Add input validation regex: ^[0-9]+\.[0-9]+\.[0-9]+$|^latest$

⚠️ Logic & Performance Issues

4. Resource Waste (MEDIUM)

  • Location: .github/workflows/feature-discovery.yml:29
  • Issue: 30-minute timeout is excessive for a simple analysis task
  • Risk: Wastes GitHub Actions minutes
  • Fix: Reduce to 10-15 minutes

5. Potential File Race Condition (LOW)

  • Location: .github/workflows/feature-discovery.yml:42-58
  • Issue: Creates tracker file if missing, but doesn't handle concurrent runs
  • Risk: Could corrupt JSON if multiple runs execute simultaneously
  • Fix: Add file locking or atomic write operation

✅ Files Analysis Summary

  • Issue Templates: Well-structured, no security issues
  • Feature Tracker JSON: Valid format, appropriate initial data
  • Discovery Prompt: Comprehensive but no security risks
  • README: Accurately describes the automation feature

Recommendation: Address the Critical and High security issues before merging this PR to prevent potential security vulnerabilities.

- Add input validation for provider_version parameter with regex pattern
- Reduce excessive permissions from write to read-only where possible
- Implement atomic file operations with flock to prevent race conditions
- Reduce timeout from 30 to 15 minutes to prevent resource waste
- Use environment variables to prevent secret exposure in logs

Fixes all 5 security issues identified in Claude bot security analysis:
1. Secret exposure risk
2. Excessive permissions
3. Unvalidated input injection
4. Resource waste
5. File race conditions

[security]
@lgallard
Copy link
Copy Markdown
Owner Author

codebot hunt

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Aug 24, 2025

Claude finished @lgallard's task —— View job


Claude finished @lgallard's task —— View job


🕵️ Bug Hunt Analysis Complete

Analysis Tasks

  • Review GitHub Actions workflow for security and logic issues
  • Check feature tracker JSON for potential problems
  • Examine issue templates for critical issues
  • Review discovery prompt for security concerns
  • Check README changes for accuracy
  • Provide concise bug report with actionable feedback

🎉 Security Improvements Confirmed

Excellent work! The previous critical security vulnerabilities have been properly addressed in the latest commit:

Fixed Security Issues

  1. Secret Exposure: CLAUDE_TOKEN now properly stored in env and referenced via ${{ env.CLAUDE_TOKEN }}
  2. Permissions: Reduced to minimal required (contents: read, issues: write, actions: read)
  3. Input Validation: Added robust regex validation for provider_version parameter
  4. Timeout: Reduced from 30 to 15 minutes (much more reasonable)
  5. File Locking: Implemented proper atomic file operations with flock for feature tracker

🔍 Additional Findings

Minor Performance Optimizations

  • File Creation Logic: The workflow creates tracker directory/file every run. Consider checking if file exists first to avoid unnecessary operations
  • Git Config: Sets global git config on every run. Could be optimized with conditional check

📋 Code Quality

  • Issue Templates: Well-structured with comprehensive checklists and clear guidance
  • Feature Tracker: Properly formatted JSON with logical data structure
  • Discovery Prompt: Thorough documentation with good standardization
  • README Changes: Missing from analysis (partial read only)

🏆 Overall Assessment

Status: ✅ SECURE AND READY

The feature discovery workflow demonstrates excellent security practices:

  • No critical vulnerabilities remain
  • Proper secret handling implemented
  • Minimal necessary permissions
  • Input validation in place
  • Atomic file operations with locking
  • Reasonable timeouts and resource usage

The automation framework is well-architected with comprehensive templates and clear processes for AWS Backup feature tracking.


@lgallard lgallard merged commit bc17645 into master Aug 25, 2025
38 of 39 checks passed
@lgallard lgallard deleted the feat/weekly-feature-discovery branch August 25, 2025 15:50
@github-actions github-actions Bot mentioned this pull request Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant