-
Notifications
You must be signed in to change notification settings - Fork 261
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e1974f
commit e00ba58
Showing
2 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,7 +102,7 @@ However, **using the cli `bq`** you need some more: **`bigquery.rowAccessPolicie | |
|
||
{% code overflow="wrap" %} | ||
```bash | ||
bq query --nouse_legacy_sql 'CREATE OR REPLACE ROW ACCESS POLICY <filter_id> ON `<proj>.<dataset-name>.<table-name>` GRANT TO ("user:[email protected]") FILTER USING (term = "Cfba");' # A example filter was used | ||
bq query --nouse_legacy_sql 'CREATE OR REPLACE ROW ACCESS POLICY <filter_id> ON `<proj>.<dataset-name>.<table-name>` GRANT TO ("<user:[email protected]>") FILTER USING (term = "Cfba");' # A example filter was used | ||
``` | ||
{% endcode %} | ||
|
||
|
@@ -116,6 +116,22 @@ It's possible to find the filter ID in the output of the row policies enumeratio | |
apac_filter term = "Cfba" user:[email protected] 21 Jan 23:32:09 21 Jan 23:32:09 | ||
``` | ||
|
||
If you have **`bigquery.rowAccessPolicies.delete`** instead of `bigquery.rowAccessPolicies.update` you could also just delete the policy: | ||
|
||
{% code overflow="wrap" %} | ||
```bash | ||
# Remove one | ||
bq query --nouse_legacy_sql 'DROP ALL ROW ACCESS POLICY <policy_id> ON `<proj>.<dataset-name>.<table-name>`;' | ||
|
||
# Remove all (if it's the last row policy you need to use this | ||
bq query --nouse_legacy_sql 'DROP ALL ROW ACCESS POLICIES ON `<proj>.<dataset-name>.<table-name>`;' | ||
``` | ||
{% endcode %} | ||
|
||
{% hint style="danger" %} | ||
Another potential option to bypass row access policies would be to just change the value of the restricted data. If you can only see when `term` is `Cfba`, just modify all the records of the table to have `term = "Cfba"`. However this is prevented by bigquery. | ||
{% endhint %} | ||
|
||
<details> | ||
|
||
<summary><strong>Learn AWS hacking from zero to hero with</strong> <a href="https://training.hacktricks.xyz/courses/arte"><strong>htARTE (HackTricks AWS Red Team Expert)</strong></a><strong>!</strong></summary> | ||
|
This file contains 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