Skip to content

Conversation

@Matth--
Copy link

@Matth-- Matth-- commented Nov 14, 2019

The links redirect to the trial page for Secure Code Warrior security training.

Checklist:

  • I have added entries to CHANGELOG.md and marked it Added/Changed/Removed
  • I have made corresponding changes to the documentation (if needed)

The links redirect to the trial page for Secure Code Warrior security training.
@Matth-- Matth-- force-pushed the add-secure-code-warrior-mapping branch from 185fb63 to 9df82ff Compare November 14, 2019 09:14
@barnett
Copy link
Contributor

barnett commented Nov 14, 2019

Sorry on the build issue here, got an issue having to do with forks we're working out.

@adamrdavid
Copy link
Contributor

adamrdavid commented Nov 15, 2019

👋 github seems to not want to send anything to buildkite for forks. until I can figure that out, we can use this:
https://github.com/bugcrowd/vulnerability-rating-taxonomy/compare/scw-mapping

I merged it into our fork. Unfortunately access to our CI tool is not public, but you can run the tests locally by running the Dockerfile.

Currently CI is reporting a schema error in the scw mapping:

ERROR: test_mapping_schemas (test_vrt.TestVrt)
--
  | ----------------------------------------------------------------------
  | Traceback (most recent call last):
  | File "/tmp/vrt/tests/test_vrt.py", line 43, in test_mapping_schemas
  | self.validate_schema(schema_file, mapping['filename'])
  | File "/tmp/vrt/tests/test_vrt.py", line 31, in validate_schema
  | raise error
  | jsonschema.exceptions.ValidationError: 'https://integration-api.securecodewarrior.com/api/v1/trial?id=bugcrowd&mappingList=vrt&mappingKey=server_security_misconfiguration:misconfigured_dns:missing_caa_record&redirect=true' does not match '^https:\\/\\/integration-api\\.securecodewarrior\\.com\\/api\\/v1\\/trial\\?id=bugcrowd&mappingList=vrt&mappingKey=[a-z_:]*$'
  |  
  | Failed validating 'pattern' in schema[0]['properties']['scw']:
  | {'pattern': '^https:\\/\\/integration-api\\.securecodewarrior\\.com\\/api\\/v1\\/trial\\?id=bugcrowd&mappingList=vrt&mappingKey=[a-z_:]*$',
  | 'type': 'string'}
  |  
  | On instance['scw']:
  | 'https://integration-api.securecodewarrior.com/api/v1/trial?id=bugcrowd&mappingList=vrt&mappingKey=server_security_misconfiguration:misconfigured_dns:missing_caa_record&redirect=true'

- Changed "scw" key to "secure_code_warrior" so unit tests pass
- Added &redirect to url validator
- Re-generated the mapping file to include all the VRT identifiers.

If a mapping does not exist, users will still get redirected to the trial-url but they will have to select a vulnerability before they can play a challenge.
@Matth--
Copy link
Author

Matth-- commented Nov 18, 2019

Hi @adamrdavid

I did some changes so the schema validation works. Also changed the "scw" property to "secure_code_warrior" because of failing tests (Test checks if the mapping folder name has the same key as the identifier used by SCW).

@adamrdavid adamrdavid added the mappings Relating to external mapping taxonomies label Nov 18, 2019
@adamrdavid
Copy link
Contributor

@Matth-- I setup github actions with this repo so if you push a commit you should be able to see the CI build.

Copy link
Contributor

@plr0man plr0man left a comment

Choose a reason for hiding this comment

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

Well done :)


#### [Remediation Advice Mapping](https://github.com/bugcrowd/vulnerability-rating-taxonomy/blob/master/mappings/remediation_advice/remediation_advice.json):

#### [Secure Code Warrior](https://github.com/bugcrowd/vulnerability-rating-taxonomy/blob/master/mappings/secure_code_warrior/secure_code_warrior.json)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we replace Secure Code Warrior with Secure Code Warrior Mapping and add a colon at the end of the line

"content": [
{
"id": "server_security_misconfiguration",
"secure_code_warrior": "https://integration-api.securecodewarrior.com/api/v1/trial?id=bugcrowd&mappingList=vrt&mappingKey=server_security_misconfiguration&redirect=true",
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the links working correctly? For instance this one here takes me to https://portal.securecodewarrior.com/?utm_source=partner-integration:bugcrowd#/website-trial

Copy link
Author

Choose a reason for hiding this comment

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

hi @plr0man

We do not have a mapping for every VRT item. That's why some links will redirect to a trial page where the user can select his own category.

If this is unwanted behavior we could provide a list where only links where mappings exist.

Copy link
Contributor

@barnett barnett Dec 4, 2019

Choose a reason for hiding this comment

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

Ah, what would be best here is to not set those values to the default but instead set the metadata default to such value. That will then automatically fallback to such value when one doesn’t exist in the mapping.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, I thought this one was available at https://portal.securecodewarrior.com/?utm_source=partner-integration:bugcrowd#/website-trial/web/misconfig], @barnett has a good point though. To add to that, and @barnett correct me here if I'm wrong in this case, any undeclared children nodes would inherit secure_code_warrior values from their parents. So for example if you had a subcategory with 5 variants and they all had the same mapping values then it's ok to not list the children. That of course is not an error, just a suggestion if you guys find it useful.

Copy link
Contributor

@barnett barnett Dec 5, 2019

Choose a reason for hiding this comment

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

That's what I thought as well, but @adamrdavid would be able to confirm.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes parent mappings will be used if the children don't have 👍

Copy link
Author

Choose a reason for hiding this comment

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

From our point of view it is easier to leave all the urls unique. If we plan on supporting a category that has not been mapped yet, the user will get redirected to a more specific challenge without the need to change this mapping file.

In other words: with this setup modifications to the mapping on existing vrt ids will not require any change on this mapping file. We only need to update this file when a new version of VRT gets released.

@Matth-- Matth-- changed the title [WIP] Add mapping to Secure Code Warrior trial Add mapping to Secure Code Warrior trial Dec 4, 2019

#### [Remediation Advice Mapping](https://github.com/bugcrowd/vulnerability-rating-taxonomy/blob/master/mappings/remediation_advice/remediation_advice.json):

#### [Secure Code Warrior](https://github.com/bugcrowd/vulnerability-rating-taxonomy/blob/master/mappings/secure_code_warrior/secure_code_warrior.json)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#### [Secure Code Warrior](https://github.com/bugcrowd/vulnerability-rating-taxonomy/blob/master/mappings/secure_code_warrior/secure_code_warrior.json)
#### [Secure Code Warrior Mapping](https://github.com/bugcrowd/vulnerability-rating-taxonomy/blob/master/mappings/secure_code_warrior/secure_code_warrior.json):

@@ -0,0 +1,1409 @@
{
"metadata": {
"default": null
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"default": null
"default": "https://portal.securecodewarrior.com/?utm_source=partner-integration:bugcrowd#/website-trial"

@barnett
Copy link
Contributor

barnett commented Dec 6, 2019

Now seeing that it isn't as much a 1:1 mapping but a formula to construct the URL, would be interesting to see how we can better support this down the road. @Matth--, when we add/change categories what is the change-management process for your side. Thinking if we just auto-create the dynamic URL how'd that work?

@barnett
Copy link
Contributor

barnett commented Jan 8, 2020

Hey @Matth--,

Emailed Alex as well, but we'll be auto-generating this mapping via our build process going forward, removing the need to maintain the mapping in this repository. You can see an example of the output of this auto-generated mapping here with a list of the builds (current and future ones) here. Will be sure to keep your team updated before we cut new versions so that you can keep the mapping on your side up to date 👍

With the above process done, we can close this PR. Appreciate all your help and assistance in creating the mapping 🎉

@barnett barnett closed this Jan 8, 2020
@adamrdavid
Copy link
Contributor

Just a side note @Matth-- the file will be updated every time there is a master build or a new release and it checks which urls resolve, so it will update if you add/change categories.

@Matth--
Copy link
Author

Matth-- commented Jan 10, 2020

Okay, sound like the best solution here!

@Matth-- Matth-- deleted the add-secure-code-warrior-mapping branch January 10, 2020 09:56
@adamrdavid adamrdavid mentioned this pull request Jan 10, 2020
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mappings Relating to external mapping taxonomies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants