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

fix: compliance evaluation search cmd, searches greater than last 7 days #977

Merged
merged 8 commits into from
Nov 21, 2022

Conversation

dmurray-lacework
Copy link
Collaborator

@dmurray-lacework dmurray-lacework commented Oct 21, 2022

alternate approach to #976

Allows wrapping any search type type search func(response interface{}, filters SearchableFilter) error in a WindowedSearch()

Summary

The compliance evaluation search cmd was only searching the last 7 days. The max amount of days allowed for this search is 92, with a window of 7 days.

This change adds a new windowedSearch func to perform a new search of a specific time frame size until response data is found or the max searchable days is reached

How did you test this change?

Run lacework aws comp search <resource_arn> with the resource arn from JIRA acceptance criteria

  • integration/compliance_aws_test.go:168
  • integration/compliance_aws_test.go:159

Added new unit tests

  • api/v2_search_filters_test.go

Issue

https://lacework.atlassian.net/browse/ALLY-1196

@dmurray-lacework dmurray-lacework changed the title Dmurray lacework/ally 1196 alt fix: compliance evaluation search cmd, searches greater than last 7 days Oct 21, 2022
api/v2_search_filters.go Outdated Show resolved Hide resolved
cli/cmd/compliance_aws.go Outdated Show resolved Hide resolved
api/v2_search_filters.go Outdated Show resolved Hide resolved
api/v2_search_filters.go Show resolved Hide resolved
api/v2_search_filters.go Outdated Show resolved Hide resolved
api/v2_search_filters.go Outdated Show resolved Hide resolved
Signed-off-by: Darren Murray <[email protected]>
Copy link
Contributor

@afiune afiune left a comment

Choose a reason for hiding this comment

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

The only think we could improve is the function name, but out of that, this is great.

tenor-52311597

@dmurray-lacework dmurray-lacework merged commit cf92130 into main Nov 21, 2022
@dmurray-lacework dmurray-lacework deleted the dmurray-lacework/ALLY-1196-alt branch November 21, 2022 17:33
@dmurray-lacework dmurray-lacework mentioned this pull request Nov 24, 2022
This was referenced Nov 28, 2022
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