fluent-plugin-sdns-api 0.1.1 → 0.1.3
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/fluent-plugin-sdns-api.gemspec +1 -1
- data/lib/fluent/plugin/in_sdns_api.rb +9 -10
- data/test/plugin/test_aksk_signer.rb +1 -1
- data/test/plugin/test_in_sdns_api.rb +3 -3
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a92d2a0115f48be5f53305954c9b8e87e64a508b0b6365a16a9fe1b99f95c260
|
|
4
|
+
data.tar.gz: 137f8d82a661dd2b27b446aee8700e662f4a69880e5b288ad95698ab656913c2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2ac79469be0604495006ce4c60f2590c7a02a1cd24dc4c3f59522911494e9306418092383e50a263083847cdd489eb5f576b8c0964d971567e717b93844a9d57
|
|
7
|
+
data.tar.gz: 7ffb17cf664ba48b99e3b64ee57d02b5100fe7cec682ea579d03f4e30d10b40d0c06512f36c0d8739cc82429647d80d603a7ce1d00eeaa601318a8d3debae9c9
|
|
@@ -94,8 +94,8 @@ module Fluent
|
|
|
94
94
|
query["page_size"] = @page_size
|
|
95
95
|
query["domain"] = @domain if @domain != ""
|
|
96
96
|
query["client_ip"] = @client_ip if @client_ip != ""
|
|
97
|
-
query["
|
|
98
|
-
query["
|
|
97
|
+
query["zone_id"] = @security_zone_id if @security_zone_id != ""
|
|
98
|
+
query["severity"] = @threat_level if @threat_level.length > 0
|
|
99
99
|
|
|
100
100
|
uri_parse.query = URI.encode_www_form(query)
|
|
101
101
|
uri_parse.to_s
|
|
@@ -138,18 +138,17 @@ module Fluent
|
|
|
138
138
|
record = {
|
|
139
139
|
"query_timestamp" => item["query_timestamp"],
|
|
140
140
|
"query_time_format" => item["query_time_format"],
|
|
141
|
-
"security_zone_id" => item["
|
|
142
|
-
"security_zone_name" => item["
|
|
141
|
+
"security_zone_id" => item["zone_id"],
|
|
142
|
+
"security_zone_name" => item["zone_name"],
|
|
143
143
|
"client_ip" => item["client_ip"],
|
|
144
144
|
"client_port" => item["client_port"],
|
|
145
145
|
"domain" => item["domain"],
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"threat_level" => item["threat_level"],
|
|
146
|
+
"ioc" => item["ioc"],
|
|
147
|
+
"threat_level" => item["severity"],
|
|
149
148
|
"threat_type" => item["threat_type"],
|
|
150
|
-
"
|
|
151
|
-
"
|
|
152
|
-
"
|
|
149
|
+
"threat_name" => item["threat_name"],
|
|
150
|
+
"threat_description" => item["threat_description"].gsub("\n", '\\n').gsub("\t", '\\t'),
|
|
151
|
+
"action" => item["action"],
|
|
153
152
|
}
|
|
154
153
|
es = OneEventStream.new(Fluent::EventTime.now, record)
|
|
155
154
|
router.emit_stream(@tag, es)
|
|
@@ -11,7 +11,7 @@ class SdnsApiSignerTest < Test::Unit::TestCase
|
|
|
11
11
|
sig.key = "Fad3mbhh9NwadtEd7t0ekFp5HwrNJiDc" # test key
|
|
12
12
|
sig.secret = "5MLR15LYGn8IeTHQwPs7tZyJslGqNZmYI6g8eHETGrWZYZ6J7U9Ak8CrRlSyCEMT"
|
|
13
13
|
|
|
14
|
-
r = Fluent::Plugin::SdnsApiSinger::HttpRequest.new("GET", "https://
|
|
14
|
+
r = Fluent::Plugin::SdnsApiSinger::HttpRequest.new("GET", "https://xxx.net/apis/grpc/v2/ListThreatDetail")
|
|
15
15
|
r.headers = {"content-type" => "application/json"}
|
|
16
16
|
|
|
17
17
|
r.body = ''
|
|
@@ -10,7 +10,7 @@ class SdnsApiListThreatDetailInputTest < Test::Unit::TestCase
|
|
|
10
10
|
CONFIG = %[
|
|
11
11
|
client_ip '1.1.1.1'
|
|
12
12
|
access_key 'xxx'
|
|
13
|
-
endpoint 'https://
|
|
13
|
+
endpoint 'https://xxx.net/apis/grpc/v2/ListThreatDetail'
|
|
14
14
|
access_secret 'sdf'
|
|
15
15
|
]
|
|
16
16
|
|
|
@@ -37,7 +37,7 @@ class SdnsApiListThreatDetailInputTest < Test::Unit::TestCase
|
|
|
37
37
|
d = create_driver(%[
|
|
38
38
|
access_key 'L2guCE9mRsuvUhNxUDKfgjKR083RqIFB'
|
|
39
39
|
access_secret 'Vy4HrnHHZdewCkeQ9pHeiN6repMUgzjeoP2mqzMCVY2Hbne0k4jlKzZ10unYIKo5'
|
|
40
|
-
endpoint 'https://
|
|
40
|
+
endpoint 'https://xxx.net/apis/grpc/v2/ListThreatDetail'
|
|
41
41
|
page_size 20
|
|
42
42
|
scrape_interval 600
|
|
43
43
|
])
|
|
@@ -55,7 +55,7 @@ class SdnsApiListThreatDetailInputTest < Test::Unit::TestCase
|
|
|
55
55
|
d = create_driver(%[
|
|
56
56
|
access_key 'L2guCE9mRsuvUhNxUDKfgjKR083RqIFB'
|
|
57
57
|
access_secret 'Vy4HrnHHZdewCkeQ9pHeiN6repMUgzjeoP2mqzMCVY2Hbne0k4jlKzZ10unYIKo5'
|
|
58
|
-
endpoint 'https://
|
|
58
|
+
endpoint 'https://xxx.net/apis/grpc/v2/ListThreatDetail'
|
|
59
59
|
page_size 100
|
|
60
60
|
scrape_interval 600
|
|
61
61
|
])
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fluent-plugin-sdns-api
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- yinqiwei
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-07-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -110,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
110
110
|
- !ruby/object:Gem::Version
|
|
111
111
|
version: '0'
|
|
112
112
|
requirements: []
|
|
113
|
-
rubygems_version: 3.
|
|
113
|
+
rubygems_version: 3.1.2
|
|
114
114
|
signing_key:
|
|
115
115
|
specification_version: 4
|
|
116
116
|
summary: Input Plugin for Fluentd.
|