Difference between revisions of "Security notes / Identification, authentication, authorization"
m (→Password-and-account 2FA)
|Line 1:||Line 1:|
Revision as of 15:23, 29 September 2021
| Security related stuff.
- 1 Separate parts
- 2 Auth systems - practical considerations
- 3 Notes on implementations (and parts of them)
- 4 Online delegated auth
Auth systems - practical considerations
Tokens and tickets
|This article/section is a stub — probably a pile of half-sorted notes, is not well-checked so may have incorrect bits. (Feel free to ignore, fix, or tell me)|
Salt is data added to passwords before they are hashed. In pseudocode:
# instead of hashval = sha1hash(password) # You use hashval = sha1hash(salt+password)
Does not avoid offline brute forcing, but defeats a few optimizations to exhaustive offline brute forcing.
Mostly in response to
- lookup up hashes for common passwords
- rainbow tables
While in the best cases you make brute forcing much harder, the more typical case doesn't do this at all - you should assume salt does nothing more than defeating the optimizations.
Salt should not be trivial, should probably be unique for everyone, and ideally should be hard to find.
A short and simple salt, say, 'bob', may mean simple passwords like 'cat' and '123456' are now 'bobcat' and 'bob123456' and will be found soon by brute force, even known-hash matches.
Also, finding even just those two suggests it's worth a try to run brute force with 'bob' prepended to everything, defeating the salt.
Making the salt random and long means you won't discover the salt accidentally.
Giving each user/password entry its own salt means finding out the salt for a single entry has no value.
A long random salt per entry also increases the search space, which can make brute-forcing intractible.
However, the above is only true if an attacker doesn't know the salt.
And you have to store it somewhere, and both hash and salt has to be equally accessible to the auth system. To, you know, work at all.
So while putting it in an obscure place will sometimes thwart attackers (over storing it in the same row in a table), but generally hackers with some time and knowledge will find both with similar ease. This is why you should assume salt only defeats the optimizations.
If an attacker...
- knows the hashes, does not not that they are salted
- reverse lookup and brute force probably yields nothing
- relatively unlikely case
- knows the hashes, that they are salted, but not the salt value (common passwords finding nothing suggest salt)
- renders rainbow table impractical
- basic brute forcing possible, but much more work (net effect is longer passwords)
- relatively unlikely case
- knows the hashes, that they are salted with a single salt value, and the salt value (often discovered quickly enough)
- rainbow tables possible, but won't help speed much (on a single attack, anyway)
- forces basic brute force (without much extra work since the salt is known)
- knows the hashes, that they are salted each with a different salt, and the salt values
- rainbow table not worth it
- forces basic brute force (without much extra work, since the salt is known)
Delegated authentication / delegated access
Federated identity, Single Sign On
Notes on implementations (and parts of them)
LDAP is often used for authentication (via its binding mechanism, or sometimes via a proxy user that has wide access).
A framework that can be used for authentication, authorization and accounting.
- PAM (Pluggable Authentication Modules), commonly used in OSes such as Linux, Mac OSX, a number of BSD variants (the others usually use BSD Auth), Solaris, AIX, HP-UX and more.
- There is also a distinction between Linux PAM (used in linux) and OpenPAM, used in FreeBSD, NetBSD and Mac OS X Snow Leopard, and some linux distributions.
- BSD Auth (used by some BSD variants)
- NSS (Name Service Switch)
Microsoft windows components
- NTLM ('NT Lan Manager'), mostly for SMB (see samba)
- MS-CHAP, mostly for remote access
- GINA (Graphical Identification and Authentication), which is the graphical login window. GINA is replacable; a common alternative is Novell's replacement GINA, and also of interest is pGina, a project that lets you authenticate against many different things.
A two-factor system using a physical token that periodically generates a new code, based on a seed. Relies on synchronizing the token with the login server's clock.
Online delegated auth
- OpenID, usable for any system that wishes to support them (see also OpenID notes)
- Windows Live ID (Hotmail, Messenger, Xbox LIVE, others), previously known under various names including the word passport
- Note that Google exposes their accounts via OAuth / OpenID (verify)
See this video, it's pretty clear on the basics.
What it is
OpenID lets you have an identity and relevant authentication for it stored/executed remotely to the sites that use it.
Which lets you use one identity, backed by a single OpenID provider, in many sites that want to use OpenIDs (which act as OpenID clients to the provider for each OpenID identity).
It lets you use a single identity for sign-on to many unrelated websites. It mostly solves cross-site identity verification - to the degree that clients can trust the OpenID provider, because the system is comparable to an orgnisation vouching for people you personally don't know.
Technically, OpenID servers are identity brokers and verifiers.
OpenID is decentralized in general, though each identity is centralized in that it implies a particular OpenID provider (exactly that?(verify)). The OpenID itself is URL-based, which is how an openID implies a provider, which is how an OpenID client knows what server to contact for verification.
As far as the side wishing for verification is concerned, the exchange is roughly:
- site using OpenID: "Hey, this guy particularopenid is trying to log in. Do you agree that's them?"
- OpenID server: "Hmm, particularopenid? Let's see, I'll check. Yup, I say that's them." (or, of course, the negative answer)
Note that the check and login happen on the openID provider - the OpenID client never sees the login information, or means of login.
The check proves that the identity described by the URL that is is indeed verified. (There is a bunch of security detail about going from site to site that side of things can for the most part be fairly simply trusted.)
Just how much that server's verification actually means to the client side, however, depends on the trust you place in the openID provider.
What it isn't
It does not really deal with trust - the only thing you really get is the information on whether a specific exchange succeeded.
Implicit (and pre-configured) trust in a system is always a bad idea (human trust is often one of the weakest links in a security system). To get back to the vouching-for-someone analogy: you would likely accept a good friend vouching for someone else, but probably not someone who's opinion you've come to disagree with, or a stranger. If some company vouches, you would still make some quick risk assessments and consider how their policies have worked out in the past.
A login in a decentralized login (OpenID or otherwise) is limited by:
- The verifier's trustability.
- Consider an openID server spam.com that answers 'yes' to each and every request that comes in.
- Certain implementation details
- OpenID allows setup of aliases, such as using a short domain name as an OpenID (by making it point to one). This means that this identity can change, e.g. when I lose the domain and someone else registers it.
- OpenID allows clients to check whether it is verifying the same actual ID as before, but they have to actually do so to be secure against this.
Still, OpenID does make a number of things harder to fake. For example, if you got a comment or account request from spock.oid.example.com, and I can (informally) check that the person I'm thinking of indeed owns that openID, and that oid.example.com is trustworthy, that means they signed it.
Basic usage details
Signing up for an identity means a provider hands you a single URL that represents your identity.
This identity itself implies the site at which it the identity can be verified, which means login at a site you've never been before at involves:
- typing your identity, such as example.myopenid.com
- You get forwarded to the site that can verify this identity -- in this case myopenid.com
- you log into your openid provider,
- it tells you the new site wants access,
- you allow it,
- you get sent back to the new site
To the casual observer, it's a username/password deal, just at a central site.
OpenID has two main uses that I've noticed. The first is being the login step for an account elsewhere. This may well imply choosing a screen name there that is unrelated. This use is purely private, for my own ease of login.
The other is leaving a comment that is provably mine, say, on a blog (such as on livejournal -- except I have an account there anyway)
Identity delegate on a page
There are several openID providers, but you may not like some company's name in your ID. While you could technically run your own openID service, that's not very practical.
Something that is a lot easier is using a specific website -- usually a domain you own, to keep it short, or perhaps the URL to your main blog -- that you have control over.
Consider that losing control over that domain or website means that a different identity may eventually sit at the same openID url. If you stop owning that site, it is not guaranteed another identity won't be put there.
In fact, this is a feature too: since you delegate to a real openID service, you can change the delegate to another OpenID when for some reason you want to swith accounts, say, your openID service disappears.
Some services imply an openID. For example, Livejournal users have an openID, period. AOL is implementing openIDs, and microsoft said it would too. Using one of these may be simpler. You can of course have several openIDs.
As to provider services, there are many. See http://openid.net/wiki/index.php/Public_OpenID_providers
Sites you can use OpenID on
Also a big list, and growing quickly. See https://www.myopenid.com/directory
http://www.openid-ldap.org/ (OpenID provider based on LDAP authentication)