4 ms·
If you want to issue a certificate in an environment where you only have a shell, it's the only language you can use. Sometimes you write in shell because it's
by delusional 4y ago
If you want to issue a certificate in an environment where you only have a shell, it's the only language you can use.
Sometimes you write in shell because it's the lowest common denominator.
- encryptluks2 4y ago
- delusional 4y agoNot everything I do is a job.
- throw0101a 4y ago> If you only have shell on your servers then it is time to start looking for a new job. Perhaps you wish to have "real" certs on appliances like F5s and Isilons (FreeBSD-based) where you can't install extra stuff, but where curl and openssl (and bash/zsh) are present. Or perhaps you want to run simple software that you can actually audit. While "over a thousand lines of bash" may take a little while to examine, good luck auditing Zope, which is what certbot pulls in as a dependency: * https://packages.debian.org/bullseye/python3-certbot https://packages.debian.org/bullseye/python3-certbot * https://packages.ubuntu.com/jammy/python3-certbot https://packages.ubuntu.com/jammy/python3-certbot
- encryptluks2 4y agoHere we are talking about a lightweight C executable though that doesn't have those dependencies. You are also not limited to provisioning certificates on appliances as well, and in those cases I don't think have a thousand line bash script offers anymore security (probably less) than a full-featured C program.
- throw0101a 4y agoExcept you have to be able to compile the C code into an executable, which may not be possible on an appliance.
- ClumsyPilot 4y agoappliance as in a router or a washing machine? who, ever, would not pre-compile and distribute binaries in a situation like that?
- throw0101a 4y agoAt my last job I ran an Isilon: I could upload a cert for the HTTP server via the web UI, but there was no ACME client. I could SSH in, drop dehydrated and have it work because all I needed was a shell, curl, and openssl. Similarly with F5: there is (was?) no native ACME client (at least a few years ago when I first looked at it). So I download dehydrated and used various CLI interfaces to schedule automated runs and importation of the certificates. There was no pre-compiled binary, and no compilers, on either system, and so talking about a "lightweight C executable" is non-sensical. Further, even if we (managed to) compiled things off-host, when we did an OS upgrade on either system, a whole bunch of libraries would change and we'd have to (remember to) re-compile. There is no such worry with a shell script. If you want to have ACME-fetched certs on a general computer system, then compiling a C program (large or small) is an option. But there are scenarios where compiled/compiling C programs is not an option, and you telling me otherwise when I have personal experience of these situations takes some chutzpah.
- encryptluks2 4y agoI wouldn't be offended. Many people including me have personal and work experience in this area as well. No one is saying you're wrong, but even you acknowledge there are other ways to upload certificates.. usually involving an API as well. If you want to run unchecked third-party 1000+ line bash scripts on production appliances, by all means go right ahead.
- 4y ago
- mr_toad 4y agoIf you’re provisioning an immutable VM or a container you don’t want to add unnecessary cruft. The official LetsEncrypt client and its > 100 dependencies is a non-starter.
- thayne 4y agoWell, if you have to use shell that's one thing, but I would be hesitant to use such a large shell script for something as important as certificate issuance in an environment where I didn't have to.
- linsomniac 4y agoJust as a counter point, I've been using acme.sh for ~3 years now and it's been rock solid. I get your point, and was pretty shocked to find acme.sh, but after the certbot PPA made a giant mess of my system I gave it a try. On the other hand, why should I balk at running thousands of lines of bash, but be fine with thousands (or many more) lines of C, Python, PERL...? You can write crappy or beautiful code in any language...
- Snelius 4y ago