Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backport kali & google workspace fixes to v7 #982

Merged
merged 2 commits into from
Feb 26, 2023
Merged

Conversation

tas50 and others added 2 commits February 25, 2023 23:40
It's Debian under the hood and it's been systemd since 2015.

Signed-off-by: Tim Smith <[email protected]>
…#981)

This change allows users to easily see all connected apps in their
google workspace domain:

```javascript
googleworkspace.connectedApps { name clientid }
googleworkspace.connectedApps: [
  0: {
    clientId: "11234434534-abcdefg.apps.googleusercontent.com"
    name: "Slack"
  }
  ...
]  
```

With MQL you can also easily filter the apps:

```javascript
googleworkspace.connectedApps.where( name == /Slack/) { * }
googleworkspace.connectedApps.where: [
  0: {
    users: [
  0: googleworkspace.user primaryEmail="[email protected]"
    ]
    tokens: [
  0: googleworkspace.token displayText="Slack"
    ]
    scopes: [
      0: "https://www.googleapis.com/auth/activity"
      1: "https://www.googleapis.com/auth/drive.activity"
      2: "https://www.googleapis.com/auth/userinfo.profile"
      3: "https://www.googleapis.com/auth/userinfo.email"
      4: "openid"
      5: "https://www.googleapis.com/auth/calendar.readonly"
      6: "https://www.googleapis.com/auth/drive"
      7: "https://www.googleapis.com/auth/calendar.events"
    ]
    name: "Slack"
    clientId: "11234434534-abcdefg.apps.googleusercontent.com"
  }
  1: {
    users: [
  0: googleworkspace.user primaryEmail="[email protected]"
  1: googleworkspace.user primaryEmail="[email protected]"
  2: googleworkspace.user primaryEmail="[email protected]"
  3: googleworkspace.user primaryEmail="[email protected]"
    ]
    tokens: [
  0: googleworkspace.token displayText="Slack"
  1: googleworkspace.token displayText="Slack"
  2: googleworkspace.token displayText="Slack"
  3: googleworkspace.token displayText="Slack"
    ]
    scopes: [
      0: "https://www.googleapis.com/auth/userinfo.profile"
      1: "https://www.googleapis.com/auth/userinfo.email"
      2: "openid"
    ]
    name: "Slack"
    clientId: "3321342421-dfgdgerdfggdfgdfgdf.apps.googleusercontent.com"
  }
  2: {
    users: [
  0: googleworkspace.user primaryEmail="[email protected]"
  1: googleworkspace.user primaryEmail="[email protected]"
  2: googleworkspace.user primaryEmail="[email protected]"
  3: googleworkspace.user primaryEmail="[email protected]"
    ]
    tokens: [
  0: googleworkspace.token displayText="Slack"
  1: googleworkspace.token displayText="Slack"
  2: googleworkspace.token displayText="Slack"
  3: googleworkspace.token displayText="Slack"
    ]
    scopes: [
      0: "https://www.googleapis.com/auth/userinfo.profile"
      1: "https://www.googleapis.com/auth/userinfo.email"
      2: "openid"
    ]
    name: "Slack"
    clientId: "6060606090-dgdfgdfgdffgdgdfgd.apps.googleusercontent.com"
  }
]
```

To get the list of apps from command line just run:


```bash
cnquery run google-workspace --customer-id C012345 --impersonated-user-email [email protected] -c "googleworkspace.connectedApps { name clientId }" -j > apps.json 
jq -r '.[0]["googleworkspace.connectedApps"][] | [.clientId, .name] | @csv ' apps.json > apps.csv
```
@arlimus arlimus merged commit e986d5f into v7 Feb 26, 2023
@arlimus arlimus deleted the chris-rock/v7-backports branch February 26, 2023 07:01
@github-actions github-actions bot locked and limited conversation to collaborators Feb 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants