Parsing json in shell? Easy! filter="$(printf 's/. \[%s\][[:space:]] \([^"]*\)/\\1/p' "$(json_path "${1:-}" "${2:-}")")" Please, no! How can you know this is safe? Why not just use Python? It is installed pretty much everywhere, supports json without such hacks.
Dehydrated: Letsencrypt/acme client implemented as a shell-script
71–80 of 111 posts
Re: Dehydrated: Letsencrypt/acme client implemented as a shell-script
#72Parsing json in shell? Easy! filter="$(printf 's/. \[%s\][[:space:]] \([^"]*\)/\\1/p' "$(json_path "${1:-}" "${2:-}")")" Please, no! How can you know this is safe? Why not just use Python? It is installed pretty much everywhere, supports json without such hacks.
> It is installed pretty much everywhere Yes, but which version?
Re: Dehydrated: Letsencrypt/acme client implemented as a shell-script
#73Apparently the author recently sold the project to a company called apilayer: https://lukas.im/2020/01/30/selling-dehydrated/index.html They plan to keep the project open source and employ Lukas to continue maintaining it.
Re: Dehydrated: Letsencrypt/acme client implemented as a shell-script
#74What's the motivation behind closing file descriptors 3 and 4? # Close weird external file descriptors exec 3>&- exec 4>&- From this commit: https://github.com/dehydrated-io/dehydrated/commit/b116e6bc2...
When are those ever used? Is it to customize output for when you’re sending to a file vs terminal?
Re: Dehydrated: Letsencrypt/acme client implemented as a shell-script
#75Earlier quoted context omitted.
People are always talking like shell scripts are without dependencies. Shell scripting ist mostly piping program outputs to different programs, that have dependencies on libraries themselves. Each of them have to be kept up to date to stay secure. Just because they are mostly preinstalled on the system doesn't make them not a dependency. This, together with the fact that most shell scripting is bash based which is, i…
If it is just a few curl and openssl commands, why make a user install hundreds of megs of python deps just to ultimately call mostly openssl commands anyway One of the biggest risks today is supply chain attacks. The more dependencies you have, the more people you are giving the ability to tamper with your critical code paths.
awk, grep, curl, getent, sudo, mkdir, mv, ln, cat, rm, openssl, touch
Most of these have around 10 dependencies on libs.
Don't misunderstand me. I have nothing against the script. I just don't like the argument that bash is better because it has no dependencies.
Re: Dehydrated: Letsencrypt/acme client implemented as a shell-script
#76Parsing json in shell? Easy! filter="$(printf 's/. \[%s\][[:space:]] \([^"]*\)/\\1/p' "$(json_path "${1:-}" "${2:-}")")" Please, no! How can you know this is safe? Why not just use Python? It is installed pretty much everywhere, supports json without such hacks.
Re: Dehydrated: Letsencrypt/acme client implemented as a shell-script
#77Earlier quoted context omitted.
If it is just a few curl and openssl commands, why make a user install hundreds of megs of python deps just to ultimately call mostly openssl commands anyway One of the biggest risks today is supply chain attacks. The more dependencies you have, the more people you are giving the ability to tamper with your critical code paths.
I saw the following programs whil skimming the code: awk, grep, curl, getent, sudo, mkdir, mv, ln, cat, rm, openssl, touch Most of these have around 10 dependencies on libs. Don't misunderstand me. I have nothing against the script. I just don't like the argument that bash is better because it has no dependencies.
Re: Dehydrated: Letsencrypt/acme client implemented as a shell-script
#78Earlier quoted context omitted.
Absolutely there is still supply chain risk there. But less risk in 3 dependencies than 300.
3? You think you underestimate the number of libraries your software uses.
In this case you only actually need curl, openssl, and busybox. Those depend on at least a small libc implementation and a kernel but those are certainly already present.
Coreutils or busybox is probably already installed too. Still, I will grant the requirement of musl and a linux kernel since we are being pedantic or maybe talking about an embedded linux use case, so 5 deps total to boot from metal and get a cert.
To be fair I would never actually ship openssl or busybox in a real embedded project. Would probably write a simple standalone binary using the standard library of Go or something.
Re: Dehydrated: Letsencrypt/acme client implemented as a shell-script
#79Earlier quoted context omitted.
Static binary, sure, but hardly a tiny supply chain attack surface: https://github.com/go-acme/lego/blob/master/go.sum Also their official builds are built with Alpine which is a hobby distro that does not even do signed code or packages.
Are you saying that any use of Alpine is, by definition, a supply-chain security problem?
Alpine chooses low security for low contribution friction. It is the Wikipedia of Linux distros, which granted it a huge package repository fantastic for experimental use and reference, but it is not something sane to blindly trust the latest packages of in production.
It is one of the reasons why I made stagex, which in most cases is a near drop-in replacement.