1
0
Fork 0
mirror of https://github.com/imjasonh/gcloud-help synced 2026-07-16 20:36:39 +00:00
gcloud-help/gcloud/recaptcha/keys/create

283 lines
9.9 KiB
Text
Raw Normal View History

2022-03-01 04:29:52 +00:00
NAME
gcloud recaptcha keys create - create a Key
SYNOPSIS
gcloud recaptcha keys create --display-name=DISPLAY_NAME
2024-09-18 09:49:45 +00:00
(--express | [--android (--allow-all-package-names
2022-03-01 04:29:52 +00:00
| --package-names=[PACKAGE_NAMES,...])
2023-03-29 10:40:15 +00:00
: --support-non-google-app-store-distribution]
2023-05-17 10:38:17 +00:00
| [--ios (--allow-all-bundle-ids | --bundle-ids=[BUNDLE_IDS,...])
2024-07-31 09:35:16 +00:00
: --key-id=KEY_ID --private-key-file=PATH_TO_FILE --team-id=TEAM_ID]
2022-03-01 04:29:52 +00:00
| [--web (--allow-all-domains | --domains=[DOMAINS,...])
: --allow-amp-traffic --integration-type=INTEGRATION_TYPE
--security-preference=SECURITY_PREFERENCE
2025-07-17 11:02:31 +00:00
--testing-challenge=TESTING_CHALLENGE
[--default-score-threshold=DEFAULT_SCORE_THRESHOLD
: --action-score-thresholds=[ACTION_SCORE_THRESHOLDS,...]]])
[--labels=[KEY=VALUE,...]] [--testing-score=TESTING_SCORE]
2024-09-18 09:49:45 +00:00
[--waf-service=WAF_SERVICE : --waf-feature=WAF_FEATURE]
2022-03-01 04:29:52 +00:00
[GCLOUD_WIDE_FLAG ...]
DESCRIPTION
Create a reCAPTCHA Key.
EXAMPLES
To create a new reCAPTCHA key for websites showing no CAPTCHA challenge,
run:
$ gcloud recaptcha keys create --display-name=test-key-name --web \
--allow-all-domains --integration-type=score
REQUIRED FLAGS
--display-name=DISPLAY_NAME
A human-readable name for the key. Typically a site or app name.
Exactly one of these must be specified:
2024-09-18 09:49:45 +00:00
Options for the creation of a site key for Express.
2026-02-11 11:28:25 +00:00
--express
Creates a Key configured for Express assessments.
2024-09-18 09:49:45 +00:00
2022-03-01 04:29:52 +00:00
Options for the creation of a site key for Android.
2026-02-11 11:28:25 +00:00
--android
Creates a Key configured for Android devices.
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
This flag argument must be specified if any of the other arguments in
this group are specified.
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
--support-non-google-app-store-distribution
If set, this key can be used in an Android application that is
available for download in app stores other than the Google Play
Store.
2023-03-29 10:40:15 +00:00
2026-02-11 11:28:25 +00:00
This setting allows your key to accept traffic from devices without
Google Mobile Services (GMS) installed.
2023-03-29 10:40:15 +00:00
2026-02-11 11:28:25 +00:00
Exactly one of these must be specified:
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
--allow-all-package-names
If set, package name enforcement will NOT be enabled on this key.
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
--package-names=[PACKAGE_NAMES,...]
Android package names of apps allowed to use the key.
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
Example of a valid package name: 'com.companyname.appname'
2022-03-01 04:29:52 +00:00
Options for the creation of a site key for iOS.
2026-02-11 11:28:25 +00:00
--ios
Creates a Key configured for iOS devices.
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
This flag argument must be specified if any of the other arguments in
this group are specified.
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
Exactly one of these must be specified:
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
--allow-all-bundle-ids
If set, bundle id enforcement will NOT be enabled on this key.
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
--bundle-ids=[BUNDLE_IDS,...]
iOS bundle ids of apps allowed to use the key.
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
Example of a valid bundle id: 'com.companyname.productname.appname'
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
Fields that are required to perform Apple-specific integrity checks
(recommended for iOS keys).
2023-05-17 10:38:17 +00:00
2026-02-11 11:28:25 +00:00
--key-id=KEY_ID
The Apple developer key ID (10-character string).
2023-05-17 10:38:17 +00:00
2026-02-11 11:28:25 +00:00
This flag argument must be specified if any of the other arguments in
this group are specified.
2023-05-17 10:38:17 +00:00
2026-02-11 11:28:25 +00:00
--private-key-file=PATH_TO_FILE
File path to a private key (downloaded as a text file with a .p8 file
extension) generated for your Apple Developer account. Ensure that
DeviceCheck is enabled for the private key. Use a full or relative
path to a local file containing the value of private_key_file.
2023-05-17 10:38:17 +00:00
2026-02-11 11:28:25 +00:00
This flag argument must be specified if any of the other arguments in
this group are specified.
2023-05-17 10:38:17 +00:00
2026-02-11 11:28:25 +00:00
--team-id=TEAM_ID
The Apple team ID (10-character string) owning the provisioning
profile used to build your application.
2023-05-17 10:38:17 +00:00
2026-02-11 11:28:25 +00:00
This flag argument must be specified if any of the other arguments in
this group are specified.
2023-05-17 10:38:17 +00:00
2022-03-01 04:29:52 +00:00
Options for the creation of a site key for web.
2026-02-11 11:28:25 +00:00
--web
Creates a Key configured for websites.
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
This flag argument must be specified if any of the other arguments in
this group are specified.
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
--allow-amp-traffic
Whether this key can be used on AMP (Accelerated Mobile Pages)
websites.
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
--integration-type=INTEGRATION_TYPE
Configures how reCAPTCHA will operate on your site. This only applies
to 'web' platform. INTEGRATION_TYPE must be one of:
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
checkbox
Renders the classic "I'm not a robot" checkbox, and a captcha
challenge for low scoring events
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
invisible
Does not display the "I'm not a robot" checkbox, but may show
CAPTCHA challenges after risk analysis
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
policy-based-challenge
Conditionally displays a challenge based on the score
2025-07-17 11:02:31 +00:00
2026-02-11 11:28:25 +00:00
score
Shows no CAPTCHA challenge on the page
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
--security-preference=SECURITY_PREFERENCE
Represents the possible challenge frequency and difficulty
configurations for a web key. usability: show fewer and easier
challenges. balance: show balanced (in amount and difficulty)
challenges. security: show more and harder challenges.
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
SECURITY_PREFERENCE must be one of: balance,
challenge-security-preference-unspecified, security, usability.
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
--testing-challenge=TESTING_CHALLENGE
For CHECKBOX and INVISIBLE Keys only, this option configures whether
challenges will be issued for execute requests. TESTING_CHALLENGE
must be one of:
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
challenge
Execute requests for this key will always return an unsolvable
challenge consisting of a message about this testing key.
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
nocaptcha
Execute requests for this key will always return nocaptcha.
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
Exactly one of these must be specified:
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
--allow-all-domains
If set, domain name enforcement will NOT be enabled on this key.
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
--domains=[DOMAINS,...]
Domains or subdomains of websites allowed to use the key. All
subdomains of an allowed domain are automatically allowed. A valid
domain requires a host and must not include any path, port, query
or fragment.
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
Examples of valid domains: 'example.com' 'subdomain.example.com'
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
Configure if you want to use the POLICY_BASED_CHALLENGE option.
2025-07-17 11:02:31 +00:00
2026-02-11 11:28:25 +00:00
--default-score-threshold=DEFAULT_SCORE_THRESHOLD
The global threshold to be used for POLICY_BASED_CHALLENGE if no
action specific one exists.
2025-07-17 11:02:31 +00:00
2026-02-11 11:28:25 +00:00
This flag argument must be specified if any of the other arguments in
this group are specified.
2025-07-17 11:02:31 +00:00
2026-02-11 11:28:25 +00:00
--action-score-thresholds=[ACTION_SCORE_THRESHOLDS,...]
The action to score threshold used for POLICY_BASED_CHALLENGE. For
example: --action-score-thresholds=login='{"scoreThreshold":
"0.3"}',signup='{"scoreThreshold": "0.1"}' or
--action-score-thresholds=file_path.(json|yaml).
2025-07-17 11:02:31 +00:00
2026-02-11 11:28:25 +00:00
KEY
Sets KEY value.
2025-07-17 11:02:31 +00:00
2026-02-11 11:28:25 +00:00
VALUE
Sets VALUE value.
2025-07-17 11:02:31 +00:00
2026-02-11 11:28:25 +00:00
scoreThreshold
Sets scoreThreshold value.
2025-07-17 11:02:31 +00:00
2026-02-11 11:28:25 +00:00
Shorthand Example:
2025-07-17 11:02:31 +00:00
2026-02-11 11:28:25 +00:00
--action-score-thresholds=string={scoreThreshold=float}
2025-07-17 11:02:31 +00:00
2026-02-11 11:28:25 +00:00
JSON Example:
2025-07-17 11:02:31 +00:00
2026-02-11 11:28:25 +00:00
--action-score-thresholds='{"string": {"scoreThreshold": float}}'
2025-07-17 11:02:31 +00:00
2026-02-11 11:28:25 +00:00
File Example:
2025-07-17 11:02:31 +00:00
2026-02-11 11:28:25 +00:00
--action-score-thresholds=path_to_file.(yaml|json)
2025-07-17 11:02:31 +00:00
2022-03-01 04:29:52 +00:00
OPTIONAL FLAGS
--labels=[KEY=VALUE,...]
List of label KEY=VALUE pairs to add.
Keys must start with a lowercase character and contain only hyphens
(-), underscores (_), lowercase characters, and numbers. Values must
contain only hyphens (-), underscores (_), lowercase characters, and
numbers.
--testing-score=TESTING_SCORE
If set, all assessments for this key will return this score. Must be
between 0 (likely not legitimate) and 1 (likely legitimate) inclusive.
Options for the creation of a WAF-enabled key. For more information,
please refer to
https://cloud.google.com/recaptcha-enterprise/docs/integration-overview.
2026-02-11 11:28:25 +00:00
--waf-service=WAF_SERVICE
The WAF service provider to use. WAF_SERVICE must be one of:
2024-09-18 09:49:45 +00:00
2026-02-11 11:28:25 +00:00
akamai
Akamai
2024-09-18 09:49:45 +00:00
2026-02-11 11:28:25 +00:00
ca
Cloud Armor
2024-09-18 09:49:45 +00:00
2026-02-11 11:28:25 +00:00
cloudflare
Cloudflare
2024-09-18 09:49:45 +00:00
2026-02-11 11:28:25 +00:00
fastly
Fastly
2024-09-18 09:49:45 +00:00
2026-02-11 11:28:25 +00:00
This flag argument must be specified if any of the other arguments in
this group are specified.
2024-09-18 09:49:45 +00:00
2026-02-11 11:28:25 +00:00
--waf-feature=WAF_FEATURE
The WAF feature to use. For more information, see
https://cloud.google.com/recaptcha-enterprise/docs/usecase#comparison_of_features.
WAF_FEATURE must be one of:
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
action-token
Use reCAPTCHA action-tokens to protect user actions.
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
challenge-page
Redirects suspicious traffic to reCAPTCHA challenge page.
2022-03-01 04:29:52 +00:00
2026-02-11 11:28:25 +00:00
express
Assesses requests without tokens or frontend integration. This
option is deprecated, use --express instead.
2023-03-15 11:22:01 +00:00
2026-02-11 11:28:25 +00:00
session-token
Use reCAPTCHA session-tokens to protect the whole user session on
the site's domain.
2022-03-01 04:29:52 +00:00
GCLOUD WIDE FLAGS
These flags are available to all commands: --access-token-file, --account,
--billing-project, --configuration, --flags-file, --flatten, --format,
--help, --impersonate-service-account, --log-http, --project, --quiet,
--trace-token, --user-output-enabled, --verbosity.
Run $ gcloud help for details.
API REFERENCE
This command uses the recaptchaenterprise/v1 API. The full documentation
for this API can be found at:
https://cloud.google.com/recaptcha-enterprise/
NOTES
This variant is also available:
$ gcloud alpha recaptcha keys create