class Scaler(odm.Model): service_defaults: ScalerServiceDefaults = odm.Compound( ScalerServiceDefaults) # only available for docker hosts, not kubernetes cpu_overallocation: float = odm.Float(default=1) memory_overallocation: float = odm.Float(default=1) # Additional labels to be applied to deployments in kubernetes('=' delimited) additional_labels: List[str] = odm.Optional(odm.List(odm.Text()))
class Status(odm.Model): running = odm.Integer() target = odm.Integer() minimum = odm.Integer() maximum = odm.Integer() dynamic_maximum = odm.Integer() queue = odm.Integer() pressure = odm.Float() duty_cycle = odm.Float()
class Status(odm.Model): running = odm.Integer(description="Number of instances running") target = odm.Integer(description="Target scaling for service") minimum = odm.Integer(description="Minimum number of instances") maximum = odm.Integer(description="Maximum number of instances") dynamic_maximum = odm.Integer( description="Dynamic maximum number of instances") queue = odm.Integer(description="Service queue") pressure = odm.Float(description="Service pressure") duty_cycle = odm.Float(description="Duty Cycle")
class Scaler(odm.Model): service_defaults: ScalerServiceDefaults = odm.Compound( ScalerServiceDefaults, description="Defaults Scaler will assign to a service.") cpu_overallocation: float = odm.Float( description="Percentage of CPU overallocation") memory_overallocation: float = odm.Float( description="Percentage of RAM overallocation") additional_labels: List[str] = odm.Optional( odm.List(odm.Text()), description="Additional labels to be applied to services('=' delimited)" )
class Sections(odm.Model): name = odm.Optional(odm.EmptyableKeyword(copyto="__text__")) characteristics_hash = odm.Optional(odm.Integer()) characteristics_list = odm.Optional( odm.List(odm.EmptyableKeyword(copyto="__text__"))) entropy = odm.Optional(odm.Float()) entropy_without_padding = odm.Optional(odm.Float()) md5 = odm.Optional(odm.MD5()) offset = odm.Optional(odm.Integer()) size = odm.Optional(odm.Integer()) sizeof_raw_data = odm.Optional(odm.Integer()) virtual_address = odm.Optional(odm.Integer()) virtual_size = odm.Optional(odm.Integer()) virtual_address = odm.Optional(odm.Integer()) fullname = odm.Optional(odm.EmptyableKeyword(copyto="__text__"))
class DockerConfig(odm.Model): allow_internet_access: bool = odm.Boolean( default=False, description="Does the container have internet-access?") command: Opt[list[str]] = odm.Optional( odm.List(odm.Keyword()), description="Command to run when container starts up.") cpu_cores: float = odm.Float(default=1.0, description="CPU allocation") environment: list[EnvironmentVariable] = odm.List( odm.Compound(EnvironmentVariable), default=[], description="Additional environemnt variables for the container") image: str = odm.Keyword( description= "Complete name of the Docker image with tag, may include registry") registry_username: Opt[str] = odm.Optional( odm.Keyword(), description="The username to use when pulling the image") registry_password: Opt[str] = odm.Optional( odm.Keyword(), description="The password or token to use when pulling the image") registry_type: str = odm.Enum(values=["docker", "harbor"], default='docker', description="The type of container registry") ports: list[str] = odm.List( odm.Keyword(), default=[], description="What ports of container to expose?") ram_mb: int = odm.Integer(default=512, description="Container RAM limit") ram_mb_min: int = odm.Integer(default=128, description="Container RAM request")
class Resource(odm.Model): # Since we will end up flattening the Resources and only keeping the data nodes, # we keep the list of parent's resource_id and the list of parent's labels (name or resource_type) parent_resource_ids = odm.Optional( odm.EmptyableKeyword(copyto="__text__")) parent_labels = odm.Optional( odm.List(odm.EmptyableKeyword(copyto="__text__"))) characteristics = odm.Optional(odm.Integer()) num_childs = odm.Optional(odm.Integer()) depth = odm.Optional(odm.Integer()) name = odm.Optional(odm.EmptyableKeyword(copyto="__text__")) resource_id = odm.Optional(odm.Integer()) resource_type = odm.Optional(odm.EmptyableKeyword(copyto="__text__")) is_data = odm.Optional(odm.Boolean()) is_directory = odm.Optional(odm.Boolean()) major_version = odm.Optional(odm.Integer()) minor_version = odm.Optional(odm.Integer()) numberof_id_entries = odm.Optional(odm.Integer()) numberof_name_entries = odm.Optional(odm.Integer()) time_date_stamp = odm.Optional(odm.Integer()) hr_time_date_stamp = odm.Optional(odm.Date()) code_page = odm.Optional(odm.Integer()) sha256 = odm.Optional(odm.SHA256()) entropy = odm.Optional(odm.Float()) offset = odm.Optional(odm.Integer()) reserved = odm.Optional(odm.Integer())
class DockerConfig(odm.Model): allow_internet_access: bool = odm.Boolean(default=False) command: Opt[List[str]] = odm.Optional(odm.List(odm.Keyword())) cpu_cores: float = odm.Float(default=1.0) environment: List[EnvironmentVariable] = odm.List(odm.Compound(EnvironmentVariable), default=[]) image: str = odm.Keyword() # Complete name of the Docker image with tag ports: List[str] = odm.List(odm.Keyword(), default=[]) ram_mb: int = odm.Integer(default=1024)
class DockerConfigDelta(odm.Model): allow_internet_access = odm.Optional(odm.Boolean()) command = odm.Optional(odm.List(odm.Keyword())) cpu_cores = odm.Optional(odm.Float()) environment = odm.Optional(odm.List(odm.Compound(EnvironmentVariable))) image = odm.Optional(odm.Keyword()) ports = odm.Optional(odm.List(odm.Keyword())) ram_mb = odm.Optional(odm.Integer())
class FileScore(odm.Model): psid = odm.Optional( odm.UUID()) # ID of the parent submission to the associated submission expiry_ts = odm.Date( index=True) # Expiry timestamp, used for garbage collection. score = odm.Integer() # Maximum score for the associated submission errors = odm.Integer( ) # Number of errors that occurred during the previous analysis sid = odm.UUID() # ID of the associated submission time = odm.Float() # Epoch time at which the FileScore entry was created
class DockerConfig(odm.Model): allow_internet_access: bool = odm.Boolean(default=False) command: Opt[List[str]] = odm.Optional(odm.List(odm.Keyword())) cpu_cores: float = odm.Float(default=1.0) environment: List[EnvironmentVariable] = odm.List(odm.Compound(EnvironmentVariable), default=[]) image: str = odm.Keyword() # Complete name of the Docker image with tag, may include registry registry_username = odm.Optional(odm.Keyword()) # The username to use when pulling the image registry_password = odm.Optional(odm.Keyword()) # The password or token to use when pulling the image ports: List[str] = odm.List(odm.Keyword(), default=[]) ram_mb: int = odm.Integer(default=512) ram_mb_min: int = odm.Integer(default=128)
class FileScore(odm.Model): psid = odm.Optional( odm.UUID(), description=" Parent submission ID of the associated submission") expiry_ts = odm.Date( index=True, description="Expiry timestamp, used for garbage collection") score = odm.Integer( description="Maximum score for the associated submission") errors = odm.Integer( description= "Number of errors that occurred during the previous analysis") sid = odm.UUID(description="ID of the associated submission") time = odm.Float( description="Epoch time at which the FileScore entry was created")
class DockerConfigDelta(odm.Model): allow_internet_access = odm.Optional(odm.Boolean()) command = odm.Optional(odm.List(odm.Keyword())) cpu_cores = odm.Optional(odm.Float()) environment = odm.Optional(odm.List(odm.Compound(EnvironmentVariable))) image = odm.Optional( odm.Keyword() ) # The docker image and tag, optionally including registry in the normal way registry_username = odm.Optional( odm.Keyword()) # The username to use when pulling the image registry_password = odm.Optional( odm.Keyword()) # The password or token to use when pulling the image ports = odm.Optional(odm.List(odm.Keyword())) ram_mb = odm.Optional(odm.Integer()) ram_mb_min = odm.Optional(odm.Integer())
class Services(odm.Model): categories: List[str] = odm.List( odm.Keyword(), description="List of categories a service can be assigned to") default_timeout: int = odm.Integer( description="Default service timeout time in seconds") min_service_workers: int = odm.Integer( description= "The minimum number of service instances to always be running.") stages: List[str] = odm.List( odm.Keyword(), description="List of execution stages a service can be assigned to") image_variables: Dict[str, str] = odm.Mapping( odm.Keyword(default=''), description="Substitution variables for image paths " "(for custom registry support)") update_image_variables: Dict[str, str] = odm.Mapping( odm.Keyword(default=''), description= "Similar to `image_variables` but only applied to the updater. " "Intended for use with local registries.") preferred_update_channel: str = odm.Keyword( description="Default update channel to be used for new services") allow_insecure_registry: bool = odm.Boolean( description="Allow fetching container images from insecure registries") preferred_registry_type: str = odm.Enum( values=["docker", "harbor"], default='docker', description= "Global registry type to be used for fetching updates for a service (overridable by a service)" ) prefer_service_privileged: bool = odm.Boolean( default=False, description="Global preference that controls if services should be " "privileged to communicate with core infrastucture") cpu_reservation: float = odm.Float( description= "How much CPU do we want to reserve relative to the service's request?<br>" "At `1`, a service's full CPU request will be reserved for them.<br>" "At `0` (only for very small appliances/dev boxes), the service's CPU will be limited " "but no CPU will be reserved allowing for more flexible scheduling of containers." ) safelist = odm.Compound(ServiceSafelist)
class File(odm.Model): archive_ts = odm.Date(store=False, description="Archiving timestamp") ascii = odm.Keyword(index=False, store=False, description="Dotted ASCII representation of the first 64 bytes of the file") classification = odm.Classification(description="Classification of the file") entropy = odm.Float(description="Entropy of the file") expiry_ts = odm.Optional(odm.Date(store=False), description="Expiry timestamp") is_section_image = odm.Boolean(default=False, description="Is this an image from an Image Result Section?") hex = odm.Keyword(index=False, store=False, description="Hex dump of the first 64 bytes of the file") md5 = odm.MD5(copyto="__text__", description="MD5 of the file") magic = odm.Keyword(store=False, description="Output from libmagic related to the file") mime = odm.Optional(odm.Keyword(store=False), description="MIME type of the file as identified by libmagic") seen = odm.Compound(Seen, default={}, description="Details about when the file was seen") sha1 = odm.SHA1(copyto="__text__", description="SHA1 hash of the file") sha256 = odm.SHA256(copyto="__text__", description="SHA256 hash of the file") size = odm.Integer(description="Size of the file in bytes") ssdeep = odm.SSDeepHash(store=False, description="SSDEEP hash of the file") type = odm.Keyword(copyto="__text__", description="Type of file as identified by Assemblyline")
class DockerConfigDelta(odm.Model): allow_internet_access = odm.Optional( odm.Boolean(), description= "Refer to:<br>[Service - DockerConfig](../service/#dockerconfig)") command = odm.Optional( odm.List(odm.Keyword()), description= "Refer to:<br>[Service - DockerConfig](../service/#dockerconfig)") cpu_cores = odm.Optional( odm.Float(), description= "Refer to:<br>[Service - DockerConfig](../service/#dockerconfig)") environment = odm.Optional( odm.List(odm.Compound(EnvironmentVariable)), description= "Refer to:<br>[Service - DockerConfig](../service/#dockerconfig)") image = odm.Optional( odm.Keyword() ) # The docker image and tag, optionally including registry in the normal way registry_username = odm.Optional( odm.Keyword()) # The username to use when pulling the image registry_password = odm.Optional( odm.Keyword()) # The password or token to use when pulling the image # The type of registry (Docker, Harbor, description="Refer to:<br>[Service - DockerConfig](../service/#dockerconfig)") registry_type = odm.Optional(odm.Enum(values=["docker", "harbor"])) ports = odm.Optional( odm.List(odm.Keyword()), description= "Refer to:<br>[Service - DockerConfig](../service/#dockerconfig)") ram_mb = odm.Optional( odm.Integer(), description= "Refer to:<br>[Service - DockerConfig](../service/#dockerconfig)") ram_mb_min = odm.Optional( odm.Integer(), description= "Refer to:<br>[Service - DockerConfig](../service/#dockerconfig)")
class File(odm.Model): archive_ts = odm.Date(store=False) # Archiving timestamp ascii = odm.Keyword( index=False, store=False ) # Dotted ascii representation of the first 64 bytes of the file classification = odm.Classification() # Classification of the file entropy = odm.Float() # Entropy of the file expiry_ts = odm.Optional(odm.Date(store=False)) # Expiry timestamp hex = odm.Keyword( index=False, store=False) # Hex dump of the first 64 bytes of the file md5 = odm.MD5(copyto="__text__") # MD5 of the top level file magic = odm.Keyword( store=False) # Output from libmagic related to that file mime = odm.Optional(odm.Keyword( store=False)) # Mime type of the file as identified by libmagic seen = odm.Compound(Seen, default={}) # Attributes about when the file was seen sha1 = odm.SHA1(copyto="__text__") # SHA1 hash of the file sha256 = odm.SHA256(copyto="__text__") # SHA256 hash of the file size = odm.Integer() # Size of the file ssdeep = odm.SSDeepHash(store=False) # SSDEEP hash of the file type = odm.Keyword( copyto="__text__") # Type of file as identified by Assemblyline
class Resources(odm.Model): cpu_usage = odm.Float() disk_usage_free = odm.Integer() disk_usage_percent = odm.Float() mem_usage = odm.Float()
class Scaler(odm.Model): service_defaults: ScalerServiceDefaults = odm.Compound( ScalerServiceDefaults) # only available for docker hosts, not kubernetes cpu_overallocation: float = odm.Float(default=1) memory_overallocation: float = odm.Float(default=1)
class Metrics(odm.Model): memory_free = odm.Float(description="Amount of free memory") cpu_free = odm.Float(description="Amount of free CPU") memory_total = odm.Float(description="Amount of total memory") cpu_total = odm.Float(description="Amount of total CPU")
class Metrics(odm.Model): memory_free = odm.Float() cpu_free = odm.Float() memory_total = odm.Float() cpu_total = odm.Float()
class Overlay(odm.Model): size = odm.Optional(odm.Integer()) entropy = odm.Optional(odm.Float())