I have an automated process to update a Firebase project's Firestore and storage rules. It always throughs permission denied errors. I've tried a combination of the predefined IAM roles such as Firebase Rules Admin, Firebase Rules System, and Firebase Rules Viewer. and even a combination of all three failed.
When giving the service account the Firebase Admin IAM role, it worked; however, I'd like to avoid giving this service account excess permissions due to best security practices following the principle of least privilege.
I found this documentation for specific permissions needed: https://firebase.google.com/docs/projects/iam/permissions#security-rules but after creating a new IAM role with all 13 of the permissions, it was still denied.
What is the correct set of least permissions needed to only allow the service account to update rules and rules only? (Firestore and storage)