hal_canary, to technology
@hal_canary@mastodon.sdf.org avatar

when I was a child, you could watch TV and never be interrupted by your TV crashing.

gergely, to ArtificialIntelligence

Git login and commit signing with security

Doing software engineering (well-ish) is pretty hard to imagine without working in version control, which most of the time means git. In a practical setup of git there’s the question of how do I get access to the code it stores — how do I “check things out”? — and optionally how can others verify that it was indeed me who did the changes — how do I “sign” my commits? Recently I’ve changed my mind about what’s a good combination for these two aspects, and what tools am I using to do them.

Access Options

In broad terms git repositories can be checked out either though the HTTP protocol, or through the SSH protocol. Both have pros and cons.

Having two-factor authentication (2FA) made the HTTP access more secure but also more setup (no more direct username/password usage, rather needing to create extra access keys used in place of passwords). Credentials were still in plain text (as far as I know) on the machine in some git config files.

The SSH setup was in some sense more practical one (creating keys on your own machine, and just passing in the public key portion), though there were still secrets in plain text on my machine (as I don’t think the majority of people used password-protected SSH keys, due to their user experience). This is what I’ve used for years: add a new SSH key for a new machine that I’m working on, check code out through ssh+git, and work away.

When I’ve recently came across the git-credential-manager tool that supposed to make HTTP access nicer (for various git servers and services), and get rid of plain text secrets. Of course this is not the first or only one of the tools that does git credentials, but being made by GitHub, it had some more clout. This made me re-evaulate what options do I have for SSH as well for similar security improvements.

Thus I’ve found that both 1Password and KeePassXC (the two main password managers I use) have ssh-agent integration, and thus can store SSH keys + give access to them as needed. No more plain text (or password protected) private keys on disk with these either!

Now it seems there are two good, new options to evaulate, and for the full picture I looked at how the code signing options work in this context as well.

Code Signing Options

When signing my commits to authenticate authorship, it’s possible to use PGP/GPG (the “classic way”), or now also SSH keys (as detailed, for example here or here).

The GPG setup is well established, and also links my commits to my identities used elsewhere (e.g. signed emails sent to mailing lists that care about it, with the key linked from this site’s frontpage). This of course is not always needed or desired, but it decouples the identity from the code hosting platform. There’s some serious downsides as well, though: GPG signing keys are not supposed to be numerous (just a single one), and thus if I use multiple machines to work on, I will have to take my private keys with me between machines, for example making copies of them. Or if not making copies, then have them on hardware keys (that have other problems with backups and all that, if I got it right the last time I tried to understand the process).

The SSH key commit signing is much newer (need git version at least 2.34), but it’s also simpler: add a key to my git hosting service, sign commits with that key, and thus the service can match things up and show that match. I can add as many keys as machines I’m working on if needed, no need to transfer or copy keys between machines, and I can also choose use some keys for login only or code signing only.

A third party trying to verify these signatures, though, would need to get the keys from the hosting service (I’d find it surprising if people would distribute their commit signing keys out of band the same way as they do with GPG public keys, since there are likely more of them). Hence it git hosting services will need to make the user’s keys available (as they do at the relevant username.keys URLs, e.g. mine on GitHub and GitLab).

Also can’t forget to add the relevant keys to the list of allowed signing keys locally, and all the other relevant setup (see e.g. the GitHub and GitLab docs). There are a bit too many places to update, but it’s mostly set-it-and-forget-it. After that, once started to sign commits, adding the --show-signatures flag to the commands that support it (git log, git show for example), should show the signatures.

My Winning Combo

Looking at the opions above, there’s a matrix of options that we can use, and here’s what I think about them:

GPG signature SSH key signature
Git Credential Helper Extra setup Simpler
SSH clone The usual Most convenience 👍

Convenience matrix of Git access (rows) and commit signing (columns) optionsReally, where I want to be is just SSH keys for everything, even if they are imperfect, but they have the most number of puzzle pieces to fit.

SSH Key Security

While previously SSH keys were really just held as files in your ~/.ssh folder, most likely, recently I’ve found (tada!) that the password managers I use can also store & serve SSH keys: see in particular 1Password’s SSH documentation and KeePassXC docs (scroll to SSH Agent Integration on that page), though I’m sure other password managers can do this too.

1Password

The two password managers listed above handle things quite similarly. 1Password is a bit less hands-on, though, the default settings work pretty well.

https://gergely.imreh.net/blog/wp-content/uploads/2024/04/Screenshot-2024-04-27-at-11.55.43.pngOne important bit is that 1Password runs its own SSH agent, so that has to be configured in the relevant places, but it’s easy enough. The approvals are also useful, so it’s more transparent when something accesses the key.

1Password pop-up for SSH key usage1Password pop-up for SSH key usage

With this things generally work, and relatively easy to reason about things. When things are less clear, it might be just a debug check-away away from seeing the keys added to this alternate agent:

$ export SSH_AUTH_SOCK=~/Library/Group Containers/2BUA8C4S2C.com.1password/t/agent.sock<br></br>$ ssh-add -l<br></br>256 SHA256:XfRsbxRMm+CN[...snip...]

KeePassXC

KeePassXC, being open source, is my preferred solution of the two, though unsurprisingly it’s the more awkward one to set up. The main differences from 1Password include:

  • needing to generate the keys externally to the password manager (rather than having built-in ssh keygen) – this is a con on usability but a strong pro on basing security on the established tool, rather than potentially questionably reimplement it
  • uses the main SSH agent, so no extra setup is necessary in most of the tools – this is a potential pro on usability for configurations, but a potential con that the worflow and config of loading keys into the agent needs a bit more understanding to be both ergonomic and safe to one’s level of paranoia
  • the key use confirmation defaults to “ok” on pressing Enter on the pop-up (rather than Cancel) – this is a pro on usability, but con on “failing open” rather than closed

SSH key usage confirmation with KeePassXCSSH key usage confirmation with KeePassXC

It’s still a pretty simple workflow, and it’s quite interesting to see how many things KeePassXC learned to do as well.

Experience

Thinking about the various threat models to my SSH crendentials, this setup adds one more layer to the defence in depth, and it does feel more relaxed already (relaxed from a point of stress I didn’t quite know I had before).

Picking the SSH key based login and signing feels like using the most appropriate tech for the moment, and there are still knobs for people to adapt it to their security levels (different SSH keys for login and signing, passwords on the keys themselves, etc…)

This setup works very well when I want to be notified whenever a tool’s using the SSH key so it would be more obvious if a stray process is trying, say exiltrate the keys. On the other hand this breaks down when git itself is running background processes, such as git-maintenance, so that’s not something that I could use here. So far out of (literally) thousands of codebases & repos I’ve used that maintenance setup exactly once, for convenience. For me it is not a major loss, then.

The one bit that feels a step backwards is that having the SSH keys in the password manager and carrying it around counteracts the “separate key for each system” arrangement. This might just be part of getting used to new processes, and not an actual downside.

Further Thoughts

In cybersecurity yesterday’s best practices might be inadecvate today and “last week’s” practices might be outright dangerous… Gonna keep revisiting this setup more broadly and in terms of details, as I learn more.

It’s a good question why even do code signing (besides having a “verified” check mark, which alone doesn’t mean much if not part of a verification process), though this needs some more space to unpack. For the time being I’ll assume that signing is better than not signing, if nothing else than as a forward looking prep for better audit processes down the line.

There’s really a question around having too many things in a single password manager: nowadays it can be the complete “royal flush” of password, TOTP, SSH key, recovery codes, passkey… and likely more bits that I might not be using yet? This does make me uneasy, and likely a scale on which usability and security will adjust over time (such as. bundling and unbundling various cybersecurity aspects).

I might also actually misunderstand various things above, if so, I’d be very keen to hear, just drop me a line!

Original post: https://gergely.imreh.net/blog/2024/05/git-login-and-commit-signing-with-security/

image/png
1Password pop-up for SSH key usage

CallMePlayer, to movies
@CallMePlayer@pixelfed.social avatar
stefan, to til
@stefan@stefanbohacek.online avatar

So this makes sense, and many of you will probably know this, but that the "print screen" button on our keyboards used to print the actual screen.

"In essence, whatever is currently on the screen when the key is pressed will be printed."

https://en.wikipedia.org/wiki/Print_Screen#Original_use

joel, to Futurology
@joel@fosstodon.org avatar

Some of my first memories with , kind of inspired by @kev and @robb's posts on the matter!

This is day 50 of and day 18 of

https://joelchrono.xyz/blog/early-computing-memories/

RonsCompVids, to apple
@RonsCompVids@bitbang.social avatar

- Did you know that used to build a 486 into their Macintosh ?
https://youtube.com/shorts/uDi-gby2Hx4

metin, to tech
@metin@graphics.social avatar

From the ar(t)chive…

Stylized 2D illustration for a 2009 business report, about the importance of establishing solid tech for a company, before looking ahead.

seniorsguidetocomputers, to ArtificialIntelligence
@seniorsguidetocomputers@twit.social avatar
hyde, to hacking
@hyde@lazybear.social avatar

Will I buy the magazine full back issue plus the lifetime subscription?

[23/100]

[ 12 / 31 ]

https://lazybear.io/posts/2600-magazine

CallMePlayer, to filmmaking
@CallMePlayer@pixelfed.social avatar
UP8, to IT
@UP8@mastodon.social avatar
mattotcha, to Futurology
@mattotcha@mastodon.social avatar
thejapantimes, to worldnews
@thejapantimes@mastodon.social avatar

Experts have long warned about the threat posed by artificial intelligence going rogue — but a new research paper suggests it's already happening. https://www.japantimes.co.jp/news/2024/05/11/world/science-health/ai-systems-rogue-threat/ #worldnews #sciencehealth #ai #computers #studies

thejapantimes, to Japan
@thejapantimes@mastodon.social avatar

A team of Japanese researchers using the supercomputer Fugaku have announced the development of a large language model for generative artificial intelligence. https://www.japantimes.co.jp/news/2024/05/11/japan/ai-fugaku-language-model-japanese/

mrundkvist, to ArtificialIntelligence
@mrundkvist@archaeo.social avatar

All artefacts degrade over time. What is the component of a 1980s home computer that gives out first? When did/does this happen?

kirkman, to retrocomputing
@kirkman@digipres.club avatar

"I think that in a few years owning a computer is going to be like owning a telephone. People will see it as a necessary appliance. A lot of people haven't trusted computers up to now, but that’s changing."

-- Joe Klein, independent trucker from Waterloo, Ill., in the St. Louis Post-Dispatch, March 8, 1982.

DJDarren, to random
@DJDarren@mendeddrum.org avatar

It’s just been pointed out to me that the reason Apple runs a trade-in programme for older devices is so they can reduce the size of the used market, and has fuck all to do with recycling.

That’s blown my tiny mind.

ajsadauskas,
@ajsadauskas@aus.social avatar

@DJDarren The Verge did a documentary on this a while ago. I guarantee you will be very angry by the end of it.

Basically, back in the 1980s, there was a company called Sun Remarketing that built a business buying unsold Apple computers, refurbishing then, and supporting them.

They even went so far as to create new operating systems and upgrades for them.

Lots of people couldn't afford the latest Mac, but we're happy to buy last year's model.

Using a range of underhanded legal tactics, Apple deliberately put them out of business, resulting in thousands of working computers being deliberately dumped in a landfill.

The reason was simple: It was more profitable for Apple to dump unsold computers in a landfill and force everyone to pay full price for the latest machines.

Planned obsolescence is very much Apple's business model.

https://youtu.be/rZjbNWgsDt8?si=63sB-mT58DERKA8y

LibrarianRA, to ArtificialIntelligence
@LibrarianRA@worldkey.io avatar

You can go for it all at National Security Agency ad, 1984
.
#NationalSecurityAgency #NSA #Computers #Advertisement #Retro #vintage #blackmastodon #blackfedi #blackfriday

stefan, to history
@stefan@stefanbohacek.online avatar

"On 30 April 1993 CERN issued a public statement stating that the three components of Web software (the basic line-mode client, the basic server and the library of common code) were put in the Public Domain [...]"

https://home.cern/science/computing/birth-web/licensing-web

https://cds.cern.ch/record/1164399/

Full text: https://genius.com/Cern-statement-concerning-cern-w-3-software-release-into-public-domain-annotated

appassionato, to books
@appassionato@mastodon.social avatar

Computers and Society: Modern Perspectives by Ronald M. Baecker, 2019

Computers and Society: Modern Perspectives is a wide-ranging and comprehensive textbook that critically assesses the global technical achievements in digital technologies and how are they are applied in media; education and learning; medicine and health; free speech, democracy, and government; and war and peace.

@bookstodon



HannahHowe, to ArtificialIntelligence

I just said to my beloved, “I need a spare plug socket. I’ll have to unplug Alexa.” Alexa replied, “I’m not sure about that.” 😱

be4foss, (edited ) to berlin
@be4foss@floss.social avatar

You don't need a new computer for up-to-date software ... just the right software!

Come to 2024 in to learn about the role of independent in the sustainable use of hardware.

🗓️ Sunday 28 April, 11-19h
📍 Straße des 17. Juni (Brandenburg Gate)

together with (@fsfe) and Bits & Bäume (@bitsundbaeume_berlin) will be there! Some in the and community may be joining as well :)

@kde

be4foss, (edited )
@be4foss@floss.social avatar

We will have old, otherwise unsupported #computers and #smartphones for visitors to try, as well as some new ones, all running #FreeSoftware.

The oldest, Dell Latitude D600, would have become #eWaste in 2010. If it were human, today it could legally drink alcohol in the USA ... it is that old and, with a little patience, still quite usable!

Come by to try it out :)

@fsfe @kde @bitsundbaeume_berlin

stefan, to zxspectrum
@stefan@stefanbohacek.online avatar

The ZX Spectrum was released 42 years ago.

"The importance of the ZX Spectrum and its role in the early history of personal computing and video gaming has left many to regard it as the most important and influential computer of the 1980s."

https://en.wikipedia.org/wiki/ZX_Spectrum


NatureMC, to voyager
@NatureMC@mastodon.online avatar

"A radio signal takes about 22 ½ hours to reach 1, which is over 15 billion miles (24 billion kilometers) from Earth, and another 22 ½ hours for a signal to come back to Earth."
In 1977, I saw the launch of both Voyagers on television. It felt like pure sci-fi at the time. It feels fascinating now. 🌌 🔭 ✨

And today, large companies are building planned into our . 😭

Linux, to linux
@Linux@linuxrocks.online avatar

ARM laptops are cheap / outstanding battery life - Linux is coming to them now in full 💻 :linux:

Acer Aspire One ARM laptop is soon rated close to 100% support via Linux 6.10.

Sure this device is not the latest - but there it is; a truly kicking ARM Snapdragon laptop for Linux!

Bonus: ARM's heritage is in smartphones - it means seamless operation between smartphone / laptop.

https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/commit/?h=for-next&id=363c8aea25728604537b170a1cc24e2f46844896

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • khanakhh
  • DreamBathrooms
  • everett
  • magazineikmin
  • osvaldo12
  • InstantRegret
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • thenastyranch
  • kavyap
  • tacticalgear
  • Leos
  • cisconetworking
  • Durango
  • GTA5RPClips
  • ethstaker
  • provamag3
  • ngwrru68w68
  • normalnudes
  • cubers
  • tester
  • modclub
  • megavids
  • anitta
  • lostlight
  • All magazines