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 update retention logic #385

Merged
merged 9 commits into from
Nov 27, 2024
Merged

Fix update retention logic #385

merged 9 commits into from
Nov 27, 2024

Conversation

markdboyd
Copy link
Contributor

Changes proposed in this pull request:

Fixes https://github.com/cloud-gov/private/issues/2052

A previous broker bug that has since been fixed allowed updated databases to have a backup retention period of 0, which disables automated backups on RDS databases. Even though that bug has been fixed, there are some brokered databases which have backup_retention_period: 0 stored in the broker's database, and the current broker logic allows that value to get re-applied to the RDS database on every update, thus re-disabling automated backups.

This PR fixes two bugs:

  • Users should not be able specify 0 as a retention period, or really any value less than the configured minimum retention period (default: 14)
  • When updating existing instances, if they have a value of 0 for the backup retention period, then they should default to the minimum retention period

Things to check

  • For any logging statements, is there any chance that they could be logging sensitive data?
  • Are log statements using a logging library with a logging level set? Setting a logging level means that log statements "below" that level will not be written to the output. For example, if the logging level is set to INFO and debugging statements are written with log.debug or similar, then they won't be written to the otput, which can prevent unintentional leaks of sensitive data.

Security considerations

Our website states that automated backups are enabled and retained for 14 days on all brokered databases. Furthermore, if automated backups are disabled and there is a data loss scenario, then we as a platform may not be able to restore a customer's data.

@markdboyd markdboyd requested a review from a team as a code owner November 27, 2024 19:05
Copy link
Contributor

@JasonTheMain JasonTheMain left a comment

Choose a reason for hiding this comment

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

Looks like a good fix

@markdboyd markdboyd added this pull request to the merge queue Nov 27, 2024
Merged via the queue into main with commit 70dd3f1 Nov 27, 2024
1 check passed
@markdboyd markdboyd deleted the fix-update-retention-logic branch November 27, 2024 19:17
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