servian / bigquery-view-analyzer

A command-line tool for managing permissions and dependencies for BigQuery authorized views
MIT License
88 stars 15 forks source link

permissions not applying in 21.9.0 #27

Open Marty08 opened 3 years ago

Marty08 commented 3 years ago

I'm running command line authorize of a view in V21.9.0 and the process runs successfully with no errors.

All sources have a green tick except for the view I'm trying to authorize which still has an X

permissions to upstream datasets are not applied even though all upstream sources have a tick in the command line.

I've reverted back to version 20.4.1 and the issue is not present and all permissions granted.

Below is the output:

target-project:shared_view.sample_data └── team-project:authorised_views.sample_data (✓) └── team-project:calculations.sample (✓) ├── team-project:calculations.calculated_sample (✓) │ ├── team-project:sales.header (✓) │ │ └── source-project:sales.header (✓) │ ├── team-project:sales.body (✓) │ │ └── source-project:sales.body (✓) │ ├── team-project:sales.dept (✓) │ │ └── source-project:sales.dept (✓) │ └── team-project:sales.sales (✓) │ └── source-project:sales.sales (✓) ├── team-project:customer.customer_data(✓) permission denied here │ └── source-project:customer.customer_data (✓) ├── team-project:sales.store (✓) │ └── source-project:sales.store (✓)

When trying to query the data in target-project:shared_view.sample_data, the permission denied at team-project:customer.customer_data in version 21.9.0

Works perfectly with no issues in 20.4.1

christippett commented 3 years ago

Thanks for raising this @Marty08, I'll see about deploying a test environment I can use to run some integration tests. I've probably done something silly somewhere.

Glad at least the previous version is working for you.

christippett commented 2 years ago

@Marty08 I've started laying the groundwork for proper integration tests (https://github.com/servian/bigquery-view-analyzer/tree/feature/integration-tests). Any test cases you can contribute from your experience working with authorized views would be appreciated mate. Just a few bullet points would be ideal!

Marty08 commented 2 years ago

@christippett

Happy to provide examples, I'll refer to the view being authorised as the target view and anything inside the view or needing authorisation as upstream:

The last two are useful but possibly out of scope for testing

Marty08 commented 2 years ago

@christippett , more of a question than a request. Have you looked into authorising tables that have column level security applied via data catalogue?

e.g pii data and security groups: https://cloud.google.com/bigquery/docs/column-level-security-intro

christippett commented 2 years ago

@Marty08 I haven't. Looks interesting though - I'm not working directly with BigQuery much these days so thanks for bringing this to my attention. I'll add to one of my things to look into.

christippett commented 2 years ago

@TWinsnes / @polleyg over to you to prioritise development effort on this.