259 points · by jkaftzan · 5y ago · 95 comments
Every time a project with curl | sh is featured on HN this comes up. At this point we might as well write a bot that scrapes submitted pages for "curl * | * (sh|bash)" and leave this comment for all of them.
This is gatekeeping 101. Some people are just starting out in security/software engineering and things like this might not be obvious to them. It's good that you have suggested what to do but there are different ways to "suggest" things.
What? How?
> Some people are just starting out in security/software engineering and things like this might not be obvious to them
That's fair enough. But I wished these beginners then didn't make claims like "security tools cannot be installed like this, it's insecure", and we would all be better off.
Either you know what you're talking about and you share your knowledge. Or, you listen and ask questions in order to eventually know what you're talking about.
Kubescape can now check that YAML files and HELM charts are configured correctly as defined by NSA and CISA guidance.
No cluster is required and you can scan for misconfigurations as early as when devs are submitting the K8s manifest files.
Kubescape supports new output formats like json and junit xml.
You can integrate Kubescape results output to any devops tool like Jenkins, CricleCI, Github workflows.
If you haven’t checked it out yet, what are you waiting for? https://github.com/armosec/kubescape/
It also covers some areas that aren't in-scope of the CIS benchmark, at a high level.
I don't trust an organization that keeps Zero days to themselves for offensive capabilities.
> this is the group that will use zero day hack
So, the initial comment was right. NSA does keep zero days to themselves so obviously other things are more important than the security of US public/private entities. Otherwise they'd want those patches, but other missions are more important.
[0] https://www.arp242.net/curl-to-sh.html [1] https://sandstorm.io/news/2015-09-24-is-curl-bash-insecure-p...
One side is a small-but-vocal minority making silly arguments. "how to detect direct piping to bash in order to serve malware"? An attacker who tries to serve different things to different people will easily be caught, and a simple diff will highlight their exploit. A much more robust attack strategy is to serve the same malware to everyone but obfuscate it. Make the vulnerability look like an innocent bug, and you have plausible deniability. This same attack works for every approach to software distribution, it's not unique to curl|bash.
The vast majority of pragmatic people just don't think there's an issue here, don't find these arguments convincing, and don't care to argue about it. I run the Sandstorm project, which uses curl|bash, and this issue really hasn't impacted adoption. Our users aren't naive, they understand what curl|bash is, but they also recognize that obviously by installing our software they are giving us arbitrary code execution. Users who don't trust us install Sandstorm in a separate VM -- the only reasonable way to run software you are suspicious of.
Comparisons with flat earthers is just insulting.
Most people who eschew curl|bash as being a fine thing rely quite heavily on the notion that TLS is infallible.
But there's a lot more dangerous to it than that; half-downloaded scripts or scripts which check your useragent and change content depending on the method of download.
It's just a stupid foot gun, best to avoid aiming guns at feet.
1) Generate a GPG private key.
2) Upload the public key to a public key server.
3) Sign your software with the key and generate a .asc file.
4) Upload your .asc file along with the software you signed to your hoster of choice.
5) Have the user copy+paste a shell one-liner that will download the files, download the public key from the public key server, import the key, verify the files are signed correctly, and install them.
The end result is cryptographic verification of your software before installation (using a 3rd party, or possibly multiple 3rd parties if you use multiple key servers) and the user only had to copy+paste a one-liner.
It's not as cool as piping to bash, but it's more secure, and more reliable (what happens when your download fails half way through installing through this bash pipe? what happens if bash hangs half way through? what if you want to install offline?)
It's quite presumptive to presume to know how a target system is to be configured.
no matter which alternative, curl|bash is security risk enough to never use: https://www.idontplaydarts.com/2016/04/detecting-curl-pipe-b...
gpg can help (below from zerotier): curl -s 'https://raw.githubusercontent.com/zerotier/ZeroTierOne/maste...' | gpg --import && \ if z=$(curl -s 'https://install.zerotier.com/' | gpg); then echo "$z" | sudo bash; fi
I'm aware of the fact that you can detect curl | bash server-side, and it's a neat trick, but I don't understand the security risk of it. The server is supplying you with arbitrary content that you're not auditing - what does it matter if it supplies you different arbitrary content?
What's the advantage of the GPG approach? Last I checked, the GPG command was capable of signing malicious binaries.
I do agree about the configuration argument. But that's not a security argument.
The only thing the installer script is doing is autodetecting your OS, picking the correct binary release, downloading it, making it executable, and copying it to /usr/local/bin. The installation instructions could just as easily tell you to do that. As with most go programs, the entire thing is just one file. No libraries, no config files, no dependencies.
Heck, wrapping it in a deb, rpm, and tarball for pacman would be easy as heck, just a one-line installer script: install -m755 <program> <prefix>/bin. I guess single-application developers just really don't like package managers.
Edit: and why even more silent downvotes?
Immutable fs & non-root is easier than I thought to deploy with k8s, going to be looking into privilege drops this week too.
Great!
and Kubernetes also added StatefulSets for things like database, but all kubernetes gurus don't recommend to use it in Cloud, but use databases provided by the cloud providers :facepalm because, well, it's too complicated...