Skip to content
Export guide · Identity

How to export your Google Workspace configuration, and what we check in it

Where you run it: The Cloud Identity Policy API, called with Google’s own Python sample (Google Cloud console and Google Admin console for the set-up), or the Google Admin console and a text editor.

In short

Google Workspace configuration export: the file Google Workspace writes of its own settings, which a configuration review reads setting by setting without connecting to Google Workspace.

How to export the Google Workspace configuration, step by step, what the review checks in the file (53 checks run), and what it does not read.

The fileJSON. The Policy API way: gws-policies.json, Google’s own answer. The Admin console way: one file google-workspace.json that you write in a text editor (UTF-8), in the shape the Both ways end here step shows
Checks run on it53
Highest grade its findings reachDECLARED
Feeds attack pathsNo
Not read from this export3 areas, listed below

Sources: Google Workspace documentation (1); Google Workspace documentation (2); Google Workspace documentation (3); the vendor table.

How to export it

Who can pull it
A super administrator, because three of the pages are reserved for that role: Google’s 2-step verification, Account recovery and Admin roles pages each say "You must be signed in as a super administrator for this task". The other pages ask for less: Password management and Google Session control need the Security Settings administrator privilege, API controls the Service Settings administrator privilege, and the security report the Reports administrator privilege. The optional GAM way needs a super administrator too: Google says "Only a super administrator can use the Cloud Identity Policy API."
Time
The Policy API way: about 30 minutes the first time, mostly the set-up; a few minutes after that. The Admin console way: about 15 minutes, mostly reading six pages and writing the file.
The file
JSON. The Policy API way: gws-policies.json, Google’s own answer. The Admin console way: one file google-workspace.json that you write in a text editor (UTF-8), in the shape the Both ways end here step shows

In the Google Workspace console

  1. Sign in to the Google Admin console (admin.google.com) as a super administrator. Go to Menu → Security → Authentication → 2-step verification and keep the top organizational unit selected. Note Enforcement: write ON when it is On, or when it is turned on from a date that has passed (Turn on enforcement from date); write OFF when it is not on, or when that date is still to come. Change nothing and do not click Save on any page in these steps.

    The vendor's page, checked 2026-11-11
  2. Menu → Security → Authentication → Password management: in the Length section, note the minimum length (Google allows 8 to 100 characters).

    The vendor's page, checked 2026-11-11
  3. Menu → Security → Authentication → Account recovery → Super admin account recovery: note whether the Allow super admins to recover their account box is ticked (true) or not (false).

    The vendor's page, checked 2026-11-11
  4. Menu → Security → Access and data control → Google Session control: note the Web session duration in hours (14 days, Google’s default, is 336 hours).

    The vendor's page, checked 2026-11-11
  5. Menu → Security → Access and data control → API controls: click Settings to open the settings group. Under Unconfigured third-party apps, note the selected option. If it is "Allow users to access any third-party apps", write ALLOWED. If it is "Don't allow users to access any third-party apps", write RESTRICTED. If it is "Allow users to access third-party apps that only request basic info needed for Sign in with Google", leave the apiAccess key out of the file: the review has no value for this option yet, and a key left out is not checked.

    The vendor's page, checked 2026-11-11
  6. Menu → Account → Admin roles: point to Super Admin and click View admins; note each email address. The page lists direct assignments: a super administrator who holds the role through a group is not shown, so add those you know of. Whether each one is enrolled in 2-Step Verification is in Menu → Reporting → User Reports → Security, column 2-Step Verification enrollment (Google: this data could be delayed up to 48 hours).

    The vendor's page, checked 2026-11-11
  7. Both ways end here. A file you type is graded DECLARED: its findings say they come from the file you typed and point to no line. In a text editor, save google-workspace.json in this shape with your own values (ON or OFF and ALLOWED or RESTRICTED in quotes; true, false and numbers without quotes; add one admins entry per super administrator; a setting you leave out is not checked): { "orgUnitPath": "/", "authentication": { "twoStepVerification": { "enforcement": "ON" }, "lessSecureApps": { "allowed": false } }, "passwordPolicy": { "minimumLength": 12 }, "recovery": { "superAdminAccountRecovery": false }, "session": { "sessionDuration": { "hours": 12 } }, "apiAccess": { "thirdPartyAppAccess": { "defaultAccess": "RESTRICTED" } }, "admins": [{ "email": "admin@example.com", "role": "SUPER_ADMIN", "isEnrolledIn2Sv": true }] }. Keep lessSecureApps false: Google’s page says "Starting May 1, 2025, Google Workspace accounts no longer support less secure apps, third-party apps, or devices that ask you to sign in to your Google Account with your username and password.", and that the setting is no longer available in the Google Admin console. Upload google-workspace.json.

    The vendor's page, checked 2026-11-11

Or from the command line

  1. The Policy API way (Google’s own answer). Set up access as Google’s page Setting up the Policy API shows: in the Google Cloud console, a project with the Cloud Identity API turned on and a service account; then, in the Google Admin console, domain-wide delegation for that service account with the one scope https://www.googleapis.com/auth/cloud-identity.policies.readonly. Google says "Only a super administrator can use the Cloud Identity Policy API."

    The vendor's page, checked 2026-11-11
  2. Run Google’s list sample from its page Listing and getting policies (Python; the set-up page shows the pip installline for its libraries) with --admin_email=<a super administrator’s address> --page_size=100 --list_filter='setting.type.matches("security.*")'(the filter follows the form Google’s sample gives for Gmail) and one change, so the answer is saved as Google returns it: in call_list_policies_api_till_last_page, replace the line print_list_policies_response(list_policies_response) with open('gws-policies.json', 'w').write(json.dumps(list_policies_response, indent=2)); break(it saves the first answer and stops).

    The vendor's page, checked 2026-11-11
  3. Upload gws-policies.json. It is Google’s own answer, so each finding points to the line it was read from. If the file holds a "nextPageToken", it is one page of several and the upload refuses it, because which policy is in force cannot be told from one page: use the Admin console way instead. Google leaves a setting that holds its default value out of the answer, so a setting you never changed is not assessed, and the review says so.

    The vendor's page, checked 2026-11-11
  4. After the upload has gone through: in the Google Admin console, delete the domain-wide delegation entry of the service account, and in the Google Cloud console delete the service account’s key (or the whole project, if you made it for this). Delete gws-policies.json from your computer when you no longer need it.

    The vendor's page, checked 2026-11-11
  5. Or, for the file you type, if you already run GAM7 (open-source, not a Google product; these lines follow GAM’s own wiki): add the read scope for Cloud Identity policies to GAM’s sign-in. GAM’s wiki does this with gam oauth deleteand then gam oauth create , which replaces GAM’s current sign-in grant; in the scope list, enter the number of the line "Cloud Identity API - Policy (supports readonly)" followed by r (GAM’s wiki pages show two different numbers for it, 22 and 25, so read the number from your own list). GAM’s Cloud Identity Policies page also asks you to grant the GAM project creator address the Organization Policy Administrator role in the Google Cloud console. Then gam show policies ou "^/$" formatjsonshows the settings for the top organizational unit that were set explicitly. A setting never changed from Google’s default is not listed: read that one in the Admin console.

    The vendor's page, checked 2026-11-11
  6. Both ways end here. A file you type is graded DECLARED: its findings say they come from the file you typed and point to no line. In a text editor, save google-workspace.json in this shape with your own values (ON or OFF and ALLOWED or RESTRICTED in quotes; true, false and numbers without quotes; add one admins entry per super administrator; a setting you leave out is not checked): { "orgUnitPath": "/", "authentication": { "twoStepVerification": { "enforcement": "ON" }, "lessSecureApps": { "allowed": false } }, "passwordPolicy": { "minimumLength": 12 }, "recovery": { "superAdminAccountRecovery": false }, "session": { "sessionDuration": { "hours": 12 } }, "apiAccess": { "thirdPartyAppAccess": { "defaultAccess": "RESTRICTED" } }, "admins": [{ "email": "admin@example.com", "role": "SUPER_ADMIN", "isEnrolledIn2Sv": true }] }. Keep lessSecureApps false: Google’s page says "Starting May 1, 2025, Google Workspace accounts no longer support less secure apps, third-party apps, or devices that ask you to sign in to your Google Account with your username and password.", and that the setting is no longer available in the Google Admin console. Upload google-workspace.json.

    The vendor's page, checked 2026-11-11
  7. After the upload has gone through, if you used GAM: run gam oauth deleteand gam oauth createagain and leave the Cloud Identity policy scope out, and take back the Organization Policy Administrator role you granted (Google Cloud console: the IAM page with the organization selected, Edit principal, delete the role, Save). To remove GAM completely, follow GAM’s page How to Uninstall GAM7.

    The vendor's page, checked 2026-11-11

What the file looks like

JSON. The Policy API way: gws-policies.json, Google’s own answer. The Admin console way: one file google-workspace.json that you write in a text editor (UTF-8), in the shape the Both ways end here step shows. It varies with the number of super administrators you list. The upload takes files up to 10 MB.

What it holds: The Policy API way: Google’s answer for the security settings set explicitly (2-Step Verification, password, "Less secure apps", account recovery, session control, Advanced Protection, login challenge). The Admin console way: the file you write.

The Policy API way: upload gws-policies.json as Google returns it; nothing is reshaped. The Admin console way: the review reads one JSON file you write, shaped like the Both ways end here step shows (orgUnitPath, authentication with twoStepVerification and lessSecureApps, passwordPolicy, recovery, session, apiAccess, admins); it is graded DECLARED. The Admin console pages and GAM’s print commands alone do not produce that file: GAM writes CSV, or its own JSON layout, which the upload does not read.

Afterwards

Policy API way: delete the domain-wide delegation entry and the service account key (or the project), and gws-policies.json. Console way: delete google-workspace.json when you no longer need it. GAM way: run gam oauth delete , sign GAM in again without the policy scope, and take back the role grant; GAM’s uninstall page lists the rest.

If the export goes wrong

What you seeThe fix
The upload refuses the file as not valid JSON.Paste the file into a JSON checker or open it in a browser: the usual cause is a missing comma between entries, curly quotes from a word processor, or true/false typed in quotes. Save it again as plain text (UTF-8) and upload.
The upload refuses a GAM .csv file, or the GAM JSON.GAM’s output is just for reading the values. Copy them into google-workspace.json as the Both ways end here step shows, and upload that file.
A setting is missing in the Admin console, or a page does not open.Sign in as a super administrator: Google’s 2-step verification, Account recovery and Admin roles pages ask for one. In Google Workspace for Education editions, Unconfigured third-party apps has separate settings for users over and under 18 years old. If you still cannot find a setting, leave that key out: it is then not checked.

What we read from it

Checks run
53 + 1 guidance items, not counted
Formats read
Admin SDK / API JSON export · Cloud Identity Policy API list answer (JSON)
Releases
2024.1 to current

Checks run is the number of checks that reached a result on this system's own export in our tests, as the vendor table shows it.

The areas checked

  • From the Policy API answer: 2-Step Verification enrollment, its methods and its grace period, password reuse, "Less secure apps", super admin self-recovery, Advanced Protection self-enrollment and the login challenge, for each setting set explicitly
  • From one JSON file shaped as the Both ways end here step shows (graded DECLARED): 2-Step Verification enforcement, including whether each super admin is enrolled
  • From that JSON file: minimum password length, super admin self-recovery and the web session length
  • From that JSON file: "Less secure apps", third-party app access and the number of super admins

The grade its findings reach

Declared Findings from this file are DECLARED: the file is typed by a person, so its findings say what was typed.

Its findings stay in the review and its reports. Google Workspace does not feed attack paths.

Attack paths, the one change and dollar figures are MODELED. How each grade is worked out is on the method page.

What we do not read from this export

  • GAM output as GAM writes it is not read (CSV from gam print, or the JSON from gam show policies)
  • From the Policy API answer: a setting that holds Google’s default value (Google leaves it out of the answer), administrators and their 2-Step Verification enrollment, and the web session length (its stored form is on no Google page read)
  • A Policy API answer that is one page of several (it holds a nextPageToken): refused
  • Super administrators who hold the role through a group, unless you add them by hand
  • The option "Allow users to access third-party apps that only request basic info needed for Sign in with Google": the review has no value for it yet
  • Gmail settings (spoofing protection, attachment blocking, IMAP and POP, SMTP relay): not in this export
  • Sharing outside the domain (Drive, Calendar, Sites, Chat), DLP rules and audit log retention: not in this export
  • Settings of child organizational units: just the top organizational unit
  • Vault settings in depth
  • Context-aware access beyond the top-level access levels
  • Each third-party app’s OAuth scopes in depth

Limits of the reader

  • Findings name the setting they come from, not its line number.
  • Findings stay in the review. They do not feed attack paths.
  • The checks of this system are not counted: a check counts once a test shows it firing on a file in the layout the vendor documents.

A finding never comes from what the file does not hold: live traffic, running hosts and logs are not in a configuration export.

Questions

Who can export the Google Workspace configuration?

A super administrator, because three of the pages are reserved for that role: Google’s 2-step verification, Account recovery and Admin roles pages each say "You must be signed in as a super administrator for this task". The other pages ask for less: Password management and Google Session control need the Security Settings administrator privilege, API controls the Service Settings administrator privilege, and the security report the Reports administrator privilege. The optional GAM way needs a super administrator too: Google says "Only a super administrator can use the Cloud Identity Policy API."

Does the export change anything?

In the Admin console: nothing, unless you click Save. Policy API way: a service account with a key and a read-only delegation entry. GAM way: a new sign-in grant with the policy scope, and an Organization Policy Administrator role; a new GAM set-up also adds a project, a service account and an OAuth client.

Does the file hold passwords or keys?

No passwords, keys or tokens. The file holds the email address of every super administrator and whether each is enrolled in 2-Step Verification, which shows which top accounts are easiest to take over: treat it as confidential. GAM’s own files (client_secrets.json, oauth2.txt, oauth2service.json) hold credentials and are not part of the upload. With redaction on (the default), the passwords, keys and tokens the review recognises are replaced with a placeholder before anything is stored; the check before upload shows how many it found.