mihari 0.2.3 → 0.2.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f889278f38a0195476bada5552aed27fc7b4525d18d09ea72d2c866cd88bce0
4
- data.tar.gz: 0de84d6148ae7cfeb16cd624a87fb4a52c6ea1c1129f791a7bf65ac39b74ef84
3
+ metadata.gz: 4c422cf04d9135c233e7bb474665fe5ed75d5b2fe3664066ff5a47eafd512a3f
4
+ data.tar.gz: 602a8869a041ec52b9bdf3553767bef221cdefd8b55336d0c61477575da7487c
5
5
  SHA512:
6
- metadata.gz: 2ba40effb75947195ac0d52f5e7564977839f884c1e22fca155416a9f0a67d503c1aca8cbc5156cb620ebfa9c0ca53f06b454d0e3d03b929827c3569e23559a3
7
- data.tar.gz: a5d99d000c47909f224696cf026091763ea064dc835596ae0f3f196bddd5c15513d98ce6dc8788ad0e6a3aa6516f7299058c6f725f228224564b4fb07645b586
6
+ metadata.gz: 7637aebdac55860402cffe0efbaa0bb2b67ff62630ad92e6b7fb42e78b19cc5d8ece769628f23611cb60aa8a409d0318542f5d32b213414b884d1f71c6c8e65e
7
+ data.tar.gz: e94ac2d667733c356664afb6f439fc9eca967eb70fc3e7b010915aed5f461fdab678a17e1064bb028c4f68e492bdb818f8a2aa07b748cbda5f0abbb0dfa391a2
@@ -22,7 +22,7 @@ module Mihari
22
22
  @api = ::Censys::API.new
23
23
  @query = query
24
24
  @title = "Censys lookup"
25
- @description = "Query: #{query}"
25
+ @description = "query = #{query}"
26
26
  @tags = tags
27
27
  end
28
28
 
@@ -17,7 +17,7 @@ module Mihari
17
17
  @api = ::Onyphe::API.new
18
18
  @query = query
19
19
  @title = "Onyphe lookup"
20
- @description = "Query: #{query}"
20
+ @description = "query = #{query}"
21
21
  @tags = tags
22
22
  end
23
23
 
@@ -17,7 +17,7 @@ module Mihari
17
17
  @api = ::Shodan::API.new
18
18
  @query = query
19
19
  @title = "Shodan lookup"
20
- @description = "Query: #{query}"
20
+ @description = "query = #{query}"
21
21
  @tags = tags
22
22
  end
23
23
 
@@ -6,7 +6,7 @@ require "json"
6
6
  module Mihari
7
7
  class CLI < Thor
8
8
  desc "censys [QUERY]", "Censys IPv4 lookup by a given query"
9
- method_option :tags, type: :array, default: [], desc: "tags"
9
+ method_option :tags, type: :array, desc: "tags"
10
10
  def censys(query)
11
11
  tags = options.dig("tags") || []
12
12
  with_error_handling do
@@ -26,7 +26,7 @@ module Mihari
26
26
  end
27
27
 
28
28
  desc "onyphe [QUERY]", "Onyphe datascan lookup by a given query"
29
- method_option :tags, type: :array, default: [], desc: "tags"
29
+ method_option :tags, type: :array, desc: "tags"
30
30
  def onyphe(query)
31
31
  tags = options.dig("tags") || []
32
32
  with_error_handling do
@@ -125,13 +125,14 @@ module Mihari
125
125
  end.flatten
126
126
  end
127
127
 
128
- def notify(title:, description:, artifacts:)
128
+ def notify(title:, description:, artifacts:, tags:)
129
129
  return if artifacts.empty?
130
130
 
131
131
  attachments = to_attachments(artifacts)
132
+ tags << ["N/A"] if tags.empty?
132
133
 
133
134
  slack = ::Slack::Incoming::Webhooks.new(slack_webhook_url, channel: slack_channel)
134
- slack.post("#{title} (#{description})", attachments: attachments)
135
+ slack.post("#{title} (desc.: #{description} / tags: #{tags.join(', ')})", attachments: attachments)
135
136
  end
136
137
  end
137
138
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mihari
4
- VERSION = "0.2.3"
4
+ VERSION = "0.2.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mihari
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manabu Niseki