fluent-plugin-aws_waf_ip_sets 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +57 -5
- data/fluent-plugin-aws_waf_ip_sets.gemspec +1 -1
- data/lib/fluent/plugin/out_aws_waf_ip_sets.rb +15 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4d8a651f5bd77b6945801ea0cfd49e0c29c2393
|
4
|
+
data.tar.gz: bac6165e4e0a14746c5c3e9832ba7ce9536c99b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 138710332c2ea1f8c8ae94b58704d68cc1babd3a36cdecafadf7d2e8d64e2121ca092aba6b1beeadd3f05d347abfb87e5188e55293da3b0e1fee265776530937
|
7
|
+
data.tar.gz: ba0d461211a7f28105e741688d684733772c85ae6491a1429aa23ae26942ec9cd3f53abe30b2633b682ca23e476836bbc6379e4bdf4e5bd961e264260f03a541
|
data/README.md
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
# fluent-plugin-aws_waf_ip_sets
|
2
2
|
<!-- [](http://travis-ci.org/toyama0919/fluent-plugin-aws_waf_ip_sets) -->
|
3
|
+
[](http://badge.fury.io/rb/fluent-plugin-aws_waf_ip_sets)
|
3
4
|
|
4
5
|
AWS waf ip_sets automation plugin for fluentd
|
5
6
|
|
6
|
-
## Examples
|
7
|
+
## Examples(interval one minutes)
|
7
8
|
```
|
8
9
|
<match lambda.**>
|
9
10
|
@type aws_waf_ip_sets
|
@@ -18,20 +19,71 @@ AWS waf ip_sets automation plugin for fluentd
|
|
18
19
|
</match>
|
19
20
|
```
|
20
21
|
|
22
|
+
## interval
|
23
|
+
|
24
|
+
### 1 minutes
|
25
|
+
|
26
|
+
```
|
27
|
+
time_slice_format %Y%m%d_%H%M
|
28
|
+
```
|
29
|
+
|
30
|
+
### 1 hours
|
31
|
+
|
32
|
+
```
|
33
|
+
time_slice_format %Y%m%d%H
|
34
|
+
```
|
35
|
+
|
36
|
+
### 12 hours
|
37
|
+
|
38
|
+
```
|
39
|
+
time_slice_format %Y%m%d%p
|
40
|
+
```
|
41
|
+
|
42
|
+
### 1 days
|
43
|
+
|
44
|
+
```
|
45
|
+
time_slice_format %Y%m%d
|
46
|
+
```
|
47
|
+
|
48
|
+
### 1 weeks
|
49
|
+
|
50
|
+
```
|
51
|
+
time_slice_format %Y%m%w
|
52
|
+
```
|
53
|
+
|
21
54
|
## parameter
|
22
55
|
|
23
|
-
|
56
|
+
#### ip_address_key
|
24
57
|
* ip address key of record
|
25
58
|
|
26
|
-
|
59
|
+
#### dos_threshold
|
27
60
|
* threshold
|
28
61
|
|
29
|
-
|
62
|
+
#### ip_set_id
|
30
63
|
* AWS waf ip_set_id
|
31
64
|
|
32
|
-
|
65
|
+
#### white_list
|
33
66
|
* white list ip address (comma separated values)
|
34
67
|
|
68
|
+
#### ip_set_type
|
69
|
+
* IPV4 or IPV6
|
70
|
+
|
71
|
+
#### api_type
|
72
|
+
* waf or waf_regional
|
73
|
+
|
74
|
+
#### aws_access_key_id
|
75
|
+
* support iam role.
|
76
|
+
* support environment variables.
|
77
|
+
|
78
|
+
#### aws_secret_access_key
|
79
|
+
* support iam role.
|
80
|
+
* support environment variables.
|
81
|
+
|
82
|
+
#### aws_region
|
83
|
+
* support iam role.
|
84
|
+
* support environment variables.
|
85
|
+
|
86
|
+
|
35
87
|
## Installation
|
36
88
|
```
|
37
89
|
fluent-gem install fluent-plugin-aws_waf_ip_sets
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = "fluent-plugin-aws_waf_ip_sets"
|
5
|
-
gem.version = "0.0.
|
5
|
+
gem.version = "0.0.2"
|
6
6
|
gem.summary = %q{AWS waf ip_sets automation plugin for fluentd}
|
7
7
|
gem.description = %q{AWS waf ip_sets automation plugin for fluentd}
|
8
8
|
gem.license = "MIT"
|
@@ -3,8 +3,12 @@ module Fluent
|
|
3
3
|
Fluent::Plugin.register_output('aws_waf_ip_sets', self)
|
4
4
|
config_param :ip_address_key, :string
|
5
5
|
config_param :dos_threshold, :integer
|
6
|
+
config_param :aws_access_key_id, :string, :default => nil
|
7
|
+
config_param :aws_secret_access_key, :string, :default => nil
|
8
|
+
config_param :aws_region, :string, :default => nil
|
6
9
|
config_param :ip_set_id, :string
|
7
10
|
config_param :ip_set_type, :enum, list: [:IPV4, :IPV6], :default => 'IPV4'
|
11
|
+
config_param :api_type, :enum, list: [:waf, :waf_regional], :default => 'waf_regional'
|
8
12
|
config_param :white_list, :string, :default => '127.0.0.1'
|
9
13
|
|
10
14
|
def initialize
|
@@ -20,7 +24,17 @@ module Fluent
|
|
20
24
|
|
21
25
|
def start
|
22
26
|
super
|
23
|
-
|
27
|
+
options = {}
|
28
|
+
options[:region] = @aws_region if @aws_region
|
29
|
+
options[:access_key_id] = @aws_access_key_id if @aws_access_key_id
|
30
|
+
options[:secret_access_key] = @aws_secret_access_key if @aws_secret_access_key
|
31
|
+
@client = if @api_type == 'waf'
|
32
|
+
Aws::WAF::Client.new(options)
|
33
|
+
elsif @api_type == 'waf_regional'
|
34
|
+
Aws::WAFRegional::Client.new(options)
|
35
|
+
else
|
36
|
+
raise Fluent::ConfigError, "unknown @api_type => [#{@api_type}]"
|
37
|
+
end
|
24
38
|
end
|
25
39
|
|
26
40
|
def shutdown
|