Skip to content

feat: audit command - #98

Merged
keroxp merged 24 commits into
mainfrom
feat-scan
Jan 22, 2026
Merged

feat: audit command#98
keroxp merged 24 commits into
mainfrom
feat-scan

Conversation

@keroxp

@keroxp keroxp commented Jan 19, 2026

Copy link
Copy Markdown
Member

Summary

  • This PR adds new cage command audit, for finding ECR vulnerabilities based on ECR Image Scan results.

Usage

  • For existing cage project, just passing service.json dir for audit command.
cage audit --region ap-northeast-1 ./.deploy/development/your-service
  • Also, pass --cluster and --service options for arbitrary your service.
cage audit --region us-east-1 --cluster default --service my-service
  • The command takes a while, then outputs result as follows:
|CONTAINER      |STATUS    |CRITICAL|HIGH |MEDIUM|LOW |INFO|IMAGE                                                                                              |
|web-app        |NONE      |0       |0    |0     |0   |0   |12345678.dkr.ecr.us-north-1.amazonaws.com/web-app:latest|
|datadog        |VULNERABLE|0       |1    |0     |0   |0   |public.ecr.aws/datadog/agent:7                                                                     |

@codecov

codecov Bot commented Jan 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.88268% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.83%. Comparing base (9632f23) to head (5d24307).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cli/cage/audit/command.go 93.93% 2 Missing ⚠️
cli/cage/commands/audit.go 94.73% 1 Missing and 1 partial ⚠️
cli/cage/commands/command.go 83.33% 0 Missing and 1 partial ⚠️
cli/cage/commands/rollout.go 94.73% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #98      +/-   ##
==========================================
+ Coverage   88.40%   88.83%   +0.43%     
==========================================
  Files          21       36      +15     
  Lines        1069     1559     +490     
==========================================
+ Hits          945     1385     +440     
- Misses         61      119      +58     
+ Partials       63       55       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds a new cage scan command for identifying ECR vulnerabilities in ECS service container images. The feature retrieves ECR image scan results and displays vulnerability counts by severity in a formatted table.

Changes:

  • Adds new scan command that accepts either a service.json directory or explicit cluster/service flags
  • Implements ECR and ECS integration to retrieve container images and their vulnerability scan results
  • Refactors application structure by extracting dependency injection and AWS client provisioning into a new cageapp package
  • Updates mock files to latest mockgen format (auto-generated changes)

Reviewed changes

Copilot reviewed 33 out of 34 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
cli/cage/commands/scan.go New scan command implementation with argument parsing and scanner orchestration
cli/cage/scan/*.go Core scanning logic: ECS image info retrieval, ECR manifest parsing, and scan findings formatting
cli/cage/cageapp/provider.go Extracted dependency injection providers for reuse across commands
cli/cage/cageapp/flags.go Moved flag definitions and App struct to new package
cli/cage/commands/*.go Refactored existing commands to use new App struct and cageapp package
cli/cage/main.go Simplified main by extracting providers to cageapp package
awsiface/iface.go Added EcrClient interface for ECR operations
key/keys.go Added EcrCli key for dependency injection
env/env.go Removed CI field (moved to App struct)
cli/cage/prompt/prompt.go Removed CI flag check (moved to command layer)
go.mod/go.sum Updated AWS SDK dependencies and added ECR service
Makefile Changed mockgen invocation and upgrade mock path
mocks/* Auto-generated mock updates from newer mockgen version

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cli/cage/scan/printer.go Outdated
Comment thread cli/cage/commands/scan.go Outdated
Comment thread Makefile Outdated
Comment thread Makefile Outdated
Comment thread cli/cage/commands/scan.go Outdated
Comment thread cli/cage/cageapp/provider.go Outdated
Comment thread cli/cage/scan/printer.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 43 out of 44 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Makefile Outdated
Comment thread cli/cage/scan/scanner.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 44 out of 45 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cli/cage/scan/ecs.go Outdated
Comment thread cli/cage/main.go Outdated
Comment thread cli/cage/main.go Outdated
Comment thread cli/cage/commands/audit.go Outdated
Comment thread cli/cage/scan/types.go Outdated
@keroxp
keroxp marked this pull request as ready for review January 20, 2026 02:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 45 out of 46 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cli/cage/scan/printer.go Outdated
Comment thread cli/cage/commands/scan.go Outdated
Comment thread cli/cage/scan/scanner.go Outdated
Comment thread cli/cage/scan/types.go Outdated
Comment thread cli/cage/scan/printer.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 60 out of 61 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cli/cage/audit/aggregator.go Outdated
Comment thread cli/cage/audit/aggregator.go Outdated
Comment thread cli/cage/audit/printer.go Outdated
Comment thread Makefile Outdated
Comment thread cli/cage/audit/types.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 60 out of 61 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@keroxp keroxp changed the title feat: scan command feat: audit command Jan 22, 2026
@keroxp
keroxp merged commit 05a8dcd into main Jan 22, 2026
1 check passed
@keroxp
keroxp deleted the feat-scan branch January 22, 2026 08:34
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.

2 participants