Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only take the most recent Intigriti scopes #175

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading