Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- insufficient_security_configurability.weak_two_fa_implementation.old_two_fa_code_is_not_invalidated_after_new_code_is_generated
- broken_authentication_and_session_management.weak_login_function.over_http
- server_security_misconfiguration.oauth_misconfiguration.account_squatting
- Third-party mapping to [Secure Code Warrior](https://www.securecodewarrior.com/) trainings

### Removed
- insufficient_security_configurability.lack_of_verification_email
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ Each mapping should be setup in the following structure:
- [CWE](mappings/cwe/cwe.json)
- [Remediation Advice](mappings/remediation_advice/remediation_advice.json)

#### Remediation Training
- [Secure Code Warriors](remediation_training/)
#### Third-Party Managed Mappings
- [Secure Code Warriors](third-party-mappings/remediation_training/secure-code-warriors-links.json)

## Supported Libraries
- [Ruby](https://github.com/bugcrowd/vrt-ruby)
Expand Down
20 changes: 20 additions & 0 deletions lib/tests/test_artifact_format.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from utils import utils
import os
import unittest

class TestArtifactFormat(unittest.TestCase):
def setUp(self):
self.scw_artifact_path = os.path.join(
utils.THIRD_PARTY_MAPPING_DIR,
utils.SCW_DIR,
utils.SCW_FILENAME
)

def test_artifact_loads_valid_json(self):
self.assertTrue(
utils.get_json(self.scw_artifact_path),
self.scw_artifact_path + ' is not valid JSON.'
)

if __name__ == "__main__":
unittest.main()
4 changes: 4 additions & 0 deletions lib/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
VRT_SCHEMA_FILENAME = 'vrt.schema.json'
MAPPING_DIR = 'mappings'

SCW_FILENAME = 'secure-code-warriors-links.json'
SCW_DIR = 'remediation_training'
THIRD_PARTY_MAPPING_DIR = 'third-party-mappings'

def get_json(filename):
with open(filename) as f:
return json.loads(f.read())
Expand Down
8 changes: 3 additions & 5 deletions lib/validate_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
import sys
import json
from utils import utils
from artifacts import scw_artifact

ARTIFACT_FILENAME = 'scw_links.json'
ARTIFACT_DIR = 'remediation_training'

artifact_json = utils.get_json(ARTIFACT_FILENAME)
repo_path = os.path.join(ARTIFACT_DIR, ARTIFACT_FILENAME)
artifact_json = utils.get_json(scw_artifact.OUTPUT_FILENAME)
repo_path = os.path.join(utils.THIRD_PARTY_MAPPING_DIR, utils.SCW_DIR, utils.SCW_FILENAME)
print(os.path.abspath(repo_path))
repo_json = utils.get_json(repo_path)

Expand Down