tmnpy.dsl.component.Component

class tmnpy.dsl.component.Component(name: str, desc: str = 'N/A', data: list[~tmnpy.dsl.data.Data] | ~tmnpy.dsl.data.Data = [], security_property: ~tmnpy.dsl.requirement.SecurityProperty = <tmnpy.dsl.requirement.SecurityProperty object>)

A component is very similar to an element, but it specifically refers to a component of the system being threat modeled (rather than an element of the threat model), i.e. assets and flows.

Attributes:
children

Children Elements.

controls

Controls that have been assigned to the Asset

data
desc

Description of the Element

name

Name of the Element

parent

Parent Element.

security_property
threats

Threats that have been assigned to the Asset

Methods

add_child(child)

add_child allows you to add a single child to an Element.

remove_child(child)

remove_child allows you to remove a single child to an Element.

add_control

add_data

add_threat

remove_control

remove_data

remove_threat

__init__(name: str, desc: str = 'N/A', data: list[~tmnpy.dsl.data.Data] | ~tmnpy.dsl.data.Data = [], security_property: ~tmnpy.dsl.requirement.SecurityProperty = <tmnpy.dsl.requirement.SecurityProperty object>) None

Methods

__init__(name[, desc, data, security_property])

add_child(child)

add_child allows you to add a single child to an Element.

add_control(control)

add_data(val)

add_threat(threat)

remove_child(child)

remove_child allows you to remove a single child to an Element.

remove_control(control)

remove_data(val)

remove_threat(threat)

Attributes

children

Children Elements.

controls

Controls that have been assigned to the Asset

data

desc

Description of the Element

name

Name of the Element

parent

Parent Element.

security_property

threats

Threats that have been assigned to the Asset