Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

INT-4151 - Add Property Fields to Hackerone Findings #60

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

eXtremeX
Copy link

@eXtremeX eXtremeX commented Feb 14, 2023

Added

  • Added recommendation, reference, description, and impact fields to
    hackerone_report

@eXtremeX eXtremeX requested a review from a team February 14, 2023 12:19
@eXtremeX eXtremeX requested a review from a team as a code owner February 14, 2023 12:19
@eXtremeX eXtremeX force-pushed the feature/add-property-fields branch from 76eb4b5 to 54a168e Compare February 14, 2023 15:28
@eXtremeX eXtremeX changed the title Wip - Feature/add property fields INT-4151 - Add Property Fields to Hackerone Findings Feb 14, 2023
Copy link
Contributor

@zemberdotnet zemberdotnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eXtremeX a few comments, but overall looks good!

src/client.ts Outdated
handleError: (err, context) => {
const rateLimitType = err.response.headers.get('X-RateLimit-Type');
// only retry on 429 && per second limit
if (!(err.status === 429 && rateLimitType === 'QPS')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we expand the comment to mention why we are only retrying this type of rate limit?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch - this was incorrect, a mistake while we were referencing different graph project for the boilerplate-y parts. Have been fixed now.

PROGRAM_ASSET: {
resourceName: 'Program Asset',
_type: 'hackerone_program_asset',
_class: ['Entity'], // TBD: A better fitting class
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to provide additional data modeling details?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep we weren't sure about what class to use here, here are examples of the Program Assets (known as structuredScopes in HackerOne API docs):

structuredScope {
  id: '274636',
  type: 'structured-scope',
  attributes: {
    asset_type: 'URL',
    asset_identifier: 'blog.jupiterone.com',
    eligible_for_bounty: false,
    eligible_for_submission: false,
    instruction: null,
    max_severity: 'none',
    created_at: '2022-12-06T06:48:25.623Z',
    updated_at: '2022-12-06T06:48:25.623Z',
    reference: null
  }
}
structuredScope {
  id: '274637',
  type: 'structured-scope',
  attributes: {
    asset_type: 'OTHER',
    asset_identifier: 'Other assets',
    eligible_for_bounty: false,
    eligible_for_submission: true,
    instruction: 'If you have found a vulnerability in a JupiterOne demo site or app not contained within this list, you can still submit, and JupiterOne demo will triage the report. These types of reports will not result in a monetary reward but valid reports that are resolved can improve your reputation score on the HackerOne platform.',
    max_severity: 'critical',
    created_at: '2022-12-06T06:48:25.842Z',
    updated_at: '2022-12-06T06:48:25.842Z',
    reference: null
  }
}
structuredScope {
  id: '274635',
  type: 'structured-scope',
  attributes: {
    asset_type: 'APPLE_STORE_APP_ID',
    asset_identifier: 'com.jupiterone_demo.ios',
    eligible_for_bounty: true,
    eligible_for_submission: true,
    instruction: 'JupiterOne demo for iOS and iPadOS, available on the [App Store](http://www.apple.com/)',
    max_severity: 'critical',
    created_at: '2022-12-06T06:48:25.589Z',
    updated_at: '2022-12-06T06:48:25.589Z',
    reference: null
  }
}

Perhaps "Resource"?

@@ -73,14 +157,14 @@ export const MappedRelationships: Record<
StepMappedRelationshipMetadata
> = {
FINDING_EXPLOITS_WEAKNESS: {
_type: 'hackerone_finding_exploits_weakness',
_type: 'hackerone_report_exploits_weakness',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this fixing undeclared types?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no undeclared types currently, even if that line is left unchanged. The reason behind that change was that hackerone report entity has type of hackerone_report so the hackerone_finding felt like typo, unless it was intentional?

maxSeverity: data.attributes.max_severity,
createdOn: parseTimePropertyValue(data.attributes.created_at),
updatedOn: parseTimePropertyValue(data.attributes.updated_at),
reference: data.attributes.reference,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should name this property references. If I recall correctly, that's what it gets called in the data-model.

@eXtremeX eXtremeX requested a review from zemberdotnet March 13, 2023 20:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants