-
Notifications
You must be signed in to change notification settings - Fork 7
/
AttackProtection.cs
207 lines (191 loc) · 8.84 KB
/
AttackProtection.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
namespace Pulumi.Auth0
{
/// <summary>
/// Auth0 can detect attacks and stop malicious attempts to access your application such as blocking traffic from certain IPs and displaying CAPTCHA
///
/// ## Example Usage
///
/// ```csharp
/// using Pulumi;
/// using Auth0 = Pulumi.Auth0;
///
/// class MyStack : Stack
/// {
/// public MyStack()
/// {
/// var attackProtection = new Auth0.AttackProtection("attackProtection", new Auth0.AttackProtectionArgs
/// {
/// BreachedPasswordDetection = new Auth0.Inputs.AttackProtectionBreachedPasswordDetectionArgs
/// {
/// AdminNotificationFrequencies =
/// {
/// "daily",
/// },
/// Enabled = true,
/// Method = "standard",
/// Shields =
/// {
/// "admin_notification",
/// "block",
/// },
/// },
/// BruteForceProtection = new Auth0.Inputs.AttackProtectionBruteForceProtectionArgs
/// {
/// Allowlists =
/// {
/// "127.0.0.1",
/// },
/// Enabled = true,
/// MaxAttempts = 5,
/// Mode = "count_per_identifier_and_ip",
/// Shields =
/// {
/// "block",
/// "user_notification",
/// },
/// },
/// SuspiciousIpThrottling = new Auth0.Inputs.AttackProtectionSuspiciousIpThrottlingArgs
/// {
/// Allowlists =
/// {
/// "192.168.1.1",
/// },
/// Enabled = true,
/// PreLogin = new Auth0.Inputs.AttackProtectionSuspiciousIpThrottlingPreLoginArgs
/// {
/// MaxAttempts = 100,
/// Rate = 864000,
/// },
/// PreUserRegistration = new Auth0.Inputs.AttackProtectionSuspiciousIpThrottlingPreUserRegistrationArgs
/// {
/// MaxAttempts = 50,
/// Rate = 1200,
/// },
/// Shields =
/// {
/// "admin_notification",
/// "block",
/// },
/// },
/// });
/// }
///
/// }
/// ```
///
/// ## Import
///
/// As this is not a resource identifiable by an ID within the Auth0 Management API, guardian can be imported using a random string. We recommend [Version 4 UUID](https://www.uuidgenerator.net/version4) e.g.
///
/// ```sh
/// $ pulumi import auth0:index/attackProtection:AttackProtection default 24940d4b-4bd4-44e7-894e-f92e4de36a40
/// ```
/// </summary>
[Auth0ResourceType("auth0:index/attackProtection:AttackProtection")]
public partial class AttackProtection : Pulumi.CustomResource
{
/// <summary>
/// Breached password detection protects your applications from bad actors logging in with stolen credentials.
/// </summary>
[Output("breachedPasswordDetection")]
public Output<Outputs.AttackProtectionBreachedPasswordDetection> BreachedPasswordDetection { get; private set; } = null!;
/// <summary>
/// Safeguards against a single IP address attacking a single user account.
/// </summary>
[Output("bruteForceProtection")]
public Output<Outputs.AttackProtectionBruteForceProtection> BruteForceProtection { get; private set; } = null!;
/// <summary>
/// Suspicious IP throttling blocks traffic from any IP address that rapidly attempts too many logins or signups.
/// </summary>
[Output("suspiciousIpThrottling")]
public Output<Outputs.AttackProtectionSuspiciousIpThrottling> SuspiciousIpThrottling { get; private set; } = null!;
/// <summary>
/// Create a AttackProtection resource with the given unique name, arguments, and options.
/// </summary>
///
/// <param name="name">The unique name of the resource</param>
/// <param name="args">The arguments used to populate this resource's properties</param>
/// <param name="options">A bag of options that control this resource's behavior</param>
public AttackProtection(string name, AttackProtectionArgs? args = null, CustomResourceOptions? options = null)
: base("auth0:index/attackProtection:AttackProtection", name, args ?? new AttackProtectionArgs(), MakeResourceOptions(options, ""))
{
}
private AttackProtection(string name, Input<string> id, AttackProtectionState? state = null, CustomResourceOptions? options = null)
: base("auth0:index/attackProtection:AttackProtection", name, state, MakeResourceOptions(options, id))
{
}
private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input<string>? id)
{
var defaultOptions = new CustomResourceOptions
{
Version = Utilities.Version,
};
var merged = CustomResourceOptions.Merge(defaultOptions, options);
// Override the ID if one was specified for consistency with other language SDKs.
merged.Id = id ?? merged.Id;
return merged;
}
/// <summary>
/// Get an existing AttackProtection resource's state with the given name, ID, and optional extra
/// properties used to qualify the lookup.
/// </summary>
///
/// <param name="name">The unique name of the resulting resource.</param>
/// <param name="id">The unique provider ID of the resource to lookup.</param>
/// <param name="state">Any extra arguments used during the lookup.</param>
/// <param name="options">A bag of options that control this resource's behavior</param>
public static AttackProtection Get(string name, Input<string> id, AttackProtectionState? state = null, CustomResourceOptions? options = null)
{
return new AttackProtection(name, id, state, options);
}
}
public sealed class AttackProtectionArgs : Pulumi.ResourceArgs
{
/// <summary>
/// Breached password detection protects your applications from bad actors logging in with stolen credentials.
/// </summary>
[Input("breachedPasswordDetection")]
public Input<Inputs.AttackProtectionBreachedPasswordDetectionArgs>? BreachedPasswordDetection { get; set; }
/// <summary>
/// Safeguards against a single IP address attacking a single user account.
/// </summary>
[Input("bruteForceProtection")]
public Input<Inputs.AttackProtectionBruteForceProtectionArgs>? BruteForceProtection { get; set; }
/// <summary>
/// Suspicious IP throttling blocks traffic from any IP address that rapidly attempts too many logins or signups.
/// </summary>
[Input("suspiciousIpThrottling")]
public Input<Inputs.AttackProtectionSuspiciousIpThrottlingArgs>? SuspiciousIpThrottling { get; set; }
public AttackProtectionArgs()
{
}
}
public sealed class AttackProtectionState : Pulumi.ResourceArgs
{
/// <summary>
/// Breached password detection protects your applications from bad actors logging in with stolen credentials.
/// </summary>
[Input("breachedPasswordDetection")]
public Input<Inputs.AttackProtectionBreachedPasswordDetectionGetArgs>? BreachedPasswordDetection { get; set; }
/// <summary>
/// Safeguards against a single IP address attacking a single user account.
/// </summary>
[Input("bruteForceProtection")]
public Input<Inputs.AttackProtectionBruteForceProtectionGetArgs>? BruteForceProtection { get; set; }
/// <summary>
/// Suspicious IP throttling blocks traffic from any IP address that rapidly attempts too many logins or signups.
/// </summary>
[Input("suspiciousIpThrottling")]
public Input<Inputs.AttackProtectionSuspiciousIpThrottlingGetArgs>? SuspiciousIpThrottling { get; set; }
public AttackProtectionState()
{
}
}
}