Does Android system use gid for permission evaluation? - android-security

Android permission is grouped with some gid. Does this gid is use for permission check security?. If so where does it happens because in AOSP I does't find any code for security according to permission gid.
Please correct me if I am wrong!

Related

firebase realtime database detect security rules denies

I am using firebase realtime database. Sometimes denies appear on the monitor rules page. I can't find which child has access denied. There doesn't seem to be a problem with the code. The security rules look fine too.
today I ran this code "firebase database:profile" and "firebase database:profile -o, --output filename" in terminal and created a profile today. All values in the Permission Denied column in the profile output are zero. but 67 denies appear on the monitor rules page from the browser. How do I find which child is access denied ? (for example: /user/info or /tflist/name. like this, I can't find exactly where there is an access problem.)
note: I tried to do it with Cloud Monitoring, but I couldn't find it too complicated. just the number of access blocks I can find. it does not show which child access is blocked there either.

gcp giving it roles iam roles to configure the policiy

so what every i am doing in the gcp giving it roles iam roles to configure the policies , i am not able to do to my firebase project. i am able to log into it using my terminal with firebase login and then then firebare init is there and i put the function initilaize but it says i don't have permission to do that i need to give it permission so i open the file
/iam-admin/iam?folder=&organizationId=&project=clone-6de06 because this is my firebase project but i dont' have access to it in the gcp so i am not able to change the permission to change the policy or
need to run the role command
gcloud projects add-iam-policy-binding ourcafe-mucqxq
--member=serviceAccount:service-1044193269753#gcf-admin-robot.iam.gserviceaccount.com
--role=roles/cloudfunctions.serviceAgent as that says it will take care of following error: Deployment of your Cloud Function failed:
Missing necessary permission resourcemanager.projects.getIamPolicy for
service-1044193269753#gcf-admin-robot.iam.gserviceaccount.com on
resource projects/ourcafe-mucqxq. Please grant
service-1044193269753#gcf-admin-robot.iam.gserviceaccount.com the
Cloud Functions Service Agent
any help will be appreciated thank for the help.
Did you try to log in to firebase with a proper account?
If you're not sure that your account with proper permission, you can go to Firebase project >> Project settings >> Users and permission to check that your account is on the list with the right permission.
Also, you can see all of the accounts on the IAM of GCP console.

How to give the correct permissions to a GCP service account to update Firestore and Storage rules?

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)
I don't know the answer but here's how I'd work it out.
Firebase Admin is defined under Firebase-level roles:
https://firebase.google.com/docs/projects/iam/roles-predefined-all-products
NOTE Apologies, was unable to grab a link to the specific role on mobile
This shows all the permissions.
You should be able to determine which permissions are missing by checking the permissions of the other roles that you tried.
It would be helpful if you include the command and the specific errors that you received. Usually (!) these help scope the permission(s) that are missing.

GCP project ownership - mistake lost ownership

Doing some Firebase tests with users I change to ownership to another user and revoke it soon after, and with that I got the two users with "Edit" permission only and nobody with "Owner" permissions.
I tried through GCP console and API scripting to change that (even try using cloud functions) but I got always the message that I don't have permission, which is the expected behaviour.
I have a Gsuite account a GCP domain and both users are part of it. Any way to get this solved?
Help is really appreciated,
Rui

Missing necessary permission resourcemanager.projects.getIamPolicy

The deployment of your Cloud Function failed:
Missing necessary permission resourcemanager.projects.getIamPolicy for service-1044193269753#gcf-admin-robot.iam.gserviceaccount.com on resource projects/ourcafe-mucqxq. Please grant service-1044193269753#gcf-admin-robot.iam.gserviceaccount.com the Cloud Functions Service Agent role. You can do that by running 'gcloud iam service-accounts add-iam-policy-binding projects/ourcafe-mucqxq --member=service-1044193269753#gcf-admin-robot.iam.gserviceaccount.com --role=Cloud Functions Service Agent'
I bumped into this problem in Dialogflow Fulfillment. However, I didn't know how to figure it out, did someone know how to do that?
This picture is IAM
This picture is Service Account
I stumbled over the same message. It appears there's a typo in the gcloud command they give you: the role argument is missing the "roles/" prefix. This version worked for me:
gcloud projects add-iam-policy-binding ourcafe-mucqxq \
--member=serviceAccount:service-1044193269753#gcf-admin-robot.iam.gserviceaccount.com \
--role=roles/cloudfunctions.serviceAgent
Maybe you need to log out and back in.
Check all the small boxes in the login interface.
I feel like the answer is given to you. But I'm not sure. Have you tried running the command provided from the google cloud shell.
From your images the service account that is actually mentioned (service-1044193269753)does not have the role needed.
Read more on the Cloud functions service account here

Resources