Page MenuHomePhabricator

Support AES256 at-rest encryption in Files
ClosedPublic

Authored by epriestley on Jun 16 2016, 2:45 AM.
Tags
None
Referenced Files
F15466604: D16127.id38801.diff
Thu, Apr 3, 7:26 AM
F15462767: D16127.id38801.diff
Tue, Apr 1, 5:34 PM
F15452014: D16127.id.diff
Sat, Mar 29, 1:10 AM
F15451183: D16127.id38800.diff
Fri, Mar 28, 8:39 PM
F15445569: D16127.diff
Thu, Mar 27, 2:38 PM
F15431613: D16127.id.diff
Mon, Mar 24, 1:28 PM
F15383699: D16127.id.diff
Fri, Mar 14, 5:37 PM
F15365882: D16127.diff
Tue, Mar 11, 2:11 PM
Subscribers
None

Details

Summary

Ref T11140. This makes encryption actually work:

  • Provide a new configuation option, keyring, for specifying encryption keys.
  • One key may be marked as default. This activates AES256 encryption for Files.
  • Add bin/files generate-key. This is helps when generating valid encryption keys.
  • Add bin/files encode. This changes the storage encoding of a file, and helps test encodings and migrate existing data.
  • Add bin/files cycle. This re-encodes the block key with a new master key, if your master key leaks or you're just paraonid.
  • Document all these options and behaviors.
Test Plan
  • Configured a bad keyring, hit a bunch of different errors.
  • Used bin/files generate-key to try to generate bad keys, got appropriate errors ("raw doesn't support keys", etc).
  • Used bin/files generate-key to generate an AES256 key.
  • Put the new AES256 key into the keyring, without default.
  • Uploaded a new file, verified it still uploaded as raw data (no default key yet).
  • Used bin/files encode to change a file to ROT13 and back to raw. Verified old data got deleted and new data got stored properly.
  • Used bin/files encode --key ... to explicitly convert a file to AES256 with my non-default key.
  • Forced a re-encode of an AES256 file, verified the old data was deleted and a new key and IV were generated.
  • Used bin/files cycle to try to cycle raw/rot13 files, got errors.
  • Used bin/files cycle to cycle AES256 files. Verified metadata changed but file data did not. Verified file data was still decryptable with metadata.
  • Ran bin/files cycle --all.
  • Ran encode and cycle on chunked files, saw commands fail properly. These commands operate on the underlying data blocks, not the chunk metadata.
  • Set key to default, uploaded a file, saw it stored as AES256.
  • Read documentation.

Event Timeline

epriestley updated this revision to Diff 38801.
epriestley retitled this revision from to Support AES256 at-rest encryption in Files.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
  • Fix a warning when checking for default AES keys.
chad edited edge metadata.
This revision is now accepted and ready to land.Jun 16 2016, 2:43 PM
This revision was automatically updated to reflect the committed changes.
helladopee added a task: Restricted Maniphest Task.Jun 25 2016, 3:27 AM