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

D3fend Mitigation JSON Schema Error #45

Closed
0xm00n opened this issue Jan 28, 2024 · 3 comments
Closed

D3fend Mitigation JSON Schema Error #45

0xm00n opened this issue Jan 28, 2024 · 3 comments

Comments

@0xm00n
Copy link

0xm00n commented Jan 28, 2024

When setting up BRON through docker, I repeatedly get this JSON schema error. This does not seem to be a local environment issue.

'D3A-AAD' does not match 'D3-[A-Z]+'

Failed validating 'pattern' in schema['properties']['original_id']:
    {'description': 'ID from MITRE D3FEND. E.g. '
                    "'ActiveCertificateAnalysis'. TODO pattern",
     'pattern': 'D3-[A-Z]+',
     'type': 'string'}

On instance['original_id']:
    'D3A-AAD'
Traceback (most recent call last):
  File "tutorials/build_bron.py", line 268, in <module>
    main(
  File "tutorials/build_bron.py", line 249, in main
    _mitigations(username, password, ip, not no_validation)
  File "tutorials/build_bron.py", line 175, in _mitigations
    d3fend.update_BRON_graph_db(username, password, ip, validation)
  File "/usr/local/bron/mitigations/d3fend_mitigations.py", line 113, in update_BRON_graph_db
    validate_entry(entry, schema)
  File "/usr/local/bron/graph_db/bron_arango.py", line 322, in validate_entry
    raise jsonschema.exceptions.ValidationError(err)
jsonschema.exceptions.ValidationError: <exception str() failed>
@hembergerik
Copy link
Contributor

Thank you bringing it to our attention. Looks like there have been changes to the possible D3fend id patterns.

A quick fix could be to change the jsonschema pattern to allow for D3 and D3A e.g. D3?-[A-Z]+ on

We will get a fix out for this.

@0xm00n
Copy link
Author

0xm00n commented Jan 30, 2024

Hi, I tested out building BRON locally on Ubuntu and the correct jsonschema pattern is D3[A-Z]?-[A-Z]+ which allows BRON to fully build.

hembergerik added a commit that referenced this issue Jan 30, 2024
Closing #45 by fixing `D3fend` schema.
hembergerik added a commit that referenced this issue Jan 30, 2024
Closing #45 by fixing `D3fend` schema.
@hembergerik
Copy link
Contributor

Thanks! I patched the schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants