-
Notifications
You must be signed in to change notification settings - Fork 597
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
Posture counts #1653
Posture counts #1653
Conversation
@@ -237,9 +238,9 @@ func CachePostureProviders(ctx context.Context, task *asynq.Task) error { | |||
|
|||
scan_count_query = ` | |||
MATCH (n:` + string(neo4jNodeType) + `) | |||
WHERE n.pseudo=false and n.active=true and n.agent_running=true |
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.
Is the condition n.agent_running=true
not required for linux posture count too?
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.
hosts with agent_running=false are not allowed to scan so they will not appear here
deepfence_worker/ingesters/common.go
Outdated
complete := false | ||
|
||
for i := range data { | ||
if data[i]["scan_status"].(string) == utils.SCAN_STATUS_SUCCESS { |
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.
Do we need to check if string conversion gave no error? Otherwise, might run into runtime error
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.
we dont need to check here as this field is guaranteed to have string data
Fixes #
Changes proposed in this pull request:
scan_count
should be number of accounts which are scanned irrespective of active or inactive accountsCachePostureProviders
task on detecting compliance scan success, this fixes the delay in sync of cached posture counts