-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add gcp_cloud_identity_group_membership and gcp_cloud_identity_group …
…tables. Closes #454 (#468) Co-authored-by: madhushreeray@30 <[email protected]> Co-authored-by: Ved misra <[email protected]>
- Loading branch information
1 parent
c84b76f
commit d4e89dd
Showing
6 changed files
with
585 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Table: gcp_cloud_identity_group | ||
|
||
A Membership defines a relationship between a Group and an entity belonging to that Group, referred to as a "member". | ||
|
||
**You must specify the parent resource** in the `where` clause (`where parent='C046psxkn'`) to list the identity groups. | ||
|
||
## Examples | ||
|
||
### Basic info | ||
|
||
```sql | ||
select | ||
name, | ||
display_name, | ||
description, | ||
create_time, | ||
location, | ||
project | ||
from | ||
gcp_cloud_identity_group | ||
where | ||
parent = 'C046psxkn'; | ||
``` | ||
|
||
### Get details for a specific group | ||
|
||
```sql | ||
select | ||
name, | ||
display_name, | ||
description, | ||
create_time, | ||
location, | ||
project | ||
from | ||
gcp_cloud_identity_group | ||
where | ||
name = 'group_name'; | ||
``` | ||
|
||
### Get dynamic group settings | ||
|
||
```sql | ||
select | ||
name, | ||
display_name, | ||
dynamic_group_metadata ->> 'Status' as dynamic_group_status, | ||
queries ->> 'Query' as dynamic_group_query, | ||
queries ->> 'ResourceType' as dynamic_group_query_resource_type, | ||
project | ||
from | ||
gcp_cloud_identity_group, | ||
jsonb_array_elements(dynamic_group_metadata -> 'Queries') as queries | ||
where | ||
parent = 'C046psxkn'; | ||
``` | ||
|
||
### List groups created in the last 7 days | ||
|
||
```sql | ||
select | ||
name, | ||
display_name, | ||
description, | ||
create_time, | ||
location, | ||
project | ||
from | ||
gcp_cloud_identity_group | ||
where | ||
parent = 'C046psxkn' | ||
and create_time > now() - interval '7' day; | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# Table: gcp_cloud_identity_group_membership | ||
|
||
A Membership defines a relationship between a Group and an entity belonging to that Group, referred to as a "member". | ||
|
||
**You must specify the identity group name** in the `where` clause (`where group_name=''`) to list the identity group memberships. | ||
|
||
## Examples | ||
|
||
### Basic info | ||
|
||
```sql | ||
select | ||
name, | ||
group_name, | ||
create_time, | ||
type, | ||
update_time | ||
from | ||
gcp_cloud_identity_group_membership | ||
where | ||
group_name = '123j0zll4288gmz'; | ||
``` | ||
|
||
### Get details of all google managed members in a group | ||
|
||
```sql | ||
select | ||
name, | ||
group_name, | ||
create_time, | ||
preferred_member_key ->> 'id' as member_id | ||
from | ||
gcp_cloud_identity_group_membership | ||
where | ||
group_name = '123j0zll4288gmz' | ||
and preferred_member_key ->> 'namespace' is null; | ||
``` | ||
|
||
### Get all the groups that are members of a specific group | ||
|
||
```sql | ||
select | ||
name, | ||
group_name, | ||
create_time, | ||
preferred_member_key ->> 'id' as member_id | ||
from | ||
gcp_cloud_identity_group_membership | ||
where | ||
group_name = '123j0zll4288gmz' | ||
and type = 'GROUP'; | ||
``` | ||
|
||
### List roles assigned to each member of a group | ||
|
||
```sql | ||
select | ||
name, | ||
group_name, | ||
create_time, | ||
type, | ||
preferred_member_key ->> 'id' as member_id, | ||
role ->> 'name' as role_name, | ||
role -> 'expiryDetail' ->> 'expireTime' as role_expiry_time | ||
from | ||
gcp_cloud_identity_group_membership, | ||
jsonb_array_elements(roles) as role | ||
where | ||
group_name = '123j0zll4288gmz'; | ||
``` | ||
|
||
### Get details of a specific member of a group | ||
|
||
```sql | ||
select | ||
name, | ||
group_name, | ||
create_time, | ||
type, | ||
preferred_member_key ->> 'id' as member_id, | ||
role ->> 'name' as role_name, | ||
role -> 'expiryDetail' ->> 'expireTime' as role_expiry_time | ||
from | ||
gcp_cloud_identity_group_membership, | ||
jsonb_array_elements(roles) as role | ||
where | ||
group_name = '123j0zll4288gmz' | ||
and name = '123454620869324818189'; | ||
``` |
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
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
Oops, something went wrong.