Not able to log the name of the datasets affected by granting IAM role permissions

Background: my client currently uses Terraform to apply changes to the GCP infrastructure, which sometimes includes granting IAM permissions to certain employees. My client wants to track all granted and removed permissions due to compliance. We wanted to achieve the following objectives:

  1. track which users were granted what IAM roles.
  2. track what bigquery datasets were affected by the roles as in objective 1.

What we did:
we first created a logging sink via the logs explorer. When creating the sink, we set a bigquery dataset as destination because we want to store the cloud audit logs there. Then we set the Build inclusion filter as the line below:

protoPayload.”@type”=”type.googleapis.com/google.cloud.audit.AuditLog”

With the setup above, the sink created 3 tables:
cloudaudit_googleapis_com_activity,
cloudaudit_googleapis_com_data_access,
cloudaudit_googleapis_com_system_event.

We queried the cloudaudit_googleapis_com_activity table.

Below is a sample of the query:

SELECT 
  timestamp,
  resource.labels.project_id,
  protopayload_auditlog.methodName,
  protopayload_auditlog.authenticationInfo.principalEmail,
  protopayload_auditlog.servicedata_v1_iam.policyDelta.bindingDeltas,
  protopayload_auditlog.resourceName
FROM 
  `cloudaudit_googleapis_com_activity`
WHERE 
  protopayload_auditlog.methodName = 'SetIamPolicy'

Issue:
We managed to achieve objective 1, however we couldn’t see what datasets were affected by the granted roles (objective 2).
Using the ‘SetIamPolicy’ methodName, we expected to find the desired information within the protopayload_auditlog.resourceName field, which should have the bigquery path in the form of projects/<project name>/datasets/<dataset name>/..., however this field only had the GCP project name in it, no matter if a user was granted a role for a specific dataset only.

We tried changing the protopayload_auditlog.methodName field to ‘datasetservice.update’, and we could actually see the affected datasets for each role, but alas this filter didn’t provide information about the users who got granted the roles, and the timestamps didn’t match with the ‘SetIamPolicy’ method so we couldn’t find a common field between these 2 different methodName fields to link users, roles, and datasets altogether.

Is there a way to solve this? Not sure if there is a way to log all this info together with the other 2 logging tables, or maybe we need to use certain settings in terraform?

Thank you in advance

New contributor

FILIPPO XAUSA is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật