Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

One step we have taken is to build an auth system that requires you as the developer to explicitly specify the security of an endpoint using a decorator. If no decorator is provided, then the endpoint is completely locked down even to admins (effectively disabled).

If an endpoint is decorated with something that is considered dangerous (i.e. public access), that triggers additional review steps. In addition, the authentication forbids certain combinations of decorators and access patterns.

It's not perfect, but it has saved us a few times from securing endpoints incorrectly in code.



.NET web apps / APIs have an option where you can require authorization on all controllers (and their actions) by default. If you need an anonymous controller/action, you can use the `[AllowAnonymous]` attribute on it.


You can easily do the same with most (all?) routers using middleware. Whether you get it slotted in your roadmap is a different story.


That's pretty cool.

> that triggers additional review steps

Is this done by some sort of a linter running in CI?




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

Search: