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

risk:outage meta:aggregate and reporter props on ou:industry #3968

Merged
merged 12 commits into from
Nov 4, 2024
18 changes: 18 additions & 0 deletions synapse/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,13 @@ def getModelDefs(self):

('meta:sophistication', ('int', {'enums': sophenums}), {
'doc': 'A sophistication score with named values: very low, low, medium, high, and very high.'}),

('meta:aggregate:type:taxonomy', ('taxonomy', {}), {
'interfaces': ('meta:taxonomy',),
'doc': 'A type of item being counted in aggregate.'}),

('meta:aggregate', ('guid', {}), {
'doc': 'A node which represents an aggregate count of a specific type.'}),
),
'interfaces': (
('meta:taxonomy', {
Expand Down Expand Up @@ -285,6 +292,17 @@ def getModelDefs(self):
'doc': 'An external identifier for the rule.'}),
)),

('meta:aggregate:type:taxonomy', {}, (),
('meta:aggregate', {}, (
invisig0th marked this conversation as resolved.
Show resolved Hide resolved

('type', ('meta:aggregate:type:taxonomy', {}),
'ex': 'casualties.civilian',
'doc': 'The type of items being counted in aggregate.'}),

('count', ('int', {}), {
'doc': 'The number of items counted in aggregate.'}),
)),

('graph:cluster', {}, (
('name', ('str', {'lower': True}), {
'doc': 'A human friendly name for the cluster.'}),
Expand Down
6 changes: 6 additions & 0 deletions synapse/models/orgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,12 @@ def getModelDefs(self):
('names', ('array', {'type': 'ou:industryname', 'uniq': True, 'sorted': True}), {
'doc': 'An array of alternative names for the industry.'}),

('reporter', ('ou:org', {}), {
'doc': 'The organization reporting on the industry.'}),

('reporter:name', ('ou:name', {}), {
'doc': 'The name of the organization reporting on the industry.'}),

('subs', ('array', {'type': 'ou:industry', 'split': ',', 'uniq': True, 'sorted': True}), {
'deprecated': True,
'doc': 'Deprecated. Please use ou:industry:type taxonomy.'}),
Expand Down
37 changes: 37 additions & 0 deletions synapse/models/risk.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,13 @@ def getModelDefs(self):
('risk:extortion', ('guid', {}), {
'doc': 'An event where an attacker attempted to extort a victim.'}),

('risk:outage:cause:taxonomy', ('taxonomy', {}), {
'interfaces': ('meta:taxonomy',),
'doc': 'An outage cause taxonomy.'}),

('risk:outage', ('guid', {}), {
'doc': 'An outage event which effected resource availability.'}),
invisig0th marked this conversation as resolved.
Show resolved Hide resolved
invisig0th marked this conversation as resolved.
Show resolved Hide resolved

('risk:extortion:type:taxonomy', ('taxonomy', {}), {
'interfaces': ('meta:taxonomy',),
'doc': 'A taxonomy of extortion event types.'}),
Expand Down Expand Up @@ -224,6 +231,15 @@ def getModelDefs(self):

(('risk:extortion', 'leveraged', None), {
'doc': 'The extortion event was based on attacker access to the target node.'}),

(('meta:event', 'caused', 'risk:outage'), {
'doc': 'The event caused the outage.'}),

(('risk:attack', 'caused', 'risk:outage'), {
'doc': 'The attack caused the outage.'}),

(('risk:outage', 'impacted', None), {
'doc': 'The outage event impacted the availability of the target node.'}),
),
'forms': (

Expand Down Expand Up @@ -1022,6 +1038,27 @@ def getModelDefs(self):

)),

('risk:outage:cause:taxonomy', {}, ()),
('risk:outage', {}, (
invisig0th marked this conversation as resolved.
Show resolved Hide resolved
invisig0th marked this conversation as resolved.
Show resolved Hide resolved

('name', ('str', {'lower': True, 'onespace': True}), {
'doc': 'A name for the outage event.'}),

('period', ('ival', {}), {
'doc': 'The time period where the outage impacted availability.'}),

('cause', ('risk:outage:cause:taxonomy', {}), {
invisig0th marked this conversation as resolved.
Show resolved Hide resolved
invisig0th marked this conversation as resolved.
Show resolved Hide resolved
'doc': 'The outage cause type.'}),

('reporter', ('ou:org', {}), {
'doc': 'The organization reporting on the outage event.'}),

('reporter:name', ('ou:name', {}), {
'doc': 'The name of the organization reporting on the outage event.'}),
Comment on lines +1088 to +1089
Copy link
Contributor

Choose a reason for hiding this comment

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

duplicate reporter:name prop

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! I'll put up another PR.

)),

# TODO risk:outage:vitals to track outage stats over time

('risk:extortion:type:taxonomy', {}, ()),
('risk:extortion', {}, (

Expand Down
Loading