News for hackers. Stuff that matters.
Re:How often should I rotate my SSH keys? by staticassertion on Friday February 26, 2021 @12:52AM (#26271735)
> But the problem with static ssh keys is that if they are stolen, it’s undetectable.

It's like, super detectable. You have endpoint logs for the file access, you have network logs, you have sshd logs (which contain the public key and the IP), etc.

> if you have your ssh private key on several machines, you have to remember to copy it to all those places

Your ssh key should never leave a host. That should be a policy and you should write rules to detect when that policy is being violated (check for processes accessing the file).

If you need access from N computers you should be generating N keys.

The reason rotation isn't recommended is because it leads to bad practices (people just add a '1' to their password), it's a hassle, and it can never be fast enough to meaningfully impact an attacker - once they have SSH keys it's likely they can gain persistence and C2 before your rotation takes place. Not because people reuse their passwords in multiple places.

Setting up a CA for SSH is definitely a really good practice but I think that most companies would find it far simpler to just enforce 2FA for SSH access. Still, I'd really like to see an article about how you set that up, especially if it targets smaller enterprise customers.

For others who might be interested, here's bless from Netflix:

https://github.com/Netflix/bless

edit: Oh, and just to be clear, 2FA for your SSH is not a silver bullet - even a yubikey. But it's a cheap, scalable, near-zero overhead way to protect against an attacker who's got access to your key (but not one who has access to your system, assuming an active session!).

Re:How often should I rotate my SSH keys? by chmod775 on Friday February 26, 2021 @01:54AM (#26272023)
No. You can't assume your logs are trustworthy if you are compromised. You have to assume an attacker will remove any traces of themselves from those logs or will stop them from being written in the first place.

It's pretty standard practice to do this post-exploitation.

Further this requires you to regularly check your log files for suspicious activity, which is way more work than just rotating your ssh keys - which can be easily automated. Running a script that will automatically rotate your ssh keys on all servers in your .ssh/known_hosts is trivial.

Also, rotating your ssh keys is something that has a chance to prevent intrusion, whereas if you see something in your logs it's already too late.

Re:How often should I rotate my SSH keys? by viraptor on Friday February 26, 2021 @02:02AM (#26272052)
> You can't assume your logs are trustworthy if you are compromised.

It's not that simple. In a larger/mature environment you'll have log aggregation where the initial login is close to certain to be forwarded before it can be messed with. (Unless someone can log in, escalate, kill the right daemon, and somehow prevent monitoring from noticing a missing endpoint - all before the log gets forwarded)

And that's just host logs, without the networking, potential forwarding, etc.

Re:How often should I rotate my SSH keys? by staticassertion on Friday February 26, 2021 @01:58AM (#26272039)
You can assume a lot of logs are not compromised. For example, logs from your network infrastructure. In this case you could trust sshd logs (so long as you ship them off quickly) and network logs.

As for endpoint logs, yes, a privileged attacker could disrupt them. But honestly, even with regards to your endpoint, attackers often don't disable logging - though I do see it, for sure. For "blessed" logging like Windows Event Log you'll have an even harder time - they do take measures to protect the files on disk, even against privileged attackers, and supported methods of deleting the event log actually themselves generate a "Someone deleted the event log" event, which I would highly recommend you watch out for :)

The simplest advice for dealing with this is to ship logs off of the device ASAP and to make sure that disrupting the service requires privileges.

Re:How often should I rotate my SSH keys? by chmod775 on Friday February 26, 2021 @10:33AM (#26275752)
> For "blessed" logging like Windows Event Log you'll have an even harder time [...] even against privileged attackers

Trying to prevent a determined privileged attacker from doing something is an exercise in futility, since it's impossible in every sense of the word. If they have total control over a system, they can do whatever they want, even if you put up a bunch of stopgaps.

Most post-exploitation frameworks (prominent example: DanderSpritz) have modules to remove stuff from the windows event logs without leaving traces.

It's pretty basic stuff.

Re:How often should I rotate my SSH keys? by staticassertion on Friday February 26, 2021 @11:38AM (#26276638)
> Trying to prevent a determined privileged attacker from doing something is an exercise in futility,

That's not really true at all.

> since it's impossible in every sense of the word

Ok? Lots of things are impossible, and lots of those things are also still very very hard and costly. Hash collisions aren't impossible, and yet here we are, with a world hinging on them being very hard.

> , they can do whatever they want

Not really.

> Most post-exploitation frameworks (prominent example: DanderSpritz) have modules to remove stuff from the windows event logs without leaving traces.

You realize that:

a) DanderSpritz's logic to bypass the event log was a huge deal

b) It's literally an NSA leaked exploit????? Like are you kidding me using an NSA developed exploit as "pretty basic stuff" lol

Sorry but I think I'm gonna stop responding here.

Re:How often should I rotate my SSH keys? by foolmeonce on Friday February 26, 2021 @02:22PM (#26278702)
> b) It's literally an NSA leaked exploit????? Like are you kidding me using an NSA developed exploit as "pretty basic stuff" lol

It must have been very expensive and innovative, does that make it hard to copy into your scriptz folder?

Re:How often should I rotate my SSH keys? by staticassertion on Friday February 26, 2021 @02:49PM (#26279051)
I don't understand the point you're trying to make. That because one exploit exists, and using that exploit is cheap, the entire class of attacks is cheap?

Sorry, but this entire thread is nonsense, and it's just a clear demonstration of a lack of threat modeling and frankly a lack of understanding of what attacker capabilities are.

Re:How often should I rotate my SSH keys? by foolmeonce on Friday February 26, 2021 @03:05PM (#26279250)
The basic principle of real security models is once an attacker has full access all data on the system is potentially tampered with.

You can try to play games with ensuring logs leave the system, but everyone takes shortcuts to make sure they can recover the system when networking is down etc.

Everyone and their grandma has access to complex scripts, etc that were once very expensive. Whether they invest the energy in learning methods to hide their presence or just go straight to some other goal is going to depend on how they intend to abuse your systems.

I think most "security professionals" pretend they are going to catch an oddity that occurs that doesn't match what their automated tools would catch and occurs in the middle of some other crisis or holiday break. I would say good luck with that.

Re:How often should I rotate my SSH keys? by staticassertion on Friday February 26, 2021 @05:09PM (#26280447)
> The basic principle of real security models is once an attacker has full access all data on the system is potentially tampered with.

That's not true at all. Like, not at all.

Re:How often should I rotate my SSH keys? by natmaka on Friday February 26, 2021 @11:16AM (#26276340)
A log immediately stored on a "physically" write-once device, or printed, may be more difficult to dispose of (w/o physical access to the premises).
Re:How often should I rotate my SSH keys? by kortilla on Friday February 26, 2021 @02:20AM (#26272149)
> You have to assume an attacker will remove any traces of themselves from those logs or will stop them from being written in the first place.

You’re assuming the attacker has write access to the log storage of the system they ssh into. This is not the norm for production systems. If your auth processes aren’t shipping off logs immediately, your system is broken regardless of ssh.

Re:How often should I rotate my SSH keys? by chmod775 on Friday February 26, 2021 @02:30AM (#26272202)
Ship them off to where? A system that also can be accessed with your ssh key?

If not, can an attacker gain access to your email server or DNS with your ssh key? If either is true, they now have access to everything not protected by 2FA that uses an email address they now control.

There's so many things to get right.

You can design a system such that there's a very high likelyhood even a nation-state attacker won't be able to intrude without leaving traces - if you make no mistakes.

Or you know, you could also just rotate your ssh keys in addition to everything else. "I have logs" is really no excuse to forego something that is this easy.

Re:How often should I rotate my SSH keys? by pyrale on Friday February 26, 2021 @03:10AM (#26272417)
> Ship them off to where? A system that also can be accessed with your ssh key?

If the ssh key you lost has access to all the critical infrastructure, then, certainly you have a problem. The solution is to not give away write-access keys to your entire system.

> If either is true, they now have access to everything not protected by 2FA that uses an email address they now control.

The initial question was not whether losing a key would cause a breach, but whether a detection mechanism is reliable.

> Or you know, you could also just rotate your ssh keys in addition to everything else.

The question is how does it help? If you can't detect a breach, it will live for as long as your key rotation policy, if not longer. If you can detect and mitigate a breach, it will be closed quickly regardless of your rotation policy.

Re:How often should I rotate my SSH keys? by tonoto on Friday February 26, 2021 @05:09AM (#26273195)
I've not seen an enterprise environment where "ordinary" sysadmins also have access to the log hosts. Must be extremely rare setup in a healthy environment. Likewise selldom to see "logging staff" to actually login to a shell. Logs naturally aggregates to some kind of a service with visualizations, alerting and filtering capabilities.

In those special cases an "extraordinary" sysadmin gets onboard a log host, it is not through the ordinary access ways, such as SSH from where the other sysadmins play around.

Re:How often should I rotate my SSH keys? by kortilla on Friday February 26, 2021 @01:04PM (#26277769)
Holy shit you should not have access to your logging systems/DNS servers with the same exact credentials as your main app servers. Do you let devs onto the HR system with the same ssh key as well?
Re:How often should I rotate my SSH keys? by nitrogen on Friday February 26, 2021 @03:47AM (#26272666)
Ship them off to where?

The usual networked logging systems that don't have ssh logins, e.g. syslog into ELK stack.

Re:How often should I rotate my SSH keys? by vel0city on Friday February 26, 2021 @10:32AM (#26275734)

  curl -X "DELETE" http://log-server:9200/logstash-*
Probably works for a large percentage of deployed ELK logging stacks.
Re:How often should I rotate my SSH keys? by ddoeth on Friday February 26, 2021 @01:35PM (#26278111)
Are people not using elastic authentication?
Re:How often should I rotate my SSH keys? by vel0city on Saturday February 27, 2021 @09:50PM (#26290213)
Elasticsearch existed for years without any authentication on its community tier version, with xpack behind a call with a sales rep and a heavy pocketbook. These days, authentication is provided after you enable the free xpack plugin, but it is not enabled by default and their install guide doesn't exactly point it out to you right away. It starts delving into JVM tuning options before it even references there's this xpack thing you may want to look into.
Re:How often should I rotate my SSH keys? by CrazyPyroLinux on Sunday February 28, 2021 @04:27PM (#26297229)
I always just put it behind an authenticating proxy.
Re:How often should I rotate my SSH keys? by neolog on Friday February 26, 2021 @04:52AM (#26273087)
How do you set up elastic on a server that doesn't run sshd?
Re:How often should I rotate my SSH keys? by viraptor on Friday February 26, 2021 @06:19AM (#26273629)
Console. Cloud login. Different VPN connection. Different credential set then other hosts. Using a hosted service from a completely separate provider. Setting up infrastructure from images without external access.

And I'm sure I missed some - there's a thousand ways to do it.

Re:How often should I rotate my SSH keys? by tonoto on Friday February 26, 2021 @05:11AM (#26273208)
For real? console (in various ways/flavours) is one way.
Re:How often should I rotate my SSH keys? by Uptrenda on Friday February 26, 2021 @06:11AM (#26273582)
Posts like this just make me realize how impossible it is to follow every security best practice and stay one step ahead of the latest techniques. You can maybe try tick the most common boxes, but expecting users to be able to police their machines, networks, and other attack surfaces (and still find time to get work done) is unrealistic, IMO. I'm starting to think the common factor here between secure systems and insecure ones is lucking out on having no interested / skilled attackers...
Re:How often should I rotate my SSH keys? by mscarborough on Friday February 26, 2021 @09:19AM (#26274966)
It's definitely a balancing act, calculating the ROI for improving security vs implementing more immediate customer-focused work.

This common problem is what led to rise of the MSSPs https://en.wikipedia.org/wiki/Managed_security_service

Re:How often should I rotate my SSH keys? by thegeekbin on Friday February 26, 2021 @06:59AM (#26273907)
> Your ssh key should never leave a host.

If you need an ssh key for whatever reason from a host (for example, git pulls on a staging machine), you should generate one on that box and narrow it's scope in the machine that will receive it (eg, Gitlab Deployment Keys -- locked in read-only mode, single purpose).

> The reason rotation isn't recommended is because it leads to bad practices (people just add a '1' to their password)

To some degree. I personally rotate my keys whenever I change my personal/work device (perm. change), or, around every year or so. It's not a hard requirement, but just a personal preference.

> it's a hassle

ssh-keygen -b 4096 isn't a hassle... and if you do deployment properly it shouldn't be an issue to sync these keys (eg, an AD system holding public key, cloud directories like JumpCloud, etc can all sync the moment it's updated -- even Salt/Ansible/Chef/etc can do it easily, with modules pre-written to sync keys already).

In any event, MFA is always a good idea. But, my biggest concern is that someone would leave ssh open to the public... the time it takes to setup an ACL or VPN to connect to the machine is hardly anything these days with the amount of automated tooling to do it... so why aren't people?

Re:How often should I rotate my SSH keys? by staticassertion on Friday February 26, 2021 @07:40AM (#26274167)
> ssh-keygen -b 4096 isn't a hassle...

I was referring to password rotation specifically with those points, not SSH key rotation, because the quote in my post was also in the context of password rotation.

Re:How often should I rotate my SSH keys? by dspillett on Friday February 26, 2021 @05:49AM (#26273464)
> Your ssh key should never leave a host.

A lot of people think of the SSH keys like PGP keys (where the one private key is your identity) which is not how they are intended to be used (by my understanding which seems to agree with yours). authorised_keys can contain many so you should never need to duplicate a key because you need to access a given account from multiple hosts.

> That should be a policy and you should write rules to detect when that policy is being violated (check for processes accessing the file).

For static locations, one option I like for this is whitelisting the source address for each key (https://unix.stackexchange.com/questions/353044/). You can then monitor abuse of the policy by looking for keys with no source limit, though this isn't something I've ever done, and it means that a stolen private key is more difficult to use from another location.

Of course this doesn't work for connecting directly from client hosts that move around (i.e. a user connecting from a laptop that could potentially connect from any address unless you enforce VPN access for sensitive resources).

Re:How often should I rotate my SSH keys? by sneak on Friday February 26, 2021 @01:53AM (#26272014)
Forget 2FA - yubikeys can be actual full key generation/storage for a GPG key in smartcard mode, and then via gpg-agent those can be used for ssh. (gpg-agent replaces ssh-agent.)

My ssh keys never leave the yubikey.

I have a different dedicated yubikey in each computer, with its own unique key, and a stolen key is useless without its unlock PIN.

Re:How often should I rotate my SSH keys? by justincormack on Friday February 26, 2021 @03:30AM (#26272561)
Also the Apple enclave can store ssh keys eg using sekey, which needs your fingerprint to use.
Re:How often should I rotate my SSH keys? by ozim on Friday February 26, 2021 @02:01PM (#26278442)
Dedicated yubikey in each computer seems like your threat model is quite complex.

Do you leave computers in weird places? Are you getting robbed once a year? Are you a high stakes poker player or CEO of a shady company?

Re:How often should I rotate my SSH keys? by sneak on Friday February 26, 2021 @06:29PM (#26281081)
No I just don't like having to stop what I'm doing, get up, go into another room or my backpack, and fetch a yubikey, interrupting my focus for 30-90 seconds. I have enough trouble getting and staying focused without additional interruptions.

I have like 4 laptops and two main desktops and if I didn't have 4 yubikeys in them then this would be a multiple-times-daily occurrence. Yubikeys aren't that expensive, and I mostly use the usb-c "nano" ones which are designed to live 24/7 in a computer's port, only sticking out about 2-3mm. Sometimes I have to move them around to other temporary machines but for the most part having approximately the same number of keys and computer workstations means that this is pretty infrequent.

I even have two Davinci Resolve Studio activation dongles for this same reason, and I can't physically edit video on two different computers at once, one would do if I were willing to keep track of where it is and shuffle it around between my various machines as needed.

It's pure speed/convenience, not a response to some data threat.

Re:How often should I rotate my SSH keys? by devwastaken on Friday February 26, 2021 @02:17AM (#26272137)
My concern with physical keys is what happens if it stops working?
Re:How often should I rotate my SSH keys? by darkr on Friday February 26, 2021 @04:54AM (#26273097)
Then that key can no longer be used. The solution to this resulting in being permanently locked out is to have more than n+1 redundancy in hardware, and ideally meatware too.
Re:How often should I rotate my SSH keys? by danielheath on Friday February 26, 2021 @02:20AM (#26272160)
You need two; one stowed safely and only retrieved to enroll a new service, and one to use day-to-day.
Re:How often should I rotate my SSH keys? by sneak on Friday February 26, 2021 @02:22AM (#26272169)
enroll a new service? we are talking about gpg smartcard usage, for ssh - not u2f 2fa.

you don't need the physical key to "enroll", you just keep a copy of its pubkey.

Re:How often should I rotate my SSH keys? by tmottabr on Friday February 26, 2021 @10:07AM (#26275453)
the idea is to generate the key in the device, so it never leave the device, therefore you cannot store it somewhere else like another device.

So, the ideia is for you to have two devices, each with its own key, the first device you use daily and the second you use store in a safe location.

if your first device in daily use stop working or is lost you use the second device you have stored to login to your systems to remove the keys from the lost device and add the keys for a new device that replace it and then store the second device back in a safe location.

Re:How often should I rotate my SSH keys? by sneak on Friday February 26, 2021 @02:20AM (#26272152)
I have one key permanently in a usb port of each computer, and one on my keychain as a backup (which is also used for U2F and has lightning so works with my phone for 2FA), so five in total, each with their own RSA key for ssh.
Re:How often should I rotate my SSH keys? by Ciantic on Friday February 26, 2021 @08:03AM (#26274339)
If you use GPG and YubiKey approach, you can create the keys in offline computer, store them to YubiKey, and make paper copy of the private key. Also you probably shouldn't have only single way to access the remote computer, I still intend to store password for root that I never use.

I wrote about my endeavour with this approach just few days ago [1].

[1]: https://github.com/Ciantic/thoughts/blob/master/2021/yubikey...

Re:How often should I rotate my SSH keys? by sneak on Friday February 26, 2021 @09:03AM (#26274818)
You should totally disable password authentication for SSH.
Re:How often should I rotate my SSH keys? by Ciantic on Friday February 26, 2021 @09:56AM (#26275354)
You are right, but you can still use password for recovery purposes even if it's not used for SSH authentication.

Most VPS provides "web console" access. It connects like terminal, like Digital Ocean's web-console that doesn't require SSH access [1].

[1]: https://www.digitalocean.com/docs/droplets/resources/console...

Re:How often should I rotate my SSH keys? by devoutsalsa on Friday February 26, 2021 @04:54AM (#26273101)
I'm more worried about simply losing it. I travel a lot.
Re:How often should I rotate my SSH keys? by GekkePrutser on Friday February 26, 2021 @05:21AM (#26273286)
Just use multiple. That's what I do.

As backup you can also use OpenPGP cards which cost much less than a yubikey. Or a cheaper Fido2 token if you use Fido2 for SSH access (I don't yet but it's coming into vogue). An OpenPGP card will cost about a tenner, you'll need a card reader to use it but for backup purposes it's perfect.

Re:How often should I rotate my SSH keys? by GoblinSlayer on Friday February 26, 2021 @05:58AM (#26273516)
Have a higher security fallback.
Re:How often should I rotate my SSH keys? by graindcafe on Friday February 26, 2021 @02:21AM (#26272165)
Yubikey with a PIN is 2FA, isn't it?
Re:How often should I rotate my SSH keys? by sneak on Friday February 26, 2021 @04:05AM (#26272770)
Technically yes but when people say "yubikey 2fa" they 99.99% of the time mean U2F, which is Not This.
Re:How often should I rotate my SSH keys? by toastal on Friday February 26, 2021 @04:27AM (#26272921)
From Wikipedia: Universal 2nd Factor (U2F) is an open standard that strengthens and simplifies two-factor authentication (2FA) using specialized Universal Serial Bus (USB) or near-field communication (NFC) devices based on similar security technology found in smart cards.

Using Yubikey to mean U2F is like people saying "Google this term", "the image is Photoshopped", "Hoover the floor", "grab me a Kleenex", or even "take the escalator". It possible "Yubikey" could become a generic trademark, but if possible people should be wary of using brand names in this way before it 'sticks'.

Re:How often should I rotate my SSH keys? by sneak on Friday February 26, 2021 @08:43AM (#26274659)
Neither Photoshop, Kleenex, nor Google have lost trademark protection.

Additionally, the term Yubikey isn't likely to become synonymous with 2FA in any case. Most people don't know that yubikeys work in several different, independent modes, such as FIDO/U2F 2FA, or CCID smartcard, or Yubico OTP (those long annoying strings your yubikey types when it brushes your thigh or hand).

The CCID smartcard mode requires a pin, which is technically two factor authentication (knowledge of PIN and possession of yubikey), which is an entirely different thing than FIDO/U2F 2FA (which is what most people mean when they talk about using a yubikey for 2FA, not that "yubikey" and "2FA" are interchangeable terms).

This is further complicated by the fact that CCID smartcard mode can be used for ssh (via gpg-agent, with ssh keys inside the yubikey itself), AND, separately, OpenSSH (with other keys) can use a yubikey for U2F.

Re:How often should I rotate my SSH keys? by mschuster91 on Friday February 26, 2021 @05:01AM (#26273148)
> You have endpoint logs for the file access

No endpoint security system I'm aware of being used outside of core banking/telco/government system logs all file accesses. It would crash instantly for one single build of your average NodeJS application.

Re:How often should I rotate my SSH keys? by goguy on Friday February 26, 2021 @05:21AM (#26273282)
I've worked at places that use the below or a flavour of to monitor specific files for modification etc.

https://www.newnettechnologies.com/nnt-file-integrity-monito...

Re:How often should I rotate my SSH keys? by staticassertion on Friday February 26, 2021 @07:45AM (#26274194)
File monitoring is particularly slow, though not for any fundamental reason. But you can still monitor lots of files efficiently by just limiting which files you look for, which lots of companies do.
Re:How often should I rotate my SSH keys? by amenghra on Friday February 26, 2021 @12:56AM (#26271749)
> Still, I'd really like to see an article about how you set that up, especially if it targets smaller enterprise customers.

https://github.com/square/sharkey

Re:How often should I rotate my SSH keys? by staticassertion on Friday February 26, 2021 @01:00AM (#26271770)
Oh I mean I know how to do it, I just mean I'd like to see companies talking about how they do it, and I'd really really like to see someone make it drop-dead simple.

It's valuable to hear how companies are protecting their infrastructure if they're going to break down how they accomplished it, how they continue to maintain it, etc.

Re:How often should I rotate my SSH keys? by bassdrop on Friday February 26, 2021 @02:37AM (#26272232)
We use symops[0] to connect to our servers. Not sure about the implementation details, but the gist is that we connect through our aws credentials (via SSM), which we retrieve using Okta, which is then protected using 2fa. No ssh key to be found, and you can disable all ssh ingress rules. Since this is via SSM, you can also use the full power of AWS IAM to allow/deny access.

Also, Sym can be set up to require approvals too which is great for security auditing since it's a third party.

[0] https://symops.com/

Re:How often should I rotate my SSH keys? by staticassertion on Friday February 26, 2021 @02:57AM (#26272341)
Ah nice. Yeah, SSM is awesome, we use it as well.
Re:How often should I rotate my SSH keys? by shandor on Friday February 26, 2021 @01:30AM (#26271904)
OpenSSH 8.4 added support for FIDO2. It's literally the same commands (with some different parameters) to take into use as a normal keypair. And FIDO2 tokens are becoming quite affordable. To me 2FA with SSH became a solved problem with that.
Re:How often should I rotate my SSH keys? by ldng on Friday February 26, 2021 @04:02AM (#26272757)
Could you point to a relevant article explaining that setup please?
Re:How often should I rotate my SSH keys? by shandor on Friday February 26, 2021 @04:45AM (#26273051)
This one had quite a lot of background, but also the needed commands: https://www.stavros.io/posts/u2f-fido2-with-ssh/

With a properly set-up token, basically you only need 2 commands:

   ssh-keygen -t ed25519-sk -O resident -f ~/.ssh/id_mykey_sk
   ssh-add -K
I used a Yubikey and needed also to install 'ykman' to set a PIN for my token, otherwise ssh-add kept failing. Dunno if I omitted something for a proper setup for my token initially, but I don't think that was a problem with OpenSSH in particular.

Apart from the small headache with the PIN, the whole thing was almost magical in its simplicity.

Re:How often should I rotate my SSH keys? by loulouxiv on Friday February 26, 2021 @03:00PM (#26279179)
The token must be pin protected to be eligible to resident credentials. I think it is one of the significant differences between FIDO1 and FIDO2. I also think that you can use ed25519-sk with a non pin-protected, but then you won't be able to authenticate if you can't access to the generated key file (if it was deleted or on another machine)
Re:How often should I rotate my SSH keys? by shandor on Friday February 26, 2021 @05:28PM (#26280611)
Thanks for the info. Makes complete sense to require a PIN with resident keys, I'm glad. Now I'll need to write the article myself, with this information included :)
Re:How often should I rotate my SSH keys? by lifeisstillgood on Friday February 26, 2021 @03:02AM (#26272381)
If I don't know how to do it, where do I start to understand ?

Edit: I suppose I am asking how does it "all" fit together. The CA that grants servers or services a short lived key - the other servers that then can trust that. It makes kind of sense but I think I am missing some parts as when I try and read how others do it, some parts seem to be missing.

Too many blog posts seem to be something something kubernetes will arrange it. Or Oauth or ...

For example, this article seems to blow against the idea of a central key management service like Vault and have the device decide to rotate keys. But I am not 100% sure because it's one sentence. And how do they provide authentication for a service account (say a web worker that processes some incoming requests). That's not device+person. The same idea can happily apply but do they?

I think I am just moaning.

Re:How often should I rotate my SSH keys? by dotancohen on Friday February 26, 2021 @12:05PM (#26277008)

  > check for processes accessing the file
How? I could check at any point in time if the file is being accessed now, but how could I ensure that it hasn't been accessed in the past? The ext4 access time can be forged by the same process that accesses the file. Should I have a daemon running to check this? If so, then why isn't this already a feature in common Linux distros?
Re:How often should I rotate my SSH keys? by jlgaddis on Friday February 26, 2021 @01:23PM (#26277986)
> If so, then why isn't this already a feature in common Linux distros?

It is. It's called auditd, is quite possibly already installed (albeit probably not configured to do much), and can easily ship its logs off to another host (natively or via syslogd).

Re:How often should I rotate my SSH keys? by dotancohen on Friday February 26, 2021 @01:55PM (#26278354)
Thank you. I'm checking out auditd now.