Documenting sensitive data classes and protection requirements
Data protection needs to cover the sensitivity, use, location and lifetime of information across application components. Understanding sensitive data classes and protection requirements helps establish which security property the feature needs and where that property is actually enforced.
What does this involve?
Storage security concerns the copies that remain after an operation has finished. Files, databases, caches and exports can have different access rules and retention periods. A protected main database does not automatically protect a temporary copy or a restored backup.
A key prerequisite for being able to protect data is to categorize what data should be considered sensitive. There are likely to be several different levels of sensitivity, and for each level, the controls required to protect data at that level will be different.
There are various privacy regulations and laws that affect how applications must approach the storage, use, and transmission of sensitive personal information. This section no longer tries to duplicate these types of data protection or privacy legislation, but rather focuses on key technical considerations for protecting sensitive data. Please consult local laws and regulations, and consult a qualified privacy specialist or lawyer as required.
Why it matters
Consider a realistic failure: a private record is protected in the primary store but persists in an export, cache or client copy after access should end.
Exposure can involve private records, reusable credentials or information that identifies a customer. The practical impact depends on which copy is accessible, the access an attacker needs and whether the recovered material remains useful.
A code audit connects a stated requirement to the implementation responsible for enforcing it. Source review and targeted behavioural checks should explain the same boundary and any relevant exceptions.
How penetration testers check for it
Review the specific control expectations below against the code, deployment and observable application behaviour.
- Confirm that all sensitive data created and processed by the application has been identified and classified into protection levels. This includes data that is only encoded and therefore easily decoded, such as Base64 strings or the plaintext payload inside a JWT. Protection levels need to take into account any data protection and privacy regulations and standards which the application is required to comply with.
- Confirm that all sensitive data protection levels have a documented set of protection requirements. This must include (but not be limited to) requirements related to general encryption, integrity verification, retention, how the data is to be logged, access controls around sensitive data in logs, database-level encryption, privacy and privacy-enhancing technologies to be used, and other confidentiality requirements.
- Check temporary copies, exports, backups and deletion behaviour.
- Establish whether recovered information grants any further access.
How to fix it
Implement the required boundary in the component that actually performs the sensitive operation and retain focused regression coverage.
- Retain only the information needed for the service.
- Separate private working data from deliberately shared content.
- Protect encryption keys independently of encrypted files.
- Verify removal and recovery behaviour against the intended lifecycle.
Encryption is one part of the design. It cannot compensate for an application that willingly returns plaintext to an unauthorised caller.
Recheck the changed behaviour against the original failure conditions and the legitimate user journey. Keep enough evidence to show which release and configuration were verified, and include related entry points that depend on the same security decision.
Related issues
- Documenting application security events and logging requirements
- Documenting application authentication and recovery requirements
- Documenting security requirements for application file handling
Read about our methodology or contact pentested.com to discuss the security of your application code.