hackerone-client 0.15.0 → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +28 -12
- data/.rubocop.yml +4 -0
- data/CHANGELOG.md +21 -0
- data/Gemfile +11 -3
- data/Guardfile +2 -0
- data/README.md +8 -2
- data/Rakefile +10 -1
- data/bin/console +1 -0
- data/fixtures/vcr_cassettes/create_report.yml +81 -0
- data/fixtures/vcr_cassettes/create_report_invalid.yml +79 -0
- data/fixtures/vcr_cassettes/lock_report.yml +156 -0
- data/fixtures/vcr_cassettes/report.yml +22 -1
- data/fixtures/vcr_cassettes/report_list_triaged.yml +77 -0
- data/fixtures/vcr_cassettes/update_severity.yml +78 -0
- data/hackerone-client.gemspec +4 -2
- data/lib/hackerone/client.rb +56 -9
- data/lib/hackerone/client/activity.rb +20 -8
- data/lib/hackerone/client/address.rb +2 -0
- data/lib/hackerone/client/attachment.rb +24 -0
- data/lib/hackerone/client/bounty.rb +2 -0
- data/lib/hackerone/client/group.rb +2 -0
- data/lib/hackerone/client/incremental/activities.rb +3 -1
- data/lib/hackerone/client/member.rb +2 -0
- data/lib/hackerone/client/program.rb +4 -2
- data/lib/hackerone/client/report.rb +63 -5
- data/lib/hackerone/client/reporter.rb +2 -0
- data/lib/hackerone/client/resource_helper.rb +5 -3
- data/lib/hackerone/client/structured_scope.rb +2 -0
- data/lib/hackerone/client/swag.rb +2 -0
- data/lib/hackerone/client/user.rb +2 -0
- data/lib/hackerone/client/version.rb +3 -1
- data/lib/hackerone/client/weakness.rb +16 -14
- metadata +9 -2
@@ -191,7 +191,28 @@ http_interactions:
|
|
191
191
|
},
|
192
192
|
"attachments": {
|
193
193
|
"data": [
|
194
|
-
|
194
|
+
{
|
195
|
+
"id": "936424",
|
196
|
+
"type": "attachment",
|
197
|
+
"attributes": {
|
198
|
+
"expiring_url": "https://redacted.aws.s3.link",
|
199
|
+
"created_at": "2020-08-04T18:34:09.446Z",
|
200
|
+
"file_name": "2182_FtX8VdFq.jpg",
|
201
|
+
"content_type": "image/jpeg",
|
202
|
+
"file_size": 653695
|
203
|
+
}
|
204
|
+
},
|
205
|
+
{
|
206
|
+
"id": "936425",
|
207
|
+
"type": "attachment",
|
208
|
+
"attributes": {
|
209
|
+
"expiring_url": "https://redacted.aws.s3.link",
|
210
|
+
"created_at": "2020-08-04T18:34:28.970Z",
|
211
|
+
"file_name": "swagger_parse.py",
|
212
|
+
"content_type": "text/x-python-script",
|
213
|
+
"file_size": 482
|
214
|
+
}
|
215
|
+
}
|
195
216
|
]
|
196
217
|
},
|
197
218
|
"vulnerability_types": {
|
@@ -0,0 +1,77 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.hackerone.com/v1/reports?filter%5Bcreated_at__gt%5D=2017-02-11T16:00:44-10:00&filter%5Bprogram%5D%5B0%5D=github&filter%5Bstate%5D%5B0%5D=triaged
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Authorization:
|
11
|
+
- Basic NOPE
|
12
|
+
User-Agent:
|
13
|
+
- Faraday v1.0.0
|
14
|
+
Accept-Encoding:
|
15
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
16
|
+
Accept:
|
17
|
+
- "*/*"
|
18
|
+
response:
|
19
|
+
status:
|
20
|
+
code: 200
|
21
|
+
message: OK
|
22
|
+
headers:
|
23
|
+
Date:
|
24
|
+
- Tue, 24 Mar 2020 14:11:47 GMT
|
25
|
+
Content-Type:
|
26
|
+
- application/json; charset=utf-8
|
27
|
+
Transfer-Encoding:
|
28
|
+
- chunked
|
29
|
+
Connection:
|
30
|
+
- keep-alive
|
31
|
+
Set-Cookie:
|
32
|
+
- __cfduid=dabd0c152e7e92db1c896d18efb3473911585059107; expires=Thu, 23-Apr-20
|
33
|
+
14:11:47 GMT; path=/; Domain=api.hackerone.com; HttpOnly; SameSite=Lax; Secure
|
34
|
+
X-Request-Id:
|
35
|
+
- 5ead5fa1-86fb-4b8f-ae8b-755d0b08b40c
|
36
|
+
Etag:
|
37
|
+
- W/"a9d3a797dc03972084547d21d1a4ebcd"
|
38
|
+
Cache-Control:
|
39
|
+
- max-age=0, private, must-revalidate
|
40
|
+
Strict-Transport-Security:
|
41
|
+
- max-age=31536000; includeSubDomains; preload
|
42
|
+
X-Frame-Options:
|
43
|
+
- DENY
|
44
|
+
X-Content-Type-Options:
|
45
|
+
- nosniff
|
46
|
+
X-Xss-Protection:
|
47
|
+
- 1; mode=block
|
48
|
+
X-Download-Options:
|
49
|
+
- noopen
|
50
|
+
X-Permitted-Cross-Domain-Policies:
|
51
|
+
- none
|
52
|
+
Referrer-Policy:
|
53
|
+
- strict-origin-when-cross-origin
|
54
|
+
Expect-Ct:
|
55
|
+
- enforce, max-age=86400
|
56
|
+
Content-Security-Policy:
|
57
|
+
- 'default-src ''none''; base-uri ''self''; block-all-mixed-content; child-src
|
58
|
+
www.youtube-nocookie.com; connect-src ''self'' www.google-analytics.com errors.hackerone.net;
|
59
|
+
font-src ''self''; form-action ''self''; frame-ancestors ''none''; img-src
|
60
|
+
''self'' data: cover-photos.hackerone-user-content.com hackathon-photos.hackerone-user-content.com
|
61
|
+
profile-photos.hackerone-user-content.com hackerone-us-west-2-production-attachments.s3.us-west-2.amazonaws.com;
|
62
|
+
media-src ''self'' hackerone-us-west-2-production-attachments.s3.us-west-2.amazonaws.com;
|
63
|
+
script-src ''self'' www.google-analytics.com; style-src ''self'' ''unsafe-inline'';
|
64
|
+
report-uri https://errors.hackerone.net/api/30/csp-report/?sentry_key=61c1e2f50d21487c97a071737701f598'
|
65
|
+
Cf-Cache-Status:
|
66
|
+
- DYNAMIC
|
67
|
+
Server:
|
68
|
+
- cloudflare
|
69
|
+
Cf-Ray:
|
70
|
+
- 5790fbbbb977e4d8-ATL
|
71
|
+
body:
|
72
|
+
encoding: ASCII-8BIT
|
73
|
+
string: !binary |-
|
74
|
+
eyJkYXRh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iIsInJlZmVyZW5jZSI6IiIsImNvbmZpZGVudGlhbGl0eV9yZXF1aXJlbWVudCI6Im1lZGl1bSIsImludGVncml0eV9yZXF1aXJlbWVudCI6Im1lZGl1bSIsImF2YWlsYWJpbGl0eV9yZXF1aXJlbWVudCI6ImxvdyJ9fX0sImJvdW50aWVzIjp7ImRhdGEiOltdfSwiY3VzdG9tX2ZpZWxkX3ZhbHVlcyI6eyJkYXRhIjpbXX19fV0sImxpbmtzIjp7fX0=
|
75
|
+
http_version: null
|
76
|
+
recorded_at: Tue, 24 Mar 2020 14:11:47 GMT
|
77
|
+
recorded_with: VCR 5.1.0
|
@@ -0,0 +1,78 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://api.hackerone.com/v1/reports/200/severities
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"data":{"type":"severity","attributes":{"rating":"high"}}}'
|
9
|
+
headers:
|
10
|
+
Authorization:
|
11
|
+
- Basic NOPE
|
12
|
+
User-Agent:
|
13
|
+
- Faraday v1.0.0
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
Accept-Encoding:
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
18
|
+
Accept:
|
19
|
+
- "*/*"
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Date:
|
26
|
+
- Mon, 23 Mar 2020 22:11:50 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Set-Cookie:
|
34
|
+
- __cfduid=defc457f4849bd5da92f0d0a9e21f70cf1585001510; expires=Wed, 22-Apr-20
|
35
|
+
22:11:50 GMT; path=/; Domain=api.hackerone.com; HttpOnly; SameSite=Lax; Secure
|
36
|
+
X-Request-Id:
|
37
|
+
- bc58a27f-3140-4457-b7b0-12a3c86f4f03
|
38
|
+
Etag:
|
39
|
+
- W/"30c2790e73edc770a9ed3fea69f0e8ea"
|
40
|
+
Cache-Control:
|
41
|
+
- max-age=0, private, must-revalidate
|
42
|
+
Strict-Transport-Security:
|
43
|
+
- max-age=31536000; includeSubDomains; preload
|
44
|
+
X-Frame-Options:
|
45
|
+
- DENY
|
46
|
+
X-Content-Type-Options:
|
47
|
+
- nosniff
|
48
|
+
X-Xss-Protection:
|
49
|
+
- 1; mode=block
|
50
|
+
X-Download-Options:
|
51
|
+
- noopen
|
52
|
+
X-Permitted-Cross-Domain-Policies:
|
53
|
+
- none
|
54
|
+
Referrer-Policy:
|
55
|
+
- strict-origin-when-cross-origin
|
56
|
+
Expect-Ct:
|
57
|
+
- enforce, max-age=86400
|
58
|
+
Content-Security-Policy:
|
59
|
+
- 'default-src ''none''; base-uri ''self''; block-all-mixed-content; child-src
|
60
|
+
www.youtube-nocookie.com; connect-src ''self'' www.google-analytics.com errors.hackerone.net;
|
61
|
+
font-src ''self''; form-action ''self''; frame-ancestors ''none''; img-src
|
62
|
+
''self'' data: cover-photos.hackerone-user-content.com hackathon-photos.hackerone-user-content.com
|
63
|
+
profile-photos.hackerone-user-content.com hackerone-us-west-2-production-attachments.s3.us-west-2.amazonaws.com;
|
64
|
+
media-src ''self'' hackerone-us-west-2-production-attachments.s3.us-west-2.amazonaws.com;
|
65
|
+
script-src ''self'' www.google-analytics.com; style-src ''self'' ''unsafe-inline'';
|
66
|
+
report-uri https://errors.hackerone.net/api/30/csp-report/?sentry_key=61c1e2f50d21487c97a071737701f598'
|
67
|
+
Cf-Cache-Status:
|
68
|
+
- DYNAMIC
|
69
|
+
Server:
|
70
|
+
- cloudflare
|
71
|
+
Cf-Ray:
|
72
|
+
- 578b7d8e9faa3856-ATL
|
73
|
+
body:
|
74
|
+
encoding: ASCII-8BIT
|
75
|
+
string: '{"data":{"id":"668494","type":"severity","attributes":{"rating":"high","author_type":"Team","user_id":983615,"created_at":"2020-03-23T22:11:50.360Z"}}}'
|
76
|
+
http_version: null
|
77
|
+
recorded_at: Mon, 23 Mar 2020 22:11:50 GMT
|
78
|
+
recorded_with: VCR 5.1.0
|
data/hackerone-client.gemspec
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# coding: utf-8
|
2
|
-
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
5
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
6
|
+
require "hackerone/client/version"
|
5
7
|
|
6
8
|
Gem::Specification.new do |spec|
|
7
9
|
spec.name = "hackerone-client"
|
data/lib/hackerone/client.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "faraday"
|
2
4
|
require "json"
|
3
5
|
require "active_support/time"
|
@@ -12,8 +14,10 @@ require_relative "client/group"
|
|
12
14
|
require_relative "client/structured_scope"
|
13
15
|
require_relative "client/swag"
|
14
16
|
require_relative "client/address"
|
17
|
+
require_relative "client/attachment"
|
15
18
|
require_relative "client/bounty"
|
16
19
|
require_relative "client/incremental/activities"
|
20
|
+
require "active_support/core_ext/hash"
|
17
21
|
|
18
22
|
module HackerOne
|
19
23
|
module Client
|
@@ -24,7 +28,18 @@ module HackerOne
|
|
24
28
|
DEFAULT_HIGH_RANGE = 2500...4999
|
25
29
|
DEFAULT_CRITICAL_RANGE = 5000...100_000_000
|
26
30
|
|
27
|
-
LENIENT_MODE_ENV_VARIABLE =
|
31
|
+
LENIENT_MODE_ENV_VARIABLE = "HACKERONE_CLIENT_LENIENT_MODE"
|
32
|
+
|
33
|
+
REPORT_STATES = %w(
|
34
|
+
new
|
35
|
+
triaged
|
36
|
+
needs-more-info
|
37
|
+
resolved
|
38
|
+
not-applicable
|
39
|
+
informative
|
40
|
+
duplicate
|
41
|
+
spam
|
42
|
+
)
|
28
43
|
|
29
44
|
class << self
|
30
45
|
ATTRS = [:low_range, :medium_range, :high_range, :critical_range].freeze
|
@@ -64,17 +79,20 @@ module HackerOne
|
|
64
79
|
end
|
65
80
|
end
|
66
81
|
|
67
|
-
## Returns all
|
82
|
+
## Returns all reports in a given state, optionally with a time bound
|
68
83
|
#
|
69
84
|
# program: the HackerOne program to search on (configure globally with Hackerone::Client.program=)
|
70
85
|
# since (optional): a time bound, don't include reports earlier than +since+. Must be a DateTime object.
|
86
|
+
# state (optional): state that a report is in, by default new
|
71
87
|
#
|
72
88
|
# returns all open reports or an empty array
|
73
|
-
def reports(since: 3.days.ago)
|
89
|
+
def reports(since: 3.days.ago, state: :new)
|
74
90
|
raise ArgumentError, "Program cannot be nil" unless program
|
91
|
+
raise ArgumentError, "State is invalid" unless REPORT_STATES.include?(state.to_s)
|
92
|
+
|
75
93
|
response = self.class.hackerone_api_connection.get do |req|
|
76
94
|
options = {
|
77
|
-
"filter[state][]" =>
|
95
|
+
"filter[state][]" => state,
|
78
96
|
"filter[program][]" => program,
|
79
97
|
"filter[created_at__gt]" => since.iso8601
|
80
98
|
}
|
@@ -88,6 +106,35 @@ module HackerOne
|
|
88
106
|
end
|
89
107
|
end
|
90
108
|
|
109
|
+
## Public: create a new report
|
110
|
+
#
|
111
|
+
# title: The title of the report
|
112
|
+
# summary: Summary of the report
|
113
|
+
# impact: Impact of the report
|
114
|
+
# severity_rating: severity of report, must be one of https://api.hackerone.com/reference/#severity-ratings
|
115
|
+
# source: where the report came from, i.e. API, Bugcrowd, etc.
|
116
|
+
#
|
117
|
+
# returns an HackerOne::Client::Report object or raises an error if
|
118
|
+
# error during creation
|
119
|
+
def create_report(title:, summary:, impact:, severity_rating:, source:)
|
120
|
+
raise ArgumentError, "Program cannot be nil" unless program
|
121
|
+
|
122
|
+
data = {
|
123
|
+
"data": {
|
124
|
+
"type": "report",
|
125
|
+
"attributes": {
|
126
|
+
"team_handle": program,
|
127
|
+
"title": title,
|
128
|
+
"vulnerability_information": summary,
|
129
|
+
"impact": impact,
|
130
|
+
"severity_rating": severity_rating,
|
131
|
+
"source": source
|
132
|
+
}
|
133
|
+
}
|
134
|
+
}
|
135
|
+
Report.new(post("reports", data))
|
136
|
+
end
|
137
|
+
|
91
138
|
## Public: retrieve a report
|
92
139
|
#
|
93
140
|
# id: the ID of a specific report
|
@@ -102,7 +149,7 @@ module HackerOne
|
|
102
149
|
def post(endpoint, body)
|
103
150
|
response = with_retry do
|
104
151
|
self.class.hackerone_api_connection.post do |req|
|
105
|
-
req.headers[
|
152
|
+
req.headers["Content-Type"] = "application/json"
|
106
153
|
req.body = body.to_json
|
107
154
|
req.url endpoint
|
108
155
|
end
|
@@ -114,7 +161,7 @@ module HackerOne
|
|
114
161
|
def get(endpoint, params = nil)
|
115
162
|
response = with_retry do
|
116
163
|
self.class.hackerone_api_connection.get do |req|
|
117
|
-
req.headers[
|
164
|
+
req.headers["Content-Type"] = "application/json"
|
118
165
|
req.params = params || {}
|
119
166
|
req.url endpoint
|
120
167
|
end
|
@@ -129,7 +176,7 @@ module HackerOne
|
|
129
176
|
elsif response.status.to_s.start_with?("5")
|
130
177
|
raise RuntimeError, "API called failed, probably their fault: #{response.body}"
|
131
178
|
elsif response.success?
|
132
|
-
response_body_json = JSON.parse(response.body, :
|
179
|
+
response_body_json = JSON.parse(response.body, symbolize_names: true)
|
133
180
|
if extract_data && response_body_json.key?(:data)
|
134
181
|
response_body_json[:data]
|
135
182
|
else
|
@@ -145,13 +192,13 @@ module HackerOne
|
|
145
192
|
raise NotConfiguredError, "HACKERONE_TOKEN_NAME HACKERONE_TOKEN environment variables must be set"
|
146
193
|
end
|
147
194
|
|
148
|
-
@connection ||= Faraday.new(:
|
195
|
+
@connection ||= Faraday.new(url: "https://api.hackerone.com/v1") do |faraday|
|
149
196
|
faraday.basic_auth(ENV["HACKERONE_TOKEN_NAME"], ENV["HACKERONE_TOKEN"])
|
150
197
|
faraday.adapter Faraday.default_adapter
|
151
198
|
end
|
152
199
|
end
|
153
200
|
|
154
|
-
def with_retry(attempts=3, &block)
|
201
|
+
def with_retry(attempts = 3, &block)
|
155
202
|
attempts_remaining = attempts
|
156
203
|
|
157
204
|
begin
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module HackerOne
|
2
4
|
module Client
|
3
5
|
module Activities
|
@@ -13,6 +15,12 @@ module HackerOne
|
|
13
15
|
attributes.internal
|
14
16
|
end
|
15
17
|
|
18
|
+
def attachments
|
19
|
+
@attachments ||= activity.relationships.fetch(:attachments, {})
|
20
|
+
.fetch(:data, [])
|
21
|
+
.map { |attachment| HackerOne::Client::Attachment.new(attachment) }
|
22
|
+
end
|
23
|
+
|
16
24
|
private
|
17
25
|
|
18
26
|
def relationships
|
@@ -83,15 +91,19 @@ module HackerOne
|
|
83
91
|
delegate :message, :bounty_amount, :bonus_amount, to: :attributes
|
84
92
|
end
|
85
93
|
|
94
|
+
class ReportLocked < Activity
|
95
|
+
end
|
96
|
+
|
86
97
|
ACTIVITY_TYPE_CLASS_MAPPING = {
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
98
|
+
"activity-bounty-awarded" => BountyAwarded,
|
99
|
+
"activity-swag-awarded" => SwagAwarded,
|
100
|
+
"activity-user-assigned-to-bug" => UserAssignedToBug,
|
101
|
+
"activity-group-assigned-to-bug" => GroupAssignedToBug,
|
102
|
+
"activity-bug-triaged" => BugTriaged,
|
103
|
+
"activity-reference-id-added" => ReferenceIdAdded,
|
104
|
+
"activity-comment" => CommentAdded,
|
105
|
+
"activity-bounty-suggested" => BountySuggested,
|
106
|
+
"activity-comments-closed" => ReportLocked
|
95
107
|
}.freeze
|
96
108
|
|
97
109
|
def self.build(activity_data)
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module HackerOne
|
4
|
+
module Client
|
5
|
+
class Attachment
|
6
|
+
delegate :expiring_url, :file_name, :content_type, :created_at, \
|
7
|
+
:file_size, to: :attributes
|
8
|
+
|
9
|
+
def initialize(attachment)
|
10
|
+
@attachment = attachment
|
11
|
+
end
|
12
|
+
|
13
|
+
def id
|
14
|
+
@attachment[:id]
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def attributes
|
20
|
+
OpenStruct.new(@attachment[:attributes])
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module HackerOne
|
2
4
|
module Client
|
3
5
|
module Incremental
|
@@ -48,7 +50,7 @@ module HackerOne
|
|
48
50
|
|
49
51
|
def current_page
|
50
52
|
@current_page ||= make_get_request(
|
51
|
-
|
53
|
+
"incremental/activities",
|
52
54
|
extract_data: false,
|
53
55
|
params: {
|
54
56
|
handle: program.handle,
|