speed47 / spectre-meltdown-checker

Reptar, Downfall, Zenbleed, ZombieLoad, RIDL, Fallout, Foreshadow, Spectre, Meltdown vulnerability/mitigation checker for Linux & BSD
3.87k stars 476 forks source link

Abort if script not run with root privileges #188

Open wenslayer opened 6 years ago

wenslayer commented 6 years ago

While it's commendable the README documents to run the script via sudo, and the script itself warns in red letters at the beginning when not run with root privileges, I've had too many coworkers report false positives that their machines/VMs are vulnerable (all they see in the verbose output is > STATUS: VULNERABLE😱).

Please consider aborting if not run with root privileges.

Or perhaps change the status if not run with root privs to VULNERBALE (BUT YOU DIDN'T RUN THIS WITH ROOT PRIVS, SO WHAT DO YOU EXPECT?). :smirk:

Edit: OSes in question: CentOS7, Amazon Linux 2017.09.

ghost commented 6 years ago

Root isn't required. The scripts generates the exact same results on my Ryzen machine with or without root.

wenslayer commented 6 years ago

Likely depends on the OS distro.

speed47 commented 6 years ago

Indeed in some cases it could happen that the person running the script doesn't have root access for some reason, and still want to try to have some information about the system. As depending on the kernel and the distro, some or all information might be available without root, I don't want to forcefully abort the script if not root :)

wenslayer commented 6 years ago

That sounds reasonable, can't argue there.

Any ideas on improving the user experience for those running this script as non-root that actually need root that yields a "vulnerable" warning as a result?