tenable / terrascan

Detect compliance and security violations across Infrastructure as Code to mitigate risk before provisioning cloud native infrastructure.
https://runterrascan.io
Apache License 2.0
4.77k stars 503 forks source link

Horribly Broken Install Instructions and Wrong Binary for Linux in Latest Release #1716

Open R3ITOSv87 opened 1 month ago

R3ITOSv87 commented 1 month ago

Terrascan Version: Latest
Operating System: Kali WSL on Windows

Description

Look, whoever wrote these installation instructions might want to reconsider their career choices. The install script is a joke—it's like you didn't even test it on anything.

  1. First problem: trailing # Why in the world would you put a # in the beginning of a shell command in a code-Box? This isn't a place for comment syntax. It breaks the whole copy-paste experience. If you're going to provide a one-liner, at least make sure it works after someone pastes it into their terminal. A six-year-old could’ve done better.

  2. Second problem: deleting files right after installing them install terrascan /usr/local/bin && rm terrascan—are you serious? This is such a stupid practice that it's hard to know where to begin. If something goes wrong, congratulations! The binary is gone, and there's no way to debug the issue. Stop trying to be clever with && chains where they don't belong.

  3. Third problem: the wrong binary Even after forcing the install with sudo, I get hit with this gem:

    -bash: /usr/local/bin/terrascan: cannot execute binary file: Exec format error

    Turns out, the binary you provided is for macOS (Mach-O format). You do realize that most Admins are running Windows or Linux, right? This isn't macOS, and yet you’re handing me a Mach-O binary. Nice job! Way to completely ignore platform compatibility. Bravo.

What I Did

$ curl -L "$(curl -s https://api.github.com/repos/tenable/terrascan/releases/latest | grep -o -E "https[^\"]+linux_amd64.tar.gz")" -o terrascan.tar.gz
$ tar -xf terrascan.tar.gz terrascan && rm terrascan.tar.gz
$ sudo install terrascan /usr/local/bin && rm terrascan
$ terrascan
-bash: /usr/local/bin/terrascan: cannot execute binary file: Exec format error
$ file terrascan
terrascan: Mach-O 64-bit x86_64 executable, flags:<|DYLDLINK|PIE>

This isn't hard. Provide the right binary for Linux. Fix your instructions. This is just embarrassing.