mihari 0.17.3 → 0.17.4

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
  SHA256:
3
- metadata.gz: 4cb8eb51d1aeff148fce824719c4c6b7730a19cc4c69434318cef07c26cf6b81
4
- data.tar.gz: 8442809cef20850e40f203ee1dd91a448846c372d3595fae0c35429b4209795a
3
+ metadata.gz: 6a2088860e89b6cfa7ead2c47b1589ee19d6cb388051e1f5f0325c3b8eab9184
4
+ data.tar.gz: de9a0261e8ede8ff2bd6f93f236fd1d2eee2f8dfa7d8125e9ff2ad2b0c2089ba
5
5
  SHA512:
6
- metadata.gz: 5b772bace499921b8ddd53f09a9a908e143cfff6ac21604c31656f8313d850c2a5b588048e913ef8d51cb0c8efacc1a5babcca8b649f73b729a324565d2543a4
7
- data.tar.gz: db0c6ef09b91a6fe15be0412f0b980246bbe049c58f19e2bc79ce17f8ed7956e027e6d072983db7fe49581083821a2728a27e5df1c42c723c69618bdc4ac0792
6
+ metadata.gz: 12d2823b24f99989e44a8001e50b20222a1cfea8905a2c375365ff27eb4603f0e7aaf36fcdb53aa350d30ca5774622b22f85e2c2aa049d219ea89ec154783753
7
+ data.tar.gz: 9fdc2753b2d480a453867e83d9c11bebf4f376aaaddfd55696569ab2c41af6386c55e2f4d08ad5976439787676fca32cd2dba13ce80c2dbc65ff0dbe693bf8a0
@@ -9,19 +9,23 @@ module Mihari
9
9
  attr_reader :description
10
10
  attr_reader :query
11
11
  attr_reader :tags
12
+ attr_reader :exclude_expired
12
13
 
13
- def initialize(query, title: nil, description: nil, tags: [])
14
+ def initialize(query, title: nil, description: nil, tags: [], exclude_expired: nil)
14
15
  super()
15
16
 
16
17
  @query = query
17
18
  @title = title || "crt.sh lookup"
18
19
  @description = description || "query = #{query}"
19
20
  @tags = tags
21
+
22
+ @exclude_expired = exclude_expired.nil? ? true : exclude_expired
20
23
  end
21
24
 
22
25
  def artifacts
23
26
  results = search
24
- results.map { |result| result.dig("name_value") }.compact.uniq
27
+ name_values = results.map { |result| result.dig("name_value") }.compact
28
+ name_values.map(&:lines).flatten.uniq.map(&:chomp)
25
29
  end
26
30
 
27
31
  private
@@ -31,7 +35,8 @@ module Mihari
31
35
  end
32
36
 
33
37
  def search
34
- api.search(query)
38
+ exclude = exclude_expired ? "expired" : nil
39
+ api.search(query, exclude: exclude)
35
40
  rescue ::Crtsh::Error => _e
36
41
  []
37
42
  end
@@ -86,6 +86,7 @@ module Mihari
86
86
  method_option :title, type: :string, desc: "title"
87
87
  method_option :description, type: :string, desc: "description"
88
88
  method_option :tags, type: :array, desc: "tags"
89
+ method_option :exclude_expired, type: :boolean, desc: "exclude expired certificates"
89
90
  def crtsh(query)
90
91
  with_error_handling do
91
92
  run_analyzer Analyzers::Crtsh, query: query, options: options
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mihari
4
- VERSION = "0.17.3"
4
+ VERSION = "0.17.4"
5
5
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
 
27
27
  spec.add_development_dependency "bundler", "~> 2.1"
28
28
  spec.add_development_dependency "coveralls", "~> 0.8"
29
- spec.add_development_dependency "fakefs", "~> 0.20"
29
+ spec.add_development_dependency "fakefs", "~> 1.0"
30
30
  spec.add_development_dependency "rake", "~> 13.0"
31
31
  spec.add_development_dependency "rspec", "~> 3.9"
32
32
  spec.add_development_dependency "timecop", "~> 0.9"
@@ -36,11 +36,11 @@ Gem::Specification.new do |spec|
36
36
  spec.add_dependency "addressable", "~> 2.7"
37
37
  spec.add_dependency "binaryedge", "~> 0.1"
38
38
  spec.add_dependency "censu", "~> 0.2"
39
- spec.add_dependency "crtsh-rb", "~> 0.1"
39
+ spec.add_dependency "crtsh-rb", "~> 0.2"
40
40
  spec.add_dependency "dnpedia", "~> 0.1"
41
41
  spec.add_dependency "dnstwister", "~> 0.1"
42
42
  spec.add_dependency "email_address", "~> 0.1"
43
- spec.add_dependency "hachi", "~> 0.2"
43
+ spec.add_dependency "hachi", "~> 0.3"
44
44
  spec.add_dependency "lightly", "~> 0.3"
45
45
  spec.add_dependency "mem", "~> 0.1"
46
46
  spec.add_dependency "misp", "~> 0.1"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mihari
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.3
4
+ version: 0.17.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manabu Niseki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-01 00:00:00.000000000 Z
11
+ date: 2020-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.20'
47
+ version: '1.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.20'
54
+ version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -170,14 +170,14 @@ dependencies:
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '0.1'
173
+ version: '0.2'
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '0.1'
180
+ version: '0.2'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: dnpedia
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -226,14 +226,14 @@ dependencies:
226
226
  requirements:
227
227
  - - "~>"
228
228
  - !ruby/object:Gem::Version
229
- version: '0.2'
229
+ version: '0.3'
230
230
  type: :runtime
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
234
  - - "~>"
235
235
  - !ruby/object:Gem::Version
236
- version: '0.2'
236
+ version: '0.3'
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: lightly
239
239
  requirement: !ruby/object:Gem::Requirement