Keep security logs that answer a question without collecting secrets
Record sign-ins, permission changes and privileged actions, protect the logs and make sure a harmless test event appears.
In brief
Useful security logs connect an event to a time, an actor, a target and an outcome. Start with events you would need to investigate an unwanted account or deployment change.
A small tested event trail is better than collecting every request body while still being unable to explain who changed a permission.
Define events before fields
For a permission grant, you need the granting actor, the receiving account, the changed permission and the result. For deployment, keep the authorized actor and release reference. Avoid storing a credential just to identify it; use a non-secret reference.
Make the trail usable
Use a consistent time zone and preserve provider event identifiers when useful. Check failed as well as successful privileged actions. Protect storage and access so an ordinary application credential cannot silently erase the only evidence of its own misuse.
Limit collection and retention
Redact or omit unnecessary payloads and personal data. Set retention to a justified operational need and check deletion actually occurs. Validate a sample periodically after configuration changes. Do not describe a log archive as complete incident evidence when some events or systems are not covered.
Before you act
Logs can contain personal information and become a new exposure. Do not record passwords, authentication tokens, full private documents or unnecessary request bodies.
What to do next
- Choose the security events you need to explain: sign-ins, access changes and privileged releases.
- Record consistent timestamps, a limited actor reference, target and result with restricted log access.
- Generate a harmless authorized test event and verify it is findable, then set an appropriate retention policy.