EnterpriseDB / barman

Barman - Backup and Recovery Manager for PostgreSQL
https://www.pgbarman.org/
GNU General Public License v3.0
2.07k stars 191 forks source link

Utilize aws s3 ls instead of s3api head-bucket to check for access before barman-cloud-backup execution #929

Open benjamin-schilling-csq opened 3 months ago

benjamin-schilling-csq commented 3 months ago

barman-cloud-backup currently uses the head-bucket operation of the s3api to check for existence and access to the targeted S3 bucket. For those trying to write restricted policy to prefixes within the bucket, the only thing that allows head-bucket to properly work is to allow ListBucket to the entirety of the bucket. If using the equivalent of aws-cli s3 ls, the policy can allow for checking that the root of the bucket exists while also restricting prefixes levels below the root of the bucket, permitting for a more secure solution.

If this is a feasible feature request it would be greatly appreciated if it could be implemented.