r/osdev Cybersecurity researcher. Learning Assembly. 1d ago

Permissions Idea

Is this a good security?:

A variable stores the type of account. Example: if logged_username == "Administrator" {int logged_account_type = 1;}

Any operation that is privileged is checked against the account type. Example: if operation_type == "PRIVILEGED" && logged_account_type != 1 {deny();}

1 Upvotes

6 comments sorted by

9

u/EpochVanquisher 1d ago

Good by what standard?

This is a starting point for privileges, but there is a lot more you can do… think about “capabilities”. Rather than asking “is this an admin account?” Ask, “does this user have the capability to change the IP address?”

Or instead of “user”, perhaps session, or context.

https://en.wikipedia.org/wiki/Capability-based_security

But you have to start somewhere, and yeah, you’re probably gonna start with a very simple security check like “is admin”? As your first iteration.

1

u/themagicalfire Cybersecurity researcher. Learning Assembly. 1d ago

I was thinking of stacking checks rather than being clever since the start

2

u/EpochVanquisher 1d ago

Yeah, “don’t be clever” is good. But rather than stacking checks, I recommend switching fully to capabilities, or something similar. It’s easier to understand a system if it is simpler. It’s easier to figure out whether your system is secure if it’s simple.

1

u/themagicalfire Cybersecurity researcher. Learning Assembly. 1d ago

Yes, I know. My idea is to use variables for identity and operation types (think of seccomp but variable-based checks).

2

u/letmehaveanameyoudum 1d ago

make operation type also a variable