Documentation

Go to Portal Website

Storage Encryption

PlanPlatformsMASVS
TeamiOSMASVS-STORAGE-1, MASVS-CRYPTO-1, MASVS-CRYPTO-2

Overview

Storage Encryption applies iOS Data Protection attributes to supported app files, protecting sensitive user data at rest against device-level attacks. It also provisions a device-bound AES-256 key in the iOS Keychain for supported encryption operations.

Android storage permission hardening is documented separately in Storage Permission Hardening. The Android permission-hardening control does not encrypt app files.

How It Works

Applies iOS Data Protection classes to files in your app's Documents and temp directories. By default, uses NSFileProtectionCompleteUntilFirstUserAuthentication, which protects files until the device is unlocked for the first time after boot. Files remain encrypted on disk when the device is locked.

The control also provisions an AES-256 key in the Keychain for additional encryption operations, stored with strong protection attributes (kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly) to ensure it never leaves the device.

What Is Protected

Excluded for host compatibility:

These exclusions prevent compatibility issues with host SDKs and frameworks that may need to access preferences or cached data before the device is unlocked.

Threats Mitigated

Caveats

Support Matrix

PlatformMinimum VersionNotes
iOSiOS 10.0+Data Protection available on all modern devices

How to Enable the Control

Navigate to Preventative Controls from the AppTego portal, and expand the Data at Rest Protection section. Under this section you will find the Storage Encryption control for iOS apps. Click Enable to enable it for the next build or for it to be applied with a live push (if enabled).

API Configuration Example

{
  "StorageEncryptionPrevention": {
    "protection": true
  }
}
FieldPurpose
protectionEnables iOS storage encryption behavior for protected apps.

Configuration

This control is configured through MobileDefender's standard control configuration:

Options

The protectionClass parameter allows customization of the NSFileProtection level:

Caution: Using "complete" may break background functionality and should only be enabled after thorough testing.