-
Notifications
You must be signed in to change notification settings - Fork 175
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 Format Checker for MITRE ATT&CK Matrix Report Mappings #1360
Conversation
😱 [INFO][root]: ignoring file dependabot.yml |
I have one concern with this: adding it to |
Makefile
Outdated
@@ -43,6 +43,9 @@ lint-fmt: | |||
@echo Checking python file formatting with the black code style checker | |||
pipenv run black --line-length=100 --check $(dirs) | |||
|
|||
lint-misc: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not introducing lint-mitre
and then introduce lint-misc
whenever another "misc" linting is added in the future? And the lint-misc
will be running the mitre lint and the newly introduced one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense! In both cases, the MITRE check will run during make lint, so customers won't need to make any changes to their workflows
Removed the mitre check from `make lint` command and added a separate make target, `make lint-mitre`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
Background
If a rule has a MITRE ATT&CK report mapping with an invalid format, the mapping doesn't resolve properly in the UI. This PR adds some automation to check for misformatted MITRE mappings and alert on them.
See this PR for more details.
This check didn't really fit as part of
pat validate
orpat test
, since it's concerned with the format of the YAML file, so we chose to add it a script that can be run as part ofmake lint
.Changes
.scripts
directory, with a python script to check the mapping formatsmake lint
is invokedTesting
make lint
, and confirm it didn't raise any false positives when no malformed mappings were present