import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * Auth0 can detect attacks and stop malicious attempts to access your application such as blocking traffic from certain IPs and displaying CAPTCHAs. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as auth0 from "@pulumi/auth0"; * * const myProtection = new auth0.AttackProtection("my_protection", { * suspiciousIpThrottling: { * enabled: true, * shields: [ * "admin_notification", * "block", * ], * allowlists: ["192.168.1.1"], * preLogin: { * maxAttempts: 100, * rate: 864000, * }, * preUserRegistration: { * maxAttempts: 50, * rate: 1200, * }, * }, * bruteForceProtection: { * allowlists: ["127.0.0.1"], * enabled: true, * maxAttempts: 5, * mode: "count_per_identifier_and_ip", * shields: [ * "block", * "user_notification", * ], * }, * breachedPasswordDetection: { * adminNotificationFrequencies: ["daily"], * enabled: true, * method: "standard", * shields: [ * "admin_notification", * "block", * ], * preUserRegistration: { * shields: ["block"], * }, * preChangePassword: { * shields: [ * "block", * "admin_notification", * ], * }, * }, * botDetection: { * botDetectionLevel: "medium", * challengePasswordPolicy: "when_risky", * challengePasswordlessPolicy: "when_risky", * challengePasswordResetPolicy: "always", * allowlists: [ * "192.168.1.0", * "10.0.0.0", * ], * monitoringModeEnabled: true, * }, * }); * // ============================================================================ * // CAPTCHA PROVIDER EXAMPLES - One per Provider * // ============================================================================ * const config = new pulumi.Config(); * // Google reCAPTCHA v2 site key * const recaptchaV2SiteKey = config.require("recaptchaV2SiteKey"); * // Google reCAPTCHA v2 secret key * const recaptchaV2Secret = config.require("recaptchaV2Secret"); * // Example 1: reCAPTCHA v2 * const captchaRecaptchaV2 = new auth0.AttackProtection("captcha_recaptcha_v2", {captcha: { * activeProviderId: "recaptcha_v2", * recaptchaV2: { * siteKey: recaptchaV2SiteKey, * secret: recaptchaV2Secret, * }, * }}); * // Google reCAPTCHA Enterprise site key * const recaptchaEnterpriseSiteKey = config.require("recaptchaEnterpriseSiteKey"); * // Google reCAPTCHA Enterprise API key * const recaptchaEnterpriseApiKey = config.require("recaptchaEnterpriseApiKey"); * // Google reCAPTCHA Enterprise project ID * const recaptchaEnterpriseProjectId = config.require("recaptchaEnterpriseProjectId"); * // Example 2: reCAPTCHA Enterprise * const captchaRecaptchaEnterprise = new auth0.AttackProtection("captcha_recaptcha_enterprise", {captcha: { * activeProviderId: "recaptcha_enterprise", * recaptchaEnterprise: { * siteKey: recaptchaEnterpriseSiteKey, * apiKey: recaptchaEnterpriseApiKey, * projectId: recaptchaEnterpriseProjectId, * }, * }}); * // hCaptcha site key * const hcaptchaSiteKey = config.require("hcaptchaSiteKey"); * // hCaptcha secret key * const hcaptchaSecret = config.require("hcaptchaSecret"); * // Example 3: hCaptcha * const captchaHcaptcha = new auth0.AttackProtection("captcha_hcaptcha", {captcha: { * activeProviderId: "hcaptcha", * hcaptcha: { * siteKey: hcaptchaSiteKey, * secret: hcaptchaSecret, * }, * }}); * // Friendly Captcha site key * const friendlyCaptchaSiteKey = config.require("friendlyCaptchaSiteKey"); * // Friendly Captcha secret key * const friendlyCaptchaSecret = config.require("friendlyCaptchaSecret"); * // Example 4: Friendly Captcha * const captchaFriendlyCaptcha = new auth0.AttackProtection("captcha_friendly_captcha", {captcha: { * activeProviderId: "friendly_captcha", * friendlyCaptcha: { * siteKey: friendlyCaptchaSiteKey, * secret: friendlyCaptchaSecret, * }, * }}); * // Arkose Labs site key * const arkoseSiteKey = config.require("arkoseSiteKey"); * // Arkose Labs secret key * const arkoseSecret = config.require("arkoseSecret"); * // Example 5: Arkose Labs * const captchaArkose = new auth0.AttackProtection("captcha_arkose", {captcha: { * activeProviderId: "arkose", * arkose: { * siteKey: arkoseSiteKey, * secret: arkoseSecret, * clientSubdomain: "client.example.com", * verifySubdomain: "verify.example.com", * failOpen: false, * }, * }}); * // ============================================================================ * // VARIABLES FOR SENSITIVE DATA * // ============================================================================ * ``` * * ## Import * * As this is not a resource identifiable by an ID within the Auth0 Management API, * * attack_protection can be imported using a random string. * * We recommend [Version 4 UUID](https://www.uuidgenerator.net/version4) * * Example: * * ```sh * $ pulumi import auth0:index/attackProtection:AttackProtection my_protection "24940d4b-4bd4-44e7-894e-f92e4de36a40" * ``` */ export declare class AttackProtection extends pulumi.CustomResource { /** * Get an existing AttackProtection resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: AttackProtectionState, opts?: pulumi.CustomResourceOptions): AttackProtection; /** * Returns true if the given object is an instance of AttackProtection. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is AttackProtection; /** * Bot detection configuration to identify and prevent automated threats. */ readonly botDetection: pulumi.Output; /** * Breached password detection protects your applications from bad actors logging in with stolen credentials. */ readonly breachedPasswordDetection: pulumi.Output; /** * Brute-force protection safeguards against a single IP address attacking a single user account. */ readonly bruteForceProtection: pulumi.Output; /** * CAPTCHA configuration for attack protection. */ readonly captcha: pulumi.Output; /** * Suspicious IP throttling blocks traffic from any IP address that rapidly attempts too many logins or signups. */ readonly suspiciousIpThrottling: pulumi.Output; /** * Create a AttackProtection resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args?: AttackProtectionArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering AttackProtection resources. */ export interface AttackProtectionState { /** * Bot detection configuration to identify and prevent automated threats. */ botDetection?: pulumi.Input; /** * Breached password detection protects your applications from bad actors logging in with stolen credentials. */ breachedPasswordDetection?: pulumi.Input; /** * Brute-force protection safeguards against a single IP address attacking a single user account. */ bruteForceProtection?: pulumi.Input; /** * CAPTCHA configuration for attack protection. */ captcha?: pulumi.Input; /** * Suspicious IP throttling blocks traffic from any IP address that rapidly attempts too many logins or signups. */ suspiciousIpThrottling?: pulumi.Input; } /** * The set of arguments for constructing a AttackProtection resource. */ export interface AttackProtectionArgs { /** * Bot detection configuration to identify and prevent automated threats. */ botDetection?: pulumi.Input; /** * Breached password detection protects your applications from bad actors logging in with stolen credentials. */ breachedPasswordDetection?: pulumi.Input; /** * Brute-force protection safeguards against a single IP address attacking a single user account. */ bruteForceProtection?: pulumi.Input; /** * CAPTCHA configuration for attack protection. */ captcha?: pulumi.Input; /** * Suspicious IP throttling blocks traffic from any IP address that rapidly attempts too many logins or signups. */ suspiciousIpThrottling?: pulumi.Input; }