logstash-filter-greynoise 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/README.md +49 -53
- data/lib/logstash/filters/greynoise.rb +10 -8
- data/logstash-filter-greynoise.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9c27e1e995ecc1c5eb06382c173f31525c1e929
|
4
|
+
data.tar.gz: 5dd09c34b1dd17d1a0d25f2cd6cfa394d7aed80a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '058f7663ec7490210c0c8d44e94494dbfa4e7c045825e25eea9bc50ca69080c33c073eacca36689fb78824dcadc316ff487c7ecae0c9d13a107a468b370738bf'
|
7
|
+
data.tar.gz: 6e3f98269362576b32ad8fe1f15b82ea990c0263963523928104e8a97b60617b4b3720bd4fb71b9455658f6f4c066d46da84ffedc6ecd6b7bb101177693735c8
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,79 +1,75 @@
|
|
1
|
-
# Logstash
|
1
|
+
# Logstash REST Filter [![Build Status](https://travis-ci.org/logstash-plugins/logstash-filter-http.svg?branch=master)](https://travis-ci.org/logstash-plugins/logstash-filter-http)
|
2
2
|
|
3
|
-
This is a plugin for [Logstash](https://github.com/elastic/logstash).
|
3
|
+
This is a filter plugin for [Logstash](https://github.com/elastic/logstash).
|
4
4
|
|
5
5
|
It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
|
6
6
|
|
7
7
|
## Documentation
|
8
8
|
|
9
|
-
|
9
|
+
The Greynoise filter adds information about IP addresses from logstash events via the Greynoise API.
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
GreyNoise is a system that collects and analyzes data on Internet-wide scanners.
|
12
|
+
GreyNoise collects data on benign scanners such as Shodan.io, as well as malicious actors like SSH and telnet worms.
|
13
13
|
|
14
|
-
##
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
### 1. Plugin Developement and Testing
|
21
|
-
|
22
|
-
#### Code
|
23
|
-
- To get started, you'll need JRuby with the Bundler gem installed.
|
24
|
-
|
25
|
-
- Create a new plugin or clone and existing from the GitHub [logstash-plugins](https://github.com/logstash-plugins) organization. We also provide [example plugins](https://github.com/logstash-plugins?query=example).
|
14
|
+
## Usage
|
15
|
+
### 1. Installation
|
16
|
+
You can use the built-in plugin tool of Logstash to install the filter:
|
17
|
+
```
|
18
|
+
$LS_HOME/bin/logstash-plugin install logstash-filter-greynoise
|
19
|
+
```
|
26
20
|
|
27
|
-
|
28
|
-
```
|
21
|
+
Or you can build it yourself:
|
22
|
+
```
|
23
|
+
git clone https://github.com/nsherron90/logstash-filter-greynoise.git
|
29
24
|
bundle install
|
25
|
+
gem build logstash-filter-greynoise.gemspec
|
26
|
+
$LS_HOME/bin/logstash-plugin install logstash-filter-greynoise-0.1.1.gem
|
30
27
|
```
|
31
28
|
|
32
|
-
|
33
|
-
|
34
|
-
- Update your dependencies
|
29
|
+
### 2. Filter Configuration
|
30
|
+
Add the following inside the filter section of your logstash configuration:
|
35
31
|
|
36
32
|
```sh
|
37
|
-
|
33
|
+
filter {
|
34
|
+
greynoise {
|
35
|
+
ip => "ip_value" # string (required, reference to ip address field)
|
36
|
+
key => "your_greynoise_key" # string (optional, no default)
|
37
|
+
target => "greynoise" # string (optional, default = greynoise)
|
38
|
+
}
|
39
|
+
}
|
38
40
|
```
|
39
41
|
|
40
|
-
|
42
|
+
Print plugin version:
|
41
43
|
|
42
|
-
```
|
43
|
-
|
44
|
+
``` bash
|
45
|
+
bin/logstash-plugin list --verbose | grep greynoise
|
44
46
|
```
|
45
47
|
|
46
|
-
|
48
|
+
Example for running logstash from `cli`:
|
47
49
|
|
48
|
-
|
50
|
+
``` bash
|
51
|
+
bin/logstash --debug -e \
|
52
|
+
'input {
|
53
|
+
stdin {}
|
54
|
+
}
|
49
55
|
|
50
|
-
- Edit Logstash `Gemfile` and add the local plugin path, for example:
|
51
|
-
```ruby
|
52
|
-
gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
|
53
|
-
```
|
54
|
-
- Install plugin
|
55
|
-
```sh
|
56
|
-
bin/logstash-plugin install --no-verify
|
57
|
-
```
|
58
|
-
- Run Logstash with your plugin
|
59
|
-
```sh
|
60
|
-
bin/logstash -e 'filter {awesome {}}'
|
61
|
-
```
|
62
|
-
At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.
|
63
|
-
|
64
|
-
#### 2.2 Run in an installed Logstash
|
65
56
|
|
66
|
-
|
57
|
+
filter {
|
58
|
+
greynoise {
|
59
|
+
ip => "%{message}"
|
60
|
+
}
|
61
|
+
}
|
67
62
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
63
|
+
output {
|
64
|
+
stdout {
|
65
|
+
codec => rubydebug {
|
66
|
+
metadata => true
|
67
|
+
}
|
68
|
+
}
|
69
|
+
}'
|
75
70
|
```
|
76
|
-
|
71
|
+
|
72
|
+
|
77
73
|
|
78
74
|
## Contributing
|
79
75
|
|
@@ -83,4 +79,4 @@ Programming is not a required skill. Whatever you've seen about open source and
|
|
83
79
|
|
84
80
|
It is more important to the community that you are able to contribute.
|
85
81
|
|
86
|
-
For more information about contributing, see the [CONTRIBUTING](https://github.com/
|
82
|
+
For more information about contributing, see the [CONTRIBUTING](https://github.com/elasticsearch/logstash/blob/master/CONTRIBUTING.md) file.
|
@@ -14,17 +14,19 @@ class LogStash::Filters::Greynoise < LogStash::Filters::Base
|
|
14
14
|
# Setting the config_name here is required. This is how you
|
15
15
|
# configure this filter from your Logstash config.
|
16
16
|
#
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
17
|
+
# filter {
|
18
|
+
# greynoise {
|
19
|
+
# ip => "ip"
|
20
|
+
# }
|
21
|
+
# }
|
22
|
+
|
23
23
|
config_name "greynoise"
|
24
24
|
|
25
25
|
# Replace the message with this value.
|
26
|
-
|
26
|
+
|
27
27
|
config :ip, :validate => :string, :required => true
|
28
|
+
config :key, :validate => :string, :required => false
|
29
|
+
config :target, :validate => :string, :default => "greynoise"
|
28
30
|
|
29
31
|
|
30
32
|
|
@@ -48,7 +50,7 @@ class LogStash::Filters::Greynoise < LogStash::Filters::Base
|
|
48
50
|
|
49
51
|
result = JSON.parse(response.body)
|
50
52
|
|
51
|
-
event.set(
|
53
|
+
event.set(@target, result)
|
52
54
|
# filter_matched should go in the last line of our successful code
|
53
55
|
filter_matched(event)
|
54
56
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-filter-greynoise'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.1'
|
4
4
|
s.licenses = ['Apache-2.0']
|
5
5
|
s.summary = 'This greynoise filter takes contents in the ip field and returns greynoise api data (see https://greynoise.io/ for more info).'
|
6
6
|
s.description = 'This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install logstash-filter-greynoise. This gem is not a stand-alone program'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-greynoise
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nsherron90
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-04-
|
11
|
+
date: 2019-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|