openc2lib.core.profile
OpenC2 Profile management
This module defines the concept of Profile and keeps a list of available Profiles
registered within the system.
1""" OpenC2 Profile management 2 3 This module defines the concept of Profile and keeps a list of available `Profiles` 4 registered within the system. 5""" 6 7from openc2lib.core.register import Register 8 9class Profile: 10 """OpenC2 Profile 11 12 This is the openc2lib interpretation of the Profile concept. It basically defines 13 a Profile namespace and the language extensions that are defined for that namespace. 14 15 A `Profile` is fully transparent to concrete implementation for controlling specific 16 security functions, which in openc2lib terminology is named `Actuator`. 17 18 Each Profile defined for openc2lib must inherit from this class. 19 """ 20 def __init__(self, nsid, name): 21 """ Creates the Profile 22 23 A Profile is identified by its namespace identifier and unique name. 24 :param nsid: the Profile NameSpace IDentifier 25 :param name: the Profile Unique Name (typically a URL) 26 """ 27 self.nsid = nsid 28 """Namespace Identifier""" 29 self.name = name 30 """Unique Name""" 31 32 def __str__(self): 33 return self.nsid 34 35Profiles = Register() 36"""List of registered `Profile`s 37 38 This is a dictionary of available `Profile`s within the system. When a new `Profile` is defined, 39 it must be registered in openc2lib before being used. 40 41 Multiple registration of the same Profile will raise a `ValueError` Excepction. 42 43 Usage: see the `Register` class interface. 44"""
class
Profile:
10class Profile: 11 """OpenC2 Profile 12 13 This is the openc2lib interpretation of the Profile concept. It basically defines 14 a Profile namespace and the language extensions that are defined for that namespace. 15 16 A `Profile` is fully transparent to concrete implementation for controlling specific 17 security functions, which in openc2lib terminology is named `Actuator`. 18 19 Each Profile defined for openc2lib must inherit from this class. 20 """ 21 def __init__(self, nsid, name): 22 """ Creates the Profile 23 24 A Profile is identified by its namespace identifier and unique name. 25 :param nsid: the Profile NameSpace IDentifier 26 :param name: the Profile Unique Name (typically a URL) 27 """ 28 self.nsid = nsid 29 """Namespace Identifier""" 30 self.name = name 31 """Unique Name""" 32 33 def __str__(self): 34 return self.nsid
OpenC2 Profile
This is the openc2lib interpretation of the Profile concept. It basically defines a Profile namespace and the language extensions that are defined for that namespace.
A Profile is fully transparent to concrete implementation for controlling specific
security functions, which in openc2lib terminology is named Actuator.
Each Profile defined for openc2lib must inherit from this class.
Profile(nsid, name)
21 def __init__(self, nsid, name): 22 """ Creates the Profile 23 24 A Profile is identified by its namespace identifier and unique name. 25 :param nsid: the Profile NameSpace IDentifier 26 :param name: the Profile Unique Name (typically a URL) 27 """ 28 self.nsid = nsid 29 """Namespace Identifier""" 30 self.name = name 31 """Unique Name"""
Creates the Profile
A Profile is identified by its namespace identifier and unique name.
Parameters
- nsid: the Profile NameSpace IDentifier
- name: the Profile Unique Name (typically a URL)
Profiles =
{'slpf': <class 'openc2lib.profiles.slpf.profile.slpf'>}