fix(gcp-project-policies): Use correct API to get Policy v3, fix policy 2.1 query#7053
Merged
erezrokah merged 4 commits intocloudquery:mainfrom Jan 24, 2023
Merged
Conversation
yevgenypats
approved these changes
Jan 23, 2023
Member
Author
|
I might do another follow to the query as I think we should get all projects, and verify each one has audit logs. |
kodiakhq bot
pushed a commit
that referenced
this pull request
Jan 24, 2023
🤖 I have created a release *beep* *boop* --- ## [7.2.1](plugins-source-gcp-v7.2.0...plugins-source-gcp-v7.2.1) (2023-01-24) ### Bug Fixes * **deps:** Update module github.com/cloudquery/plugin-sdk to v1.28.0 ([#7009](#7009)) ([12ac005](12ac005)) * **gcp-project-policies:** Use correct API to get Policy v3, fix policy 2.1 query ([#7053](#7053)) ([2f17a4d](2f17a4d)) * Hardcode `us-central1` instead of `global` when fetching glossaries ([#6968](#6968)) ([0d76c62](0d76c62)) * **services:** Update GCP Services ([#7057](#7057)) ([7cc65a4](7cc65a4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reported on Discord https://discord.com/channels/872925471417962546/1065556442800734268/1065871250225909791
projectsClient.GetIamPolicyreturnsv1.Policywhich haslog_typeas an enum, and as a result evaluated to an int in the destination database. Our query needs the strings, as they appear inv3.Policy(configured by the table).To get the
v3.Policywe need the protobuf API.Additionally the check was wrong. We should verify all logging types are enabled for

allServices.This is how it looks in GCP: