Hunter Henrichsen

Hunter Henrichsen

Search Circle
< lecture

Lecture 10 - Security

posted 6 months ago 5 min read

Lecture 10 - Security#

Resources and AAA#

Resources#

I’m going to talk a lot about “resources” in this lecture. This is an abstract term for “things that users can access.” That might mean REST endpoints, certain pages, and really anything else that may have access controls attached.

Authentication#

Authentication is your ability to identify a user based on the request that they are making. Some endpoints may only make sense in relation to a current user, for example an endpoint that shows the currently logged in user, or lists resources owned by that user.

Authorization#

Authorization is your ability to restrict resources to specific users. Authorization issues are much more common than authentication issues, especially as you add more and more resources with more complex access relationships.

Accounting#

Accounting (or auditing) is information that you store that allows you to see a sequence of events that users are taking. One example is an audit log, where you keep a history of any administrative actions taken, or where you can show what activities users are doing. This is useful when something goes wrong in authorization; you can still use authentication to establish a list of resources that were improperly accessed.

Normally, an access log with a user ID will be sufficient, but this may vary by your use case.

Types of Attacks#

The OWASP has a list here that’s worth being familiar with. Here are some others that I think are worth thinking about.

Supply Chain Attacks#

These are vulnerabilities introduced to upstream dependencies like npm dependencies. Some people get around these by pinning versions or vendoring packages. The recent xz vuln is an example of this. This is another example of a theoretical supply chain attack that I think about a lot.

Third Party Vulnerabilities#

A variant of Supply Chain Attacks, but ones that I attribute to incompetence and ignorance more than malice. Sometimes third parties, especially third party services that you use, or even customers, do insecure things. You should be careful of what third parties are allowed to do on your services and have a plan in place should one of them stop working.

Secrets Leaking#

Through a number of other things that could go wrong, sometimes your secrets get exposed to the public. You should have a plan in place (and perhaps practice) rotating your secrets.

Hack This Site#

Please go through the exercises on the site; they show you some of the many ways people can get to information on your app. I think the DEFCON talks are worth watching / listening to as well to learn about how things are breached. There are also security and exploit reports worth reading, and learning from other people’s mistakes.

Your Own Audits and Bug Bounties#

It’s definitely worth it to do something like we did last week on your own site – get together, try to find vulnerabilities, or just otherwise explore what information you can get access to.

You can also do bug bounties, and there are individuals out there who will look for vulnerabilities in your apps in exchange for a fee for each one they find.

Staying up to Date with Security#

Here are some ideas from me and one of my friends who has spent some time pentesting.

Courses and Resources#

Interactive#