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

Add parser for AWS Security Finding Format (ASFF) #7838

Merged
merged 5 commits into from
Apr 3, 2023

Conversation

damiencarol
Copy link
Contributor

@damiencarol damiencarol commented Mar 18, 2023

Description

Add parser for AWS Security Finding Format (ASFF) https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-findings-format.html

Checklist

This checklist is for your information.

  • Make sure to rebase your PR against the very latest dev.
  • Features/Changes should be submitted against the dev.
  • Bugfixes should be submitted against the bugfix branch.
  • Give a meaningful name to your PR, as it may end up being used in the release notes.
  • Your code is flake8 compliant.
  • Your code is python 3.11 compliant.
  • If this is a new feature and not a bug fix, you've included the proper documentation in the docs at https://github.com/DefectDojo/django-DefectDojo/tree/dev/docs as part of this PR.
  • Model changes must include the necessary migrations in the dojo/db_migrations folder.
  • Add applicable tests to the unit tests.
  • Add the proper label to categorize your PR.

Extra information

Fixes #7348

@mtesauro
Copy link
Contributor

Good parser to add - thanks in advance 👍

@damiencarol damiencarol requested review from Maffooch, a team and mtesauro March 18, 2023 17:40
@mtesauro
Copy link
Contributor

@damiencarol Unit tests are failing with this error:

[snip]
2023-03-19T16:47:03.3737861Z �[36muwsgi_1         |�[0m Installed 462 object(s) from 1 fixture(s)
2023-03-19T16:47:03.3737984Z �[36muwsgi_1         |�[0m ok
2023-03-19T16:47:03.3738105Z �[36muwsgi_1         |�[0m 
2023-03-19T16:47:03.3738309Z �[36muwsgi_1         |�[0m ======================================================================
2023-03-19T16:47:03.3739153Z �[36muwsgi_1         |�[0m ERROR: test_guardduty_finding (unittests.tools.test_asff_parser.TestAsffParser.test_guardduty_finding)
2023-03-19T16:47:03.3739414Z �[36muwsgi_1         |�[0m ----------------------------------------------------------------------
2023-03-19T16:47:03.3739715Z �[36muwsgi_1         |�[0m Traceback (most recent call last):
2023-03-19T16:47:03.3740003Z �[36muwsgi_1         |�[0m   File "/app/unittests/tools/test_asff_parser.py", line 100, in test_guardduty_finding
2023-03-19T16:47:03.3740194Z �[36muwsgi_1         |�[0m     self.common_check_finding(finding)
2023-03-19T16:47:03.3740354Z �[36muwsgi_1         |�[0m     ^^^^^^^^^^^^^^^^^^^^^^^^^
2023-03-19T16:47:03.3740633Z �[36muwsgi_1         |�[0m AttributeError: 'TestAsffParser' object has no attribute 'common_check_finding'
2023-03-19T16:47:03.3740754Z �[36muwsgi_1         |�[0m 
2023-03-19T16:47:03.3740948Z �[36muwsgi_1         |�[0m ======================================================================
2023-03-19T16:47:03.3741274Z �[36muwsgi_1         |�[0m ERROR: test_prowler_finding (unittests.tools.test_asff_parser.TestAsffParser.test_prowler_finding)
2023-03-19T16:47:03.3741525Z �[36muwsgi_1         |�[0m ----------------------------------------------------------------------
2023-03-19T16:47:03.3741714Z �[36muwsgi_1         |�[0m Traceback (most recent call last):
2023-03-19T16:47:03.3741994Z �[36muwsgi_1         |�[0m   File "/app/unittests/tools/test_asff_parser.py", line 50, in test_prowler_finding
2023-03-19T16:47:03.3742186Z �[36muwsgi_1         |�[0m     self.common_check_finding(finding)
2023-03-19T16:47:03.3742346Z �[36muwsgi_1         |�[0m     ^^^^^^^^^^^^^^^^^^^^^^^^^
2023-03-19T16:47:03.3742621Z �[36muwsgi_1         |�[0m AttributeError: 'TestAsffParser' object has no attribute 'common_check_finding'
2023-03-19T16:47:03.3742730Z �[36muwsgi_1         |�[0m 
2023-03-19T16:47:03.3742980Z �[36muwsgi_1         |�[0m ----------------------------------------------------------------------
2023-03-19T16:47:03.3743149Z �[36muwsgi_1         |�[0m Ran 2449 tests in 463.791s
2023-03-19T16:47:03.3743262Z �[36muwsgi_1         |�[0m 
2023-03-19T16:47:03.3743440Z �[36muwsgi_1         |�[0m FAILED (errors=2, skipped=476)
2023-03-19T16:47:03.3743698Z �[36muwsgi_1         |�[0m Preserving test database for alias 'default' ('test_defectdojo')...

[snip]

@damiencarol
Copy link
Contributor Author

mmm. weird, maybe missing file in the PR. it's working locally

@damiencarol damiencarol reopened this Mar 27, 2023
@github-actions github-actions bot added docs parser settings_changes Needs changes to settings.py based on changes in settings.dist.py included in this PR unittests labels Mar 27, 2023
@damiencarol
Copy link
Contributor Author

@devGregA GitHub made something weird :/ I needed to rebase+refresh my branch. Not sure if it's linked to the recent security pb.

Copy link
Contributor

@mtesauro mtesauro left a comment

Choose a reason for hiding this comment

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

Approved

@Maffooch Maffooch merged commit 467f66b into DefectDojo:dev Apr 3, 2023
@damiencarol damiencarol deleted the asff branch April 3, 2023 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs parser settings_changes Needs changes to settings.py based on changes in settings.dist.py included in this PR unittests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants