/
jupyter.rb
71 lines (70 loc) · 2.23 KB
/
jupyter.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
module Intrigue
module Ident
module Check
class Jupyter < Intrigue::Ident::Check::Base
def generate_checks(url)
[
{
type: 'fingerprint',
category: 'application',
tags: %w[COTS Development],
vendor: 'Jupyter',
product: 'Notebook',
website: 'https://jupyter.org/',
description: 'matched jupyterhub header',
version: nil,
match_logic: :all,
matches: [
{
match_type: :content_headers,
match_content: /x-jupyterhub-version:/i,
}
],
dynamic_version: ->(x) { _first_header_capture(x, /^x-jupyterhub-version: (.*)$/) },
paths: [{ path: url.to_s, follow_redirects: true }],
inference: true
},
{
type: 'fingerprint',
category: 'application',
tags: %w[COTS Development],
vendor: 'Jupyter',
product: 'Notebook',
website: 'https://jupyter.org/',
version: nil,
match_logic: :all,
matches: [
{
match_type: :content_body,
match_content: /data-notebook-path:/i,
}
],
description: 'unique body string: data-notebook-path',
paths: [{ path: url.to_s, follow_redirects: true }],
inference: false
},
{
type: 'fingerprint',
category: 'application',
tags: %w[COTS Development],
vendor: 'Jupyter',
product: 'Notebook',
website: 'https://jupyter.org/',
version: nil,
match_logic: :all,
matches: [
{
match_type: :content_title,
match_content: /Home Page - Select or create a notebook/i,
}
],
description: 'unique title',
paths: [{ path: url.to_s, follow_redirects: true }],
inference: false
}
]
end
end
end
end
end