Repository navigation
Keep the newest saved AWS permission check - #807
Merged
Merged
Conversation
Every reader of an AWS account (the Infrastructure vulnerabilities warning, the AWS page, Integrations) shows the saved permission check. The daily sweep and a page's live check both save it, and a sweep that started before an update could overwrite the newer live result. A save now carries when its check ran and only replaces an older one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Infrastructure vulnerabilities warning's
missinglist (InfraAccount.missing, fromAwsAccount::infra_missing) already reads the one saved check on the account,permissions_check. Both the daily sweep (aws_permissionspass) and a page's live check (POST /api/aws-connections/:id/permissions/check) write that field. A sweep that started before an admin's update could finish after the live check and overwrite it with the older result, bringing the warning back. The save now keeps whichever check is newest.Changes
common::live::aws_account::save_permissions:permissions_checked_ms(when the check ran) and replaces the saved check only when nothing newer is there.checked_ms, with a unit test.Verification
cargo fmt --all --check: clean.cargo clippy -p common -p gateway -p worker --all-targets -- -D warnings: clean.cargo test -p common --lib live::aws_account: 13 passed, including the newa_check_is_ordered_by_when_it_ran.