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

Linting controls #1063

Merged
merged 10 commits into from
Jul 9, 2024
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ Thankyou! -->
4. New Extension registration for Cisco #1074
5. Cleaned up MITRE trademarks and registrations for captions and descriptions.
6. Declared enums in dictionary.json have sane "0" (Unknown) and "99" (Other) declarations and descriptions where appropriate #1111
7. Adds support for `suppress_checks` controls in attributes to allow tools to automatically validate conventions #1063
* Updated several attributes that do not follow conventions to disable linting for them


## [v1.2.0] - April 23rd, 2024

Expand Down
3 changes: 3 additions & 0 deletions dictionary.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"activity_id": {
"caption": "Activity ID",
"description": "The normalized identifier of the activity that triggered the event.",
"suppress_checks": ["sibling_convention"],
"sibling": "activity_name",
"type": "integer_t",
"enum": {
Expand Down Expand Up @@ -2919,6 +2920,7 @@
"opcode_id": {
"caption": "DNS Opcode ID",
"description": "The DNS opcode ID specifies the normalized query message type as defined in <a target='_blank' href='https://www.rfc-editor.org/rfc/rfc5395.html'>RFC-5395</a>.",
"suppress_checks": ["enum_convention"],
"type": "integer_t",
"enum": {
"0": {
Expand Down Expand Up @@ -3628,6 +3630,7 @@
"risk_level_id": {
"caption": "Risk Level ID",
"description": "The normalized risk level id.",
"suppress_checks": ["enum_convention"],
"sibling": "risk_level",
"type": "integer_t",
"enum": {
Expand Down
2 changes: 1 addition & 1 deletion metaschema/attribute.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@
}
}
}
}
}
18 changes: 17 additions & 1 deletion metaschema/dictionary-attribute.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,25 @@
"type": "boolean",
"description": "A flag used when the attribute represents an array of values rather than a single value."
},
"suppress_checks": {
"type": "array",
"items": {
"type": "string",
"anyOf": [
{
"const": "enum_convention",
"description": "Suppresses the convention that every Enum type has two common values with integer value 0 for Unknown and 99 for Other."
},
{
"const": "sibling_convention",
"description": "Suppresses the convention that a sibling field for a field that has an _id suffix should be the name with the _id suffix stripped."
}
]
}
},
"observable": {
"$ref": "observable.schema.json"
}
},
"additionalProperties": false
}
}
Loading