Using the right privilege level
Most systems do not need to run as admin. Requiring your application to have admin rights is a potential security risk. It would be best to ensure your application runs on the lowest security level possible to avoid potential leaks.
However, sometimes you have no choice. There are certain cases where admin-level privilege is needed. The bad news is that this happens often in the world where we, system programmers, live. Our systems need an admin level more than a regular program does.
Admin-level scenarios
Let’s investigate some areas where elevated privileges are needed if we want our system to do what it needs to do:
- Filesystem operations:
Accessing or modifying system files, such as updating or reading configuration files stored in protected directories. For instance, the
C:\Windows\System32
directory is a good example of a protected directory. You need elevated rights if you want to read something from that folder. - Registry...