I've seen a few topics on this, but I'd like to offer it as a discussion before seeing if I can or should implement it.
My thought, is to provide a hardcoded user and or permission/ role assignment for permissions such as super user, so that if my DB were to be compromised, I'd still have access to what was needed to fix things. In WordPress for example, I know I've had times where my data got corrupted and sometimes I, as the only user, lost admin access to my site till i went and manually adjusted the DB entry. But I'd like to prevent that, and also prevent someone from assigning themselves as a super user or altering the super user record.
Ideally, I'd want to design something that would require a key card or something to authenticate the user, opposed to the password alone. But for now we can just discuss the password option.
Though if you know of any package that would provide functionality to "look for this file/code being present, if so allow access". File may be introduced via a USB connection, I would think.
This isn't a major thing right now, but it has been something I've been thinking about every so often, so I'd like to get some thoughts on it. And where could I put such a file, or hardcoded permission. Would that be as simple as a middleware with a "if user is XYZ assign super-admin permission" Ideally, without that permission being in the db itself to prevent modifications from bad actors.