-
Notifications
You must be signed in to change notification settings - Fork 598
/
api_types.go
384 lines (311 loc) · 13.8 KB
/
api_types.go
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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package fms
import (
"fmt"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
var _ aws.Config
var _ = awsutil.Prettify
// Details of the resource that is not protected by the policy.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/fms-2018-01-01/ComplianceViolator
type ComplianceViolator struct {
_ struct{} `type:"structure"`
// The resource ID.
ResourceId *string `min:"1" type:"string"`
// The resource type. This is in the format shown in AWS Resource Types Reference
// (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html).
// For example: AWS::ElasticLoadBalancingV2::LoadBalancer or AWS::CloudFront::Distribution.
ResourceType *string `min:"1" type:"string"`
// The reason that the resource is not protected by the policy.
ViolationReason ViolationReason `type:"string" enum:"true"`
}
// String returns the string representation
func (s ComplianceViolator) String() string {
return awsutil.Prettify(s)
}
// Describes the compliance status for the account. An account is considered
// non-compliant if it includes resources that are not protected by the specified
// policy.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/fms-2018-01-01/EvaluationResult
type EvaluationResult struct {
_ struct{} `type:"structure"`
// Describes an AWS account's compliance with the AWS Firewall Manager policy.
ComplianceStatus PolicyComplianceStatusType `type:"string" enum:"true"`
// Indicates that over 100 resources are non-compliant with the AWS Firewall
// Manager policy.
EvaluationLimitExceeded *bool `type:"boolean"`
// Number of resources that are non-compliant with the specified policy. A resource
// is considered non-compliant if it is not associated with the specified policy.
ViolatorCount *int64 `type:"long"`
}
// String returns the string representation
func (s EvaluationResult) String() string {
return awsutil.Prettify(s)
}
// An AWS Firewall Manager policy.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/fms-2018-01-01/Policy
type Policy struct {
_ struct{} `type:"structure"`
// Specifies the AWS account IDs to exclude from the policy. The IncludeMap
// values are evaluated first, with all the appropriate account IDs added to
// the policy. Then the accounts listed in ExcludeMap are removed, resulting
// in the final list of accounts to add to the policy.
//
// The key to the map is ACCOUNT. For example, a valid ExcludeMap would be {“ACCOUNT”
// : [“accountID1”, “accountID2”]}.
ExcludeMap map[string][]string `type:"map"`
// If set to True, resources with the tags that are specified in the ResourceTag
// array are not protected by the policy. If set to False, and the ResourceTag
// array is not null, only resources with the specified tags are associated
// with the policy.
//
// ExcludeResourceTags is a required field
ExcludeResourceTags *bool `type:"boolean" required:"true"`
// Specifies the AWS account IDs to include in the policy. If IncludeMap is
// null, all accounts in the organization in AWS Organizations are included
// in the policy. If IncludeMap is not null, only values listed in IncludeMap
// are included in the policy.
//
// The key to the map is ACCOUNT. For example, a valid IncludeMap would be {“ACCOUNT”
// : [“accountID1”, “accountID2”]}.
IncludeMap map[string][]string `type:"map"`
// The ID of the AWS Firewall Manager policy.
PolicyId *string `min:"36" type:"string"`
// The friendly name of the AWS Firewall Manager policy.
//
// PolicyName is a required field
PolicyName *string `min:"1" type:"string" required:"true"`
// A unique identifier for each update to the policy. When issuing a PutPolicy
// request, the PolicyUpdateToken in the request must match the PolicyUpdateToken
// of the current policy version. To get the PolicyUpdateToken of the current
// policy version, use a GetPolicy request.
PolicyUpdateToken *string `min:"1" type:"string"`
// Indicates if the policy should be automatically applied to new resources.
//
// RemediationEnabled is a required field
RemediationEnabled *bool `type:"boolean" required:"true"`
// An array of ResourceTag objects.
ResourceTags []ResourceTag `type:"list"`
// The type of resource to protect with the policy. This is in the format shown
// in AWS Resource Types Reference (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html).
// For example: AWS::ElasticLoadBalancingV2::LoadBalancer or AWS::CloudFront::Distribution.
//
// ResourceType is a required field
ResourceType *string `min:"1" type:"string" required:"true"`
// An array of ResourceType.
ResourceTypeList []string `type:"list"`
// Details about the security service that is being used to protect the resources.
//
// SecurityServicePolicyData is a required field
SecurityServicePolicyData *SecurityServicePolicyData `type:"structure" required:"true"`
}
// String returns the string representation
func (s Policy) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *Policy) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "Policy"}
if s.ExcludeResourceTags == nil {
invalidParams.Add(aws.NewErrParamRequired("ExcludeResourceTags"))
}
if s.PolicyId != nil && len(*s.PolicyId) < 36 {
invalidParams.Add(aws.NewErrParamMinLen("PolicyId", 36))
}
if s.PolicyName == nil {
invalidParams.Add(aws.NewErrParamRequired("PolicyName"))
}
if s.PolicyName != nil && len(*s.PolicyName) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("PolicyName", 1))
}
if s.PolicyUpdateToken != nil && len(*s.PolicyUpdateToken) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("PolicyUpdateToken", 1))
}
if s.RemediationEnabled == nil {
invalidParams.Add(aws.NewErrParamRequired("RemediationEnabled"))
}
if s.ResourceType == nil {
invalidParams.Add(aws.NewErrParamRequired("ResourceType"))
}
if s.ResourceType != nil && len(*s.ResourceType) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("ResourceType", 1))
}
if s.SecurityServicePolicyData == nil {
invalidParams.Add(aws.NewErrParamRequired("SecurityServicePolicyData"))
}
if s.ResourceTags != nil {
for i, v := range s.ResourceTags {
if err := v.Validate(); err != nil {
invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceTags", i), err.(aws.ErrInvalidParams))
}
}
}
if s.SecurityServicePolicyData != nil {
if err := s.SecurityServicePolicyData.Validate(); err != nil {
invalidParams.AddNested("SecurityServicePolicyData", err.(aws.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Describes the non-compliant resources in a member account for a specific
// AWS Firewall Manager policy. A maximum of 100 entries are displayed. If more
// than 100 resources are non-compliant, EvaluationLimitExceeded is set to True.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/fms-2018-01-01/PolicyComplianceDetail
type PolicyComplianceDetail struct {
_ struct{} `type:"structure"`
// Indicates if over 100 resources are non-compliant with the AWS Firewall Manager
// policy.
EvaluationLimitExceeded *bool `type:"boolean"`
// A time stamp that indicates when the returned information should be considered
// out-of-date.
ExpiredAt *time.Time `type:"timestamp"`
// Details about problems with dependent services, such as AWS WAF or AWS Config,
// that are causing a resource to be non-compliant. The details include the
// name of the dependent service and the error message received that indicates
// the problem with the service.
IssueInfoMap map[string]string `type:"map"`
// The AWS account ID.
MemberAccount *string `min:"1" type:"string"`
// The ID of the AWS Firewall Manager policy.
PolicyId *string `min:"36" type:"string"`
// The AWS account that created the AWS Firewall Manager policy.
PolicyOwner *string `min:"1" type:"string"`
// An array of resources that are not protected by the policy.
Violators []ComplianceViolator `type:"list"`
}
// String returns the string representation
func (s PolicyComplianceDetail) String() string {
return awsutil.Prettify(s)
}
// Indicates whether the account is compliant with the specified policy. An
// account is considered non-compliant if it includes resources that are not
// protected by the policy.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/fms-2018-01-01/PolicyComplianceStatus
type PolicyComplianceStatus struct {
_ struct{} `type:"structure"`
// An array of EvaluationResult objects.
EvaluationResults []EvaluationResult `type:"list"`
// Details about problems with dependent services, such as AWS WAF or AWS Config,
// that are causing a resource to be non-compliant. The details include the
// name of the dependent service and the error message received that indicates
// the problem with the service.
IssueInfoMap map[string]string `type:"map"`
// Time stamp of the last update to the EvaluationResult objects.
LastUpdated *time.Time `type:"timestamp"`
// The member account ID.
MemberAccount *string `min:"1" type:"string"`
// The ID of the AWS Firewall Manager policy.
PolicyId *string `min:"36" type:"string"`
// The friendly name of the AWS Firewall Manager policy.
PolicyName *string `min:"1" type:"string"`
// The AWS account that created the AWS Firewall Manager policy.
PolicyOwner *string `min:"1" type:"string"`
}
// String returns the string representation
func (s PolicyComplianceStatus) String() string {
return awsutil.Prettify(s)
}
// Details of the AWS Firewall Manager policy.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/fms-2018-01-01/PolicySummary
type PolicySummary struct {
_ struct{} `type:"structure"`
// The Amazon Resource Name (ARN) of the specified policy.
PolicyArn *string `min:"1" type:"string"`
// The ID of the specified policy.
PolicyId *string `min:"36" type:"string"`
// The friendly name of the specified policy.
PolicyName *string `min:"1" type:"string"`
// Indicates if the policy should be automatically applied to new resources.
RemediationEnabled *bool `type:"boolean"`
// The type of resource to protect with the policy. This is in the format shown
// in AWS Resource Types Reference (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html).
// For example: AWS::ElasticLoadBalancingV2::LoadBalancer or AWS::CloudFront::Distribution.
ResourceType *string `min:"1" type:"string"`
// The service that the policy is using to protect the resources. This specifies
// the type of policy that is created, either a WAF policy or Shield Advanced
// policy.
SecurityServiceType SecurityServiceType `type:"string" enum:"true"`
}
// String returns the string representation
func (s PolicySummary) String() string {
return awsutil.Prettify(s)
}
// The resource tags that AWS Firewall Manager uses to determine if a particular
// resource should be included or excluded from protection by the AWS Firewall
// Manager policy. Tags enable you to categorize your AWS resources in different
// ways, for example, by purpose, owner, or environment. Each tag consists of
// a key and an optional value, both of which you define. Tags are combined
// with an "OR." That is, if you add more than one tag, if any of the tags matches,
// the resource is considered a match for the include or exclude. Working with
// Tag Editor (https://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/tag-editor.html).
// Please also see https://docs.aws.amazon.com/goto/WebAPI/fms-2018-01-01/ResourceTag
type ResourceTag struct {
_ struct{} `type:"structure"`
// The resource tag key.
//
// Key is a required field
Key *string `min:"1" type:"string" required:"true"`
// The resource tag value.
Value *string `type:"string"`
}
// String returns the string representation
func (s ResourceTag) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *ResourceTag) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "ResourceTag"}
if s.Key == nil {
invalidParams.Add(aws.NewErrParamRequired("Key"))
}
if s.Key != nil && len(*s.Key) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("Key", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Details about the security service that is being used to protect the resources.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/fms-2018-01-01/SecurityServicePolicyData
type SecurityServicePolicyData struct {
_ struct{} `type:"structure"`
// Details about the service. This contains WAF data in JSON format, as shown
// in the following example:
//
// ManagedServiceData": "{\"type\": \"WAF\", \"ruleGroups\": [{\"id\": \"12345678-1bcd-9012-efga-0987654321ab\",
// \"overrideAction\" : {\"type\": \"COUNT\"}}], \"defaultAction\": {\"type\":
// \"BLOCK\"}}
//
// If this is a Shield Advanced policy, this string will be empty.
ManagedServiceData *string `min:"1" type:"string"`
// The service that the policy is using to protect the resources. This specifies
// the type of policy that is created, either a WAF policy or Shield Advanced
// policy.
//
// Type is a required field
Type SecurityServiceType `type:"string" required:"true" enum:"true"`
}
// String returns the string representation
func (s SecurityServicePolicyData) String() string {
return awsutil.Prettify(s)
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *SecurityServicePolicyData) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "SecurityServicePolicyData"}
if s.ManagedServiceData != nil && len(*s.ManagedServiceData) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("ManagedServiceData", 1))
}
if len(s.Type) == 0 {
invalidParams.Add(aws.NewErrParamRequired("Type"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}