generic_oscal
trestle.core.generic_oscal
¤
Generic classes to support both SSP and DefinedComponents.
Attributes¤
IMPLEMENTED_REQUIREMENTS = 'implemented_requirements'
module-attribute
¤
logger = logging.getLogger(__name__)
module-attribute
¤
Classes¤
GenericByComponent
¤
Bases: TrestleBaseModel
Generic ByComponent for SSP and DefinedComponent.
Source code in trestle/core/generic_oscal.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
Attributes¤
component_uuid: constr(regex='^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$') = Field(..., alias='component_uuid', description='A machine-oriented identifier reference to the component that is implemeting a given control.', title='Component Universally Unique Identifier Reference')
class-attribute
instance-attribute
¤
description: str = Field(..., description='An implementation statement that describes how a control or a control statement is implemented within the referenced system component.', title='Control Implementation Description')
class-attribute
instance-attribute
¤
implementation_status: Optional[common.ImplementationStatus] = Field(None, alias='implementation-status')
class-attribute
instance-attribute
¤
links: Optional[List[common.Link]] = Field(None)
class-attribute
instance-attribute
¤
props: Optional[List[common.Property]] = Field(None)
class-attribute
instance-attribute
¤
remarks: Optional[str] = None
class-attribute
instance-attribute
¤
responsible_roles: Optional[List[common.ResponsibleRole]] = Field(None, alias='responsible-roles')
class-attribute
instance-attribute
¤
set_parameters: Optional[List[GenericSetParameter]] = Field(None, alias='set-parameters')
class-attribute
instance-attribute
¤
uuid: constr(regex='^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$') = Field(..., description='A machine-oriented, globally unique identifier with cross-instance scope that can be used to reference this by-component entry elsewhere in this or other OSCAL instances. The locally defined UUID of the by-component entry can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned per-subject, which means it should be consistently used to identify the same subject across revisions of the document.', title='By-Component Universally Unique Identifier')
class-attribute
instance-attribute
¤
Functions¤
as_ssp()
¤
Convert to ssp format.
Source code in trestle/core/generic_oscal.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
generate()
staticmethod
¤
Generate instance of generic ByComponent.
Source code in trestle/core/generic_oscal.py
71 72 73 74 75 |
|
GenericComponent
¤
Bases: TrestleBaseModel
Generic component for SSP SystemComponent and DefinedComponent.
Source code in trestle/core/generic_oscal.py
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 |
|
Attributes¤
control_implementations: Optional[List[GenericControlImplementation]] = Field(None, alias='control-implementations')
class-attribute
instance-attribute
¤
description: str = Field(..., description='A description of the component, including information about its function.', title='Component Description')
class-attribute
instance-attribute
¤
links: Optional[List[common.Link]] = Field(None)
class-attribute
instance-attribute
¤
props: Optional[List[common.Property]] = Field(None)
class-attribute
instance-attribute
¤
protocols: Optional[List[common.Protocol]] = Field(None)
class-attribute
instance-attribute
¤
purpose: Optional[str] = Field(None, description='A summary of the technological or business purpose of the component.', title='Purpose')
class-attribute
instance-attribute
¤
remarks: Optional[str] = None
class-attribute
instance-attribute
¤
responsible_roles: Optional[List[common.ResponsibleRole]] = Field(None, alias='responsible-roles')
class-attribute
instance-attribute
¤
status: common.ImplementationStatus
instance-attribute
¤
title: str = Field(..., description='A human readable name for the component.', title='Component Title')
class-attribute
instance-attribute
¤
type: constr(regex='^\\S(.*\\S)?$') = Field(..., description='A category describing the purpose of the component.', title='Component Type')
class-attribute
instance-attribute
¤
uuid: constr(regex='^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$') = Field(..., description='A machine-oriented, globally unique identifier with cross-instance scope that can be used to reference this component elsewhere in this or other OSCAL instances. The locally defined UUID of the component can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned per-subject, which means it should be consistently used to identify the same subject across revisions of the document.', title='Component Identifier')
class-attribute
instance-attribute
¤
Functions¤
as_defined_component()
¤
Convert to DefinedComponent.
Source code in trestle/core/generic_oscal.py
191 192 193 194 195 196 197 198 |
|
as_system_component(status_override='')
¤
Convert to SystemComponent.
Source code in trestle/core/generic_oscal.py
214 215 216 217 218 219 220 221 222 223 224 225 226 |
|
from_defined_component(def_comp)
classmethod
¤
Convert defined component to generic.
Source code in trestle/core/generic_oscal.py
200 201 202 203 204 205 206 207 208 209 210 211 212 |
|
generate()
staticmethod
¤
Generate instance of GenericComponent.
Source code in trestle/core/generic_oscal.py
228 229 230 231 232 233 |
|
GenericControlImplementation
¤
Bases: TrestleBaseModel
Generic control implementation for SSP and CompDef.
Source code in trestle/core/generic_oscal.py
326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 |
|
Attributes¤
description: str = Field(..., description='A description of how the specified set of controls are implemented for the containing component or capability.', title='Control Implementation Description')
class-attribute
instance-attribute
¤
implemented_requirements: List[GenericImplementedRequirement] = Field(..., alias='implemented-requirements')
class-attribute
instance-attribute
¤
links: Optional[List[common.Link]] = Field(None)
class-attribute
instance-attribute
¤
props: Optional[List[common.Property]] = Field(None)
class-attribute
instance-attribute
¤
set_parameters: Optional[List[GenericSetParameter]] = Field(None, alias='set-parameters')
class-attribute
instance-attribute
¤
source: str = Field(..., description='A reference to an OSCAL catalog or profile providing the referenced control or subcontrol definition.', title='Source Resource Reference')
class-attribute
instance-attribute
¤
uuid: constr(regex='^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$') = Field(..., description='A machine-oriented, globally unique identifier with cross-instance scope that can be used to reference a set of implemented controls elsewhere in this or other OSCAL instances. The locally defined UUID of the control implementation set can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance). This UUID should be assigned per-subject, which means it should be consistently used to identify the same subject across revisions of the document.', title='Control Implementation Set Identifier')
class-attribute
instance-attribute
¤
Functions¤
as_ssp()
¤
Represent in ssp form.
Source code in trestle/core/generic_oscal.py
393 394 395 396 397 398 399 400 401 402 403 404 |
|
from_component_ci(control_imp)
classmethod
¤
Convert component control imp to generic.
Source code in trestle/core/generic_oscal.py
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 |
|
generate()
staticmethod
¤
Generate instance of this class.
Source code in trestle/core/generic_oscal.py
358 359 360 361 362 363 364 365 366 367 368 369 370 |
|
GenericImplementedRequirement
¤
Bases: TrestleBaseModel
Generic ImplementedRequirement for SSP and DefinedComponent.
Source code in trestle/core/generic_oscal.py
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 |
|
Attributes¤
by_components: Optional[List[GenericByComponent]] = Field(None, alias='by-components')
class-attribute
instance-attribute
¤
control_id: constr(regex='^[_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-\\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$') = Field(..., alias='control-id', description='A human-oriented identifier reference to a control with a corresponding id value. When referencing an externally defined control, the Control Identifier Reference must be used in the context of the external / imported OSCAL instance (e.g., uri-reference).', title='Control Identifier Reference')
class-attribute
instance-attribute
¤
description: str = Field(..., description='A description of how the specified control is implemented for the containing component or capability.', title='Control Implementation Description')
class-attribute
instance-attribute
¤
links: Optional[List[common.Link]] = Field(None)
class-attribute
instance-attribute
¤
props: Optional[List[common.Property]] = Field(None)
class-attribute
instance-attribute
¤
remarks: Optional[str] = None
class-attribute
instance-attribute
¤
responsible_roles: Optional[List[common.ResponsibleRole]] = Field(None, alias='responsible-roles')
class-attribute
instance-attribute
¤
set_parameters: Optional[List[GenericSetParameter]] = Field(None, alias='set-parameters')
class-attribute
instance-attribute
¤
statements: Optional[List[GenericStatement]] = Field(None)
class-attribute
instance-attribute
¤
uuid: constr(regex='^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$') = Field(..., description='A machine-oriented, globally unique identifier with cross-instance scope that can be used to reference a specific control implementation elsewhere in this or other OSCAL instances. The locally defined UUID of the control implementation can be used to reference the data item locally or globally (e.g., in an imported OSCAL instance).This UUID should be assigned per-subject, which means it should be consistently used to identify the same subject across revisions of the document.', title='Control Implementation Identifier')
class-attribute
instance-attribute
¤
Functions¤
as_ssp()
¤
Convert to ssp form.
Source code in trestle/core/generic_oscal.py
314 315 316 317 318 319 320 321 322 323 |
|
from_comp_def(imp_req)
classmethod
¤
Convert component form of imp req to generic.
Source code in trestle/core/generic_oscal.py
307 308 309 310 311 312 |
|
generate()
staticmethod
¤
Generate instance of this class.
Source code in trestle/core/generic_oscal.py
300 301 302 303 304 305 |
|
GenericSetParameter
¤
Bases: TrestleBaseModel
Generic SetParameter for SSP and DefinedComponent.
Source code in trestle/core/generic_oscal.py
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
|
Attributes¤
param_id: constr(regex='^[_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-\\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$') = Field(..., alias='param-id', description="A human-oriented reference to a parameter within a control, who's catalog has been imported into the current implementation context.", title='Parameter ID')
class-attribute
instance-attribute
¤
remarks: Optional[str] = None
class-attribute
instance-attribute
¤
values: List[str] = Field(...)
class-attribute
instance-attribute
¤
Functions¤
from_defined_component(sp)
staticmethod
¤
Generate generic set parameter from comp_def version.
Source code in trestle/core/generic_oscal.py
252 253 254 255 256 |
|
to_ssp()
¤
Convert to ssp format.
Source code in trestle/core/generic_oscal.py
258 259 260 |
|
GenericStatement
¤
Bases: TrestleBaseModel
Generic statement for SSP and DefinedComp.
Source code in trestle/core/generic_oscal.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
|
Attributes¤
by_components: Optional[List[GenericByComponent]] = Field(None, alias='by-components')
class-attribute
instance-attribute
¤
description: str = Field(..., description='A summary of how the containing control statement is implemented by the component or capability.', title='Statement Implementation Description')
class-attribute
instance-attribute
¤
links: Optional[List[common.Link]] = Field(None)
class-attribute
instance-attribute
¤
props: Optional[List[common.Property]] = Field(None)
class-attribute
instance-attribute
¤
remarks: Optional[str] = None
class-attribute
instance-attribute
¤
responsible_roles: Optional[List[common.ResponsibleRole]] = Field(None, alias='responsible-roles')
class-attribute
instance-attribute
¤
statement_id: constr(regex='^[_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-\\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$') = Field(..., alias='statement_id', description='A human-oriented identifier reference to a control statement.', title='Control Statement Reference')
class-attribute
instance-attribute
¤
uuid: constr(regex='^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}$') = Field(..., description='A machine-oriented, globally unique identifier with cross-instance scope that can be used to reference this control statement elsewhere in this or other OSCAL instances. The UUID of the control statement in the source OSCAL instance is sufficient to reference the data item locally or globally (e.g., in an imported OSCAL instance).', title='Control Statement Reference Universally Unique Identifier')
class-attribute
instance-attribute
¤
Functions¤
as_ssp()
¤
Represent in ssp form.
Source code in trestle/core/generic_oscal.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
|
Functions¤
handler: python