Skip to content

Commit

Permalink
Only take the most recent Intigriti scopes
Browse files Browse the repository at this point in the history
  • Loading branch information
arkadiyt committed Oct 4, 2024
1 parent fc5ef0a commit 5740e5b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
18 changes: 9 additions & 9 deletions lib/bounty-targets/intigriti.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ def directory_index

def program_scopes(program)
url = "https://app.intigriti.com/api/core/public/programs/#{encode(program[:company_handle])}/#{encode(program[:handle])}"
targets = JSON.parse(SsrfFilter.get(url).body)['domains'].flat_map do |domains|
domains['content'].map do |content|
{
type: TYPES[content['type']],
endpoint: content['endpoint'],
description: content['description'],
impact: TIERS[content['bountyTierId']]
}
end
targets = (JSON.parse(SsrfFilter.get(url).body)['domains'].max_by do |domains|
domains['createdAt']
end)['content'].map do |content|
{
type: TYPES[content['type']],
endpoint: content['endpoint'],
description: content['description'],
impact: TIERS[content['bountyTierId']]
}
end.group_by do |scope|
scope[:impact] != 'Out of scope'
end
Expand Down
2 changes: 1 addition & 1 deletion spec/bounty-targets/intigriti_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
in_scope: [
{
description: nil,
endpoint: "(Hardware)\tProcessor (inclusive of micro-code ROM + updates)",
endpoint: 'endpoint',
impact: 'Tier 1',
type: 'other'
}
Expand Down
14 changes: 13 additions & 1 deletion spec/fixtures/intigriti/scopes.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,19 @@
}
],
"createdAt": 1638481238
}
},
{
"content": [
{
"id": "dd6d5718-737b-44f3-a833-fa74d0462f1f",
"type": 6,
"endpoint": "endpoint",
"bountyTierId": 4,
"description": null
}
],
"createdAt": 1638481240
}
],
"inScopes": [
{
Expand Down

0 comments on commit 5740e5b

Please sign in to comment.