config
- class config.Backend(*args, **kwargs)
Bases:
Common
- Parameters:
args (Any) –
kwargs (Any) –
- Return type:
Any
- class BinarySearch(*args, **kwargs)
Bases:
BaseModel
- Parameters:
args (Any) –
kwargs (Any) –
- Return type:
Any
- max_strings_per_match: int = 10
- class Plugin(*args, **kwargs)
Bases:
BaseModel
- Parameters:
args (Any) –
kwargs (Any) –
- Return type:
Any
- name: str
- class PluginDefaults(*args, **kwargs)
Bases:
BaseModel
- Parameters:
args (Any) –
kwargs (Any) –
- Return type:
Any
- processes: int
- class Unpacking(*args, **kwargs)
Bases:
BaseModel
- Parameters:
args (Any) –
kwargs (Any) –
- Return type:
Any
- base_port: int
- delay: float
- max_depth: int
- memory_limit: int = 2048
- processes: int
- throttle_limit: int
- whitelist: list
- binary_search: Backend.BinarySearch
- block_delay: float
- collector_worker_count: int = 2
- firmware_file_storage_directory: str
- intercom_poll_delay: float
- plugin: Dict[str, Backend.Plugin]
- plugin_defaults: Backend.PluginDefaults
- scheduling_worker_count: int = 4
- ssdeep_ignore: int
- throw_exceptions: bool
- unpacking: Backend.Unpacking
- class config.Common(*args, **kwargs)
Bases:
BaseModel
- Parameters:
args (Any) –
kwargs (Any) –
- Return type:
Any
- class AnalysisPreset(*args, **kwargs)
Bases:
BaseModel
- Parameters:
args (Any) –
kwargs (Any) –
- Return type:
Any
- name: str
- plugins: List[str]
- class Logging(*args, **kwargs)
Bases:
BaseModel
- Parameters:
args (Any) –
kwargs (Any) –
- Return type:
Any
- file_backend: str = '/tmp/fact_backend.log'
- file_database: str = '/tmp/fact_database.log'
- file_frontend: str = '/tmp/fact_frontend.log'
- level: str = 'WARNING'
- class Postgres(*args, **kwargs)
Bases:
BaseModel
- Parameters:
args (Any) –
kwargs (Any) –
- Return type:
Any
- admin_pw: str
- admin_user: str
- database: str
- del_pw: str
- del_user: str
- port: int
- ro_pw: str
- ro_user: str
- rw_pw: str
- rw_user: str
- server: str
- test_database: str
- class Redis(*args, **kwargs)
Bases:
BaseModel
- Parameters:
args (Any) –
kwargs (Any) –
- Return type:
Any
- fact_db: int
- host: str
- password: str | None = None
- port: int
- test_db: int
- analysis_preset: Dict[str, Common.AnalysisPreset]
- docker_mount_base_dir: str
- logging: Common.Logging
- postgres: Common.Postgres
- redis: Common.Redis
- temp_dir_path: str = '/tmp'
- class config.Frontend(*args, **kwargs)
Bases:
Common
- Parameters:
args (Any) –
kwargs (Any) –
- Return type:
Any
- class Authentication(*args, **kwargs)
Bases:
BaseModel
- Parameters:
args (Any) –
kwargs (Any) –
- Return type:
Any
- enabled: bool
- password_salt: str
- user_database: str
- class Hasura(*args, **kwargs)
Bases:
BaseModel
- Parameters:
args (Any) –
kwargs (Any) –
- Return type:
Any
- admin_secret: str
- port: int = 33333
- ajax_stats_reload_time: int
- authentication: Frontend.Authentication
- communication_timeout: int = 60
- hasura: Frontend.Hasura
- max_elements_per_chart: int = 10
- number_of_latest_firmwares_to_display: int = 10
- radare2_url: str
- results_per_page: int
- config.backend()
Proxy to an instance of
Backend
May only be used in parts of the code that are backend code.
- config.common()
Proxy to an instance of
Common
May only be used in parts of the code that are neither frontend nor backend code.
- config.frontend()
Proxy to an instance of
Frontend
May only be used in parts of the code that are frontend code.
- config.load(path=None)
Load the config file located at
path
. The file must be a toml file and is read into instances ofBackend
,Frontend
andCommon
.These instances can be accessed via
config.backend
after calling this function.Important
This function may not be imported by
from config import load
. It may only be imported byimport config
and then used byconfig.load()
. The reason is that testing code can’t patch this function if it was already imported. When you only import theconfig
module theload
function will be looked up at runtime. See this blog entry for some more information.- Parameters:
path (str | Path | None) –