Hacker News new | past | comments | ask | show | jobs | submit login
How to secure anything (github.com/veeral-patel)
188 points by arberavdullahu on Feb 22, 2022 | hide | past | favorite | 24 comments



This is missing an extremely important upfront concept: you need to know what you're protecting and how valuable it is.

It does no good whatsoever to require every user of a grocery-list app to have a Yubikey to verify their identity. It might not even make sense to have users login at all.

The balance between usability and security must be consonant with the costs of implementation.


I believe that was covered, but it was under the context of security policy vs a more direct description. The key point I'd pull out is: "The goal isn't to eliminate risk entirely, but bring it down to an acceptable level."

There could be (and probably are) entire books written about how to define what "an acceptable level" means... but that is the same point you are getting at - security is not a guaranteed lockdown of your assets, it is self-defined sufficient deterrence to attack. Sometimes that means light security, sometime that means heavy... but it is up to you to make those decisions.


> how to define what "an acceptable level" means

Build yourself a threat model. It's only you that can decide this.


That should come out in threat modelling, which is covered. when you're looking at who the adverseries for a specific system are, you'll necessarily cover what your data is and how valuable it is.

What may not be covered, and something which often causes problems with a lot of systems, is your threat model, may not be the same as that of your customers and, depending on what you're selling, you may not be able to know your customers threat model in advance.

To provide a couple of examples. If you provide server hosting, and a crypto exchange starts using your service, suddenly you may attract a load of attention from high-end attackers looking to compromise your systems as a means to get at other peoples.

or if you provide something like a consumer photo sharing/storage system, if "celebrities" start using it, suddenly you can find that people with a lot of time and interest start targeting you.

The tricky part is, commercially, do you have the resources to secure to the level required by the most sensitive customer...


Unfortunately, if you force users to pick between usability and security, they'll ignore security every time.

Or as I often say "no one ever says, 'wow, that was a great login experience', they just want to get to the features behind that experience (hopefully securely behind it)".


This isn't right. Think about putting locks on doors. Everyone is going to put a lock on their external doors and not on the interior doors in their residences (except for the special sort of "lock" on bathroom doors) but maybe on some internal doors in their businesses.

People can make the right choice about security when they know what they are securing. Instead, online we are inundated with so much unnecessary security we start to have a prior biased towards: this isn't important. Back to the physical door analogy, when there are locks on every door even doors that really don't need them, people start propping open doors.


And maybe that's OK in many cases?

Sure, banks must enforce good security, but a lot of other things should not care.

Like online stores for example. As long as I am paying paypal, the only info my account has is email, address and recent orders. One can google my address in about 20 minites anyway, and this means I really don't care about account security. If there was an option to login without password using email alone, I'd probably pick it.


> online stores [...] my account

Why would you need an account at all, that just raises the risk (of a data breach) for the buyer? I always prefer not having to have yet another account to buy something.


Yes, if there is a "no account" option, then this is even better.

But sadly a lot of places I saw do not offer this -- you are forced to make an account to purchase. I am not sure why. Maybe they think they can improve engagement/recognition by forcing users to make an account? Or maybe they are too lazy to implement no-account workflows? Or a misguided thought that sending detailed receipts by email is bad?

(The goal of store accounts are: (1) provide list of active orders; (2) for individual order, show user the order status; (3) once order is complete, show order details with easy re-order links. This can definitely be all done with email, but this seems to be unpopular with some users. So many stores have to implement web-only flow, which needs account for authentication. And at this point, many of them just stop.)


See the thread from earlier today about login.gov



Yup


Already makes the crucial mistake:

Security people always want to "set policy" "educate on practices" and "enforce". You've already lost the battle.

PROVIDE SOLUTIONS. Why recommend all this "policy" when what you need to do is provide, at a minimum, a reference implementation. If you get called in as part of security architecture, PROVIDE A SOLUTION.

Because if you don't the devs will do the absolute minimum, and likely will have backdoors galore, especially as your policies impose real restrictions on their systems support quality of life, ability to respond to production issues, and iterate to produce features.

The other persistent issue with security is that it is anathema to automation, and therefore efficiency. So dovetailing with providing a solution, these practices for 2FA and SSO (which invariably involves horrible popup UIs and other hacky things) will block, say, automated backups, auditing, monitoring, etc that also require access. So be ready with those.


> Security people always want to "set policy" "educate on practices" and "enforce". You've already lost the battle.

>PROVIDE SOLUTIONS.

Here you go: https://qubes-os.org


I think this is correct but is tricky to put into action as companies rarely staff security departments to do this, typically you'll see ratios of 20 devs or even 50 devs to 1 security person. At that level it's very difficult for the security person to know enough/have enough time for detail work.

Ideally technical security implementation should be seen as a function of the development/DevOps teams. You can have security teams to provide specific advice but the work of designing and implementing controls is best done within the team managing the system.


But how do I actually do any of this.

E.g., in Azure, in theory, we should PoLP the access controls. But Azure's tutorials and guides often recommend using Contributor (Azure role that entails access to almost everything, except granting more access), and which permissions an API call requires is, AFAICT, undocumented. And sometimes, the error doesn't tell you.¹

I want to allow SSH into systems. Copying keys about the landscape is one employee departure away from having keys on systems that don't need to be there. The last time I set up LDAP … I had to learn about object classes, and some sort of object-oriented tree database when all I want is a list of users & perms. (I understand LDAP's design better now, and I even like it, but it the onboarding is braindeath.)

There are any number of k8s dashboards that would give my coworkers better vis … and basically none that have an auth story.

The examples are endless.

¹heck, sometimes the error isn't even grammatically correct English.


Tyically there's a hierarchy of security documents/practices. you start with principles work, like in this repo. then you look at technologies you use and start getting into specific examples.

For many platforms/services there will be security best practice sections on their sites and that's a starting point, but then as you mention even their tutorials often don't follow good practice.

The challenge for people writing standards docs is similar, new things come along all the time. How much time is availble to be dedicated to writing detailed guidance.

To give one example, the CIS benchmarks that a lot of orgs use to harden their environments are written almost purely by volunteers, so keeping them updated is a tricky game.


If you are interested in this topic, can't recommend this book enough: https://www.cl.cam.ac.uk/~rja14/book.html

The 3rd edition is expansive (1000 pages, plenty of references) but readable. Free PDFs of previous editions are available at that link.


Agreed, hands down the single best book on security principles I’ve ever come across. Also covered in video lecture format by the authors here https://youtube.com/channel/UCRw25HVj1Rvl2XcEHdj4PKg


This list comes up often without discussion:

     https://news.ycombinator.com/from?site=github.com/veeral-patel
It's a nice list, but still missing core concepts such as backups and system availability.


These are about adding stuff. The overwhelmingly sost effective way to secure things is to simplify them until you have good confidence you understand the thing as a whole which enables you to reason about its security properties on a much better level with high confidence, and enable other people to do the same.


Pretty good anthology of info here, but, no commits in over a year ?


At a principles level TBH security advice often doesn't change much over time.

I've been in the industry for 20+ years now and I can see things in that repo. that were old when I started :)

The technologies change, and the implementations change, but concepts like "defence in depth" don't.


Hmm, probably outdated then.

:)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: