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

DG-1735 | Fix for policy updates getting missed by PolicyRefresher #3386

Merged
merged 5 commits into from
Aug 8, 2024

Conversation

krsoninikhil
Copy link

@krsoninikhil krsoninikhil commented Aug 7, 2024

Change description

Currently, the PolicyRefresher fetches policies if it finds audit logs after last updated timestamp and then updates it's last updated time to current time. This PR adds a check on fetched data to check if it has the latest edited policies, otherwise try again. And don't update the last updated timestamp if latest data is not found.

Things to note:

  • I'm ignoring the delete events for now and only capturing the T1 for other updates
  • I'm checking for last policy update time (T2) after pulling all the policies. If sort by timestamp desc, risk is if more policies are added in the meantime, we won't get them and if no. of policies is large, ES might sync by the time we pull last page and if we sort in descending, we'll not get to take advantage of this.
  • Anyway, this can be changed if required

Type of change

  • Bug fix (fixes an issue)
  • New feature (adds functionality)

Related issues

Fix #1

Checklists

Development

  • Lint rules pass locally
  • Application changes have been tested thoroughly
  • Automated tests covering modified code pass

Security

  • Security impact of change has been considered
  • Code follows company security practices and guidelines

Code review

  • Pull request has a descriptive title and context useful to a reviewer. Screenshots or screencasts are attached as necessary
  • "Ready for review" label attached and reviewers assigned
  • Changes have been reviewed by at least one other contributor
  • Pull request linked to task tracker where applicable

@krsoninikhil krsoninikhil changed the base branch from master to beta August 7, 2024 10:23
@krsoninikhil krsoninikhil changed the title DG-1735: Fix for policy updates getting missed by PolicyRefresher DG-1735 | Fix for policy updates getting missed by PolicyRefresher Aug 8, 2024
@krsoninikhil krsoninikhil merged commit cfd9514 into beta Aug 8, 2024
6 checks passed
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