Live data from Hacker News

You don't want long-lived keys

argemma.com

21–30 of 65 posts

Re: You don't want long-lived keys

#21

Okay but now how do you recommend I hook up my Sentry instance to create tickets in Jira, now that Jira has deprecated long-lived keys and I have to refresh my token every 6 weeks or whatever. It needs long-lived access . Whether that comes in the form of a OAuth refresh token or a key is not particularly interesting or important, IMO.

[deleted]

Re: You don't want long-lived keys

#22
Something I don't understand is the absolute phobia of service accounts. There are things that need to happen regardless of who is doing it. Emails need to get sent every day with reports, for example.

Forcing these workflows into the nonsense security theater of "we can't have service accounts" is stupid and unproductive. So every time we fire or lay off the person whose name is on the automation, we need to rotate the keys? What is the benefit here?

If you are screaming "managed identity" here, I have a bridge to sell you because clearly even Microsoft has not been able to figure out or implement managed identities for internal workloads... Well not as of 2022, at least.

Re: You don't want long-lived keys

#23
post #22

Something I don't understand is the absolute phobia of service accounts. There are things that need to happen regardless of who is doing it. Emails need to get sent every day with reports, for example. Forcing these workflows into the nonsense security theater of "we can't have service accounts" is stupid and unproductive. So every time we fire or lay off the person whose name is on the automation, we need to rotate…

Totally, but my service accounts own the api keys. But keys are still annoying to rotate. You know what’s not annoying to rotate? Short-lived tokens with very limited scope that get assigned more on demand

Re: You don't want long-lived keys

#24
post #17

Okay but now how do you recommend I hook up my Sentry instance to create tickets in Jira, now that Jira has deprecated long-lived keys and I have to refresh my token every 6 weeks or whatever. It needs long-lived access . Whether that comes in the form of a OAuth refresh token or a key is not particularly interesting or important, IMO.

You do what you can. Eliminating long-lived keys isn't always possible; you set up rotation instead.

Does having to refresh the key every 6 weeks instead of every year or whatever actually make a meaningful difference security-wise?

Re: You don't want long-lived keys

#26
post #22

Something I don't understand is the absolute phobia of service accounts. There are things that need to happen regardless of who is doing it. Emails need to get sent every day with reports, for example. Forcing these workflows into the nonsense security theater of "we can't have service accounts" is stupid and unproductive. So every time we fire or lay off the person whose name is on the automation, we need to rotate…

Service accounts are great! I just wish instead of having a password which gets shared around via 1password, there were a clear permission list ("this is a service account.. "real" users X, Y, X can login as it")

Seems like it's just Microsoft that cannot figure it out. AWS had roles forever, fully supported from web console or CLI. But when I request Azure service account, I am handed username and password.

Re: You don't want long-lived keys

#27
Where possible I prefer to implement signed policy objects. Then I can constrain access based on source IP and other request parameters. You can also easily implement an expiration date if you feel any particular application requires it, but some simple constraints may be useful enough that you might skip this in the majority of server to server applications.

This not only provides security but provides some resistance to bugs in your code which either call services incorrectly or call the incorrect methods of a service. I've avoided accidental data deletions and other painful events because my policy document did not allow this action. It turns these bugs into failures at the security perimeter.

I've used this concept in a few user applications as well. Typically those documents will always have expiration dates and I'll provide a "license" API which allows a single authenticated client request to retrieve an appropriate policy document. This is particularly nice when you want to implement a service across different providers or want to avoid downstream authentication overhead.

Re: You don't want long-lived keys

#28
post #17

Earlier quoted context omitted.

You do what you can. Eliminating long-lived keys isn't always possible; you set up rotation instead.

Does having to refresh the key every 6 weeks instead of every year or whatever actually make a meaningful difference security-wise?

Yes? That's a huge difference.

Re: You don't want long-lived keys

#30
post #17

Earlier quoted context omitted.

You do what you can. Eliminating long-lived keys isn't always possible; you set up rotation instead.

Does having to refresh the key every 6 weeks instead of every year or whatever actually make a meaningful difference security-wise?

At the minimum you’ll remember how to do it if you have to do it every six weeks.
Post reply on HN