msticpy.config.mp_config_file module
Msticpy Config class.
- class msticpy.config.mp_config_file.MpConfigFile(file: str | Path | None = None, settings: SettingsDict | Dict[str, Any] | None = None)
Bases:
CompEditStatusMixin
,CompEditDisplayMixin
MSTICPy Configuration management class.
Use the functions from the commandline or display in a Jupyter notebook to use interactive version.
Create an instance of the MSTICPy Configuration helper class.
- Parameters:
file (Optional[str], optional) – config file path to use. If file is not supplied, the msticpyconfig path defaults to the system default location for msticpyconfig.yaml (MSTICPYCONFIG env var, current directory, home directory). This path will also be used as the location to save any changed settings. If file is supplied and exists, the configuration will be loaded from here, unless settings parameter is also is supplied. If settings is supplied the file path is used as the file to save configuration but the configuration settings are taken from the settings parameter If file is supplied but does not exist, no configuration is loaded but this path will be used as the file name to save any configuration by default None
settings (Optional[Dict[str, Any]], optional) – setting dict to load, by default None If a settings dictionary is supplied it will override any settings read from the file parameter.
- static border_layout(width='95%')
Return border widget layout.
- browse_for_file(show: bool = True)
Open the browser to browser/search for a file.
- clear_status()
Clear the status text.
- property current_file
Return currently loaded file path.
- property default_config_file
Return default msticpyconfig path.
- static get_workspace_from_url(url: str) Dict[str, Dict[str, str]]
Return workspace settings from Sentinel portal URL.
- Parameters:
url (str) – The URL of the Azure portal page for the Sentinel workspace.
- Returns:
Dictionary with a single element keyed by workspace name The value is the workspace settings dictionary for the workspace.
- Return type:
Dict[str, Dict[str, str]]
- load_default()
Load default settings specified by MSTICPYCONFIG env var.
- load_from_file(file: str | Path)
Load settings from file.
- map_json_to_mp_ws()
Map config.json settings to MSTICPy settings.
- static no_border_layout(width='95%')
Return no-border widget layout.
- static refresh_mp_config()
Refresh global MSTICPy settings from config file.
- save_to_file(file: str, backup: bool = True)
Save current configuration to file.
- Parameters:
file (str) – The file path to save to.
backup (bool, optional) – Create a backup file, if overwriting existing file, by default True
- set_status(status, timeout: float = 3.0)
Set the status text.
- show_kv_secrets(show: bool = True)
Show secrets from currently configured Key Vault.
- testing = False
- validate_settings(show: bool = True)
Run the validator against currently loaded settings.
- view_settings(show: bool = True)
View the current settings as text.