diff --git a/data/actionsmap/yunohost.yml b/data/actionsmap/yunohost.yml index 966de21df..9e8022964 100644 --- a/data/actionsmap/yunohost.yml +++ b/data/actionsmap/yunohost.yml @@ -1460,6 +1460,11 @@ tools: full: --force action: store_true + ### tools_reboot() + meltdown-spectre-check: + action_help: Check if the server is vulnerable to meltdown/spectre + api: GET /meltdown-spectre-check + subcategories: migrations: diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index cf52ad38f..13f3ea5fd 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -836,6 +836,14 @@ def tools_migrations_state(): return read_json(MIGRATIONS_STATE_PATH) +def tools_meltdown_spectre_check(): + """ + Check if the installation is vulnerable to meltdown/spectre. + """ + # source https://askubuntu.com/questions/992137/how-to-check-that-kpti-is-enabled-on-my-ubuntu + return {"safe": "cpu_insecure" in open("/proc/cpuinfo")} + + def tools_shell(auth, command=None): """ Launch an (i)python shell in the YunoHost context.