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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3b64201b6ac0532119871fc1cfc37259200e7477
4
- data.tar.gz: f3ae39a58ea2ef70f6fd336cc21bda194248208c
3
+ metadata.gz: f9c27e1e995ecc1c5eb06382c173f31525c1e929
4
+ data.tar.gz: 5dd09c34b1dd17d1a0d25f2cd6cfa394d7aed80a
5
5
  SHA512:
6
- metadata.gz: a027c800ed100e45e1bab4edeb37c505e4a54596914ae167cc9504e95afc867e44ffc97b2381630fd0a359a3a07eb52cdfff02994a966c5eab6802b0b2e93f3c
7
- data.tar.gz: 3a575121c37a4cbe6b2c65c74738d0cf266c0218808c85a98b3321d177ea3a81f92c6bacab999819c18947564ee8bf7d28d747e687b9288bb40bb2fa619b29c2
6
+ metadata.gz: '058f7663ec7490210c0c8d44e94494dbfa4e7c045825e25eea9bc50ca69080c33c073eacca36689fb78824dcadc316ff487c7ecae0c9d13a107a468b370738bf'
7
+ data.tar.gz: 6e3f98269362576b32ad8fe1f15b82ea990c0263963523928104e8a97b60617b4b3720bd4fb71b9455658f6f4c066d46da84ffedc6ecd6b7bb101177693735c8
data/CHANGELOG.md CHANGED
@@ -1,2 +1,4 @@
1
1
  ## 0.1.0
2
2
  - Plugin created with the logstash plugin generator
3
+ ## 0.1.1
4
+ - Added target field for output
data/README.md CHANGED
@@ -1,79 +1,75 @@
1
- # Logstash Plugin
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
- Logstash provides infrastructure to automatically generate documentation for this plugin. We use the asciidoc format to write documentation so any comments in the source code will be first converted into asciidoc and then into html. All plugin documentation are placed under one [central location](http://www.elastic.co/guide/en/logstash/current/).
9
+ The Greynoise filter adds information about IP addresses from logstash events via the Greynoise API.
10
10
 
11
- - For formatting code or config example, you can use the asciidoc `[source,ruby]` directive
12
- - For more asciidoc formatting tips, see the excellent reference here https://github.com/elastic/docs#asciidoc-guide
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
- ## Need Help?
15
-
16
- Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/logstash discussion forum.
17
-
18
- ## Developing
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
- - Install dependencies
28
- ```sh
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
- #### Test
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
- bundle install
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
- - Run tests
42
+ Print plugin version:
41
43
 
42
- ```sh
43
- bundle exec rspec
44
+ ``` bash
45
+ bin/logstash-plugin list --verbose | grep greynoise
44
46
  ```
45
47
 
46
- ### 2. Running your unpublished Plugin in Logstash
48
+ Example for running logstash from `cli`:
47
49
 
48
- #### 2.1 Run in a local Logstash clone
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
- You can use the same **2.1** method to run your plugin in an installed Logstash by editing its `Gemfile` and pointing the `:path` to your local plugin development directory or you can build the gem and install it using:
57
+ filter {
58
+ greynoise {
59
+ ip => "%{message}"
60
+ }
61
+ }
67
62
 
68
- - Build your plugin gem
69
- ```sh
70
- gem build logstash-filter-awesome.gemspec
71
- ```
72
- - Install the plugin from the Logstash home
73
- ```sh
74
- bin/logstash-plugin install /your/local/plugin/logstash-filter-awesome.gem
63
+ output {
64
+ stdout {
65
+ codec => rubydebug {
66
+ metadata => true
67
+ }
68
+ }
69
+ }'
75
70
  ```
76
- - Start Logstash and proceed to test the plugin
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/elastic/logstash/blob/master/CONTRIBUTING.md) file.
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
- # filter {
18
- # {
19
- # message => "My message..."
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
- config :key, :validate => :string, :required => false
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('greynoise', result)
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.0'
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.0
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-22 00:00:00.000000000 Z
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