fluent-plugin-aws_waf_ip_sets 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 90a886b4611ee28a83cb80adfb6f34f628a61dc2
4
- data.tar.gz: d8410c97f37fd33d178da76266c0287cad0fe690
3
+ metadata.gz: c4d8a651f5bd77b6945801ea0cfd49e0c29c2393
4
+ data.tar.gz: bac6165e4e0a14746c5c3e9832ba7ce9536c99b2
5
5
  SHA512:
6
- metadata.gz: 60636815733336b62ff26078c67111f3ebcbd6371aef9c019110383a7747aded621ea4b5821bdfe47f7c3740c20afd832fd3d843bf1072fa7b5b78db827256ee
7
- data.tar.gz: e367172e7de02baa09c4caface5569b79853aa7e1916d1a193df1380ad6a92e4ddef533650f3143b586178428632305b8fed53602130ce032e587f3c41fe2a08
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
  <!-- [![Build Status](https://secure.travis-ci.org/toyama0919/fluent-plugin-aws_waf_ip_sets.png?branch=master)](http://travis-ci.org/toyama0919/fluent-plugin-aws_waf_ip_sets) -->
3
+ [![Gem Version](https://badge.fury.io/rb/fluent-plugin-aws_waf_ip_sets.svg)](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
- * ip_address_key
56
+ #### ip_address_key
24
57
  * ip address key of record
25
58
 
26
- * dos_threshold
59
+ #### dos_threshold
27
60
  * threshold
28
61
 
29
- * ip_set_id
62
+ #### ip_set_id
30
63
  * AWS waf ip_set_id
31
64
 
32
- * white_list
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.1"
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
- @client = Aws::WAFRegional::Client.new
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-aws_waf_ip_sets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroshi Toyama