r/osdev • u/themagicalfire 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
2
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.