Skip to content
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

⭐ Add output handler to store asset reports #982

Merged
merged 9 commits into from
Dec 20, 2023
Merged

Conversation

preslavgerchev
Copy link
Contributor

@preslavgerchev preslavgerchev commented Dec 6, 2023

Add a new --output-target flag that specifies a target where the scan report can be stored.
This currently only supports local files and AWS SQS urls. If no target is specified, it falls back to CLI reporting (which is the current default behaviour)

# for AWS sqs
~/go/bin/cnspec scan --output-target https://sqs.us-east-1.amazonaws.com/921877552404/myqueue --output json
# for local file
~/go/bin/cnspec scan --output-target file://somedir/file
~/go/bin/cnspec scan --output-target report.json --output json

for AWS SQS reporting only --output yaml and --output json are supported

@preslavgerchev preslavgerchev force-pushed the preslav/sqs-report branch 2 times, most recently from fb0dce2 to aadf269 Compare December 6, 2023 11:56
apps/cnspec/cmd/scan.go Outdated Show resolved Hide resolved
@preslavgerchev preslavgerchev changed the title ⭐ Add remote reporter to send scan reports ⭐ Add output handler to store asset reports Dec 7, 2023
@preslavgerchev preslavgerchev force-pushed the preslav/sqs-report branch 3 times, most recently from 96482bb to 7b84b78 Compare December 7, 2023 13:16
Copy link
Member

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

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

Very nice structured implementation. I am just having trouble to get the local file reporter running.

cli/reporter/output_handler_test.go Show resolved Hide resolved
apps/cnspec/cmd/scan.go Show resolved Hide resolved
cli/reporter/output_handler_test.go Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
test/cli/testdata/cnspec_scan.ct Show resolved Hide resolved
apps/cnspec/cmd/scan.go Outdated Show resolved Hide resolved
@preslavgerchev preslavgerchev force-pushed the preslav/sqs-report branch 2 times, most recently from 8acdca5 to fca5ca7 Compare December 14, 2023 17:13
Copy link
Member

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

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

Thank you @preslavgerchev

@chris-rock chris-rock merged commit 2034124 into main Dec 20, 2023
9 checks passed
@chris-rock chris-rock deleted the preslav/sqs-report branch December 20, 2023 12:53
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants