Comparison
Principle of least privilegevsSecret rotation
Principle of least privilege
you give the service a database user that can only read the two tables it needs, rather than the one that can drop everything.
Granting only the permissions needed for the task, for as long as they are needed. It does not prevent compromise; it bounds what a compromise reaches. The common violations are boring and universal: an admin credential in CI, a service account with wildcard permissions, a token that never expires.
Full entry →Secret rotation
you replace the API key on a schedule, which means the system must tolerate two valid keys at once during the changeover.
Periodically replacing credentials so that an undetected leak has a bounded lifetime. The mechanism that makes it possible is overlap: accept both old and new during a window, or every rotation is an outage. A secret that cannot be rotated without downtime will not be rotated.
Full entry →