You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Key rotation required in case of it compromising or at the end of crypto period(key validity period). 

Goal: 

To implement ability to rotate cache encryption key. 

New processes: 

  1. Cache key rotation.

  2. Removal of cache key.  

New administrator commands: 

  1. Current state of cache key rotationnode -> group name -> status -> encryption key hash.

Cache group keys rotation: 

Process start: 

Administrator initiates process via some kind of user interface(CLI, VisorWebConsole, JMX, etc). 

Process description: 

  1. New key generated using configured EncryptionSPI. 

  2. Message with new key(encrypted with master keyis sent by discovery. 

  3. On message receive following actions are executed: 

  4. Process state: IN PROGRESS. 

  5. New key saved in metastore(WAL record about this event is written to the disk). 

  6. Further WAL records are encrypted with the new key. 

  7. Further page are encrypted with the new key. 

  8. Pages reencryption process is initiated. 

Pages reencryption process description: 

Process uses it's own Thread pool. 

Thread pool configured in IgniteConfiguration. 

  1. For each partition file. 

  2. File readed page by page. 

  3. For each page(following steps executed by many thread using producer-consumer pattern): 

    1. Page is blocked from write operation into regular Ignite Durable Memory. 

    2. Page is readed(from fileinto memoryNotethis process doesn“t use regular Offheap Ignite pages. 

    3. Page decrypted with previous key. 

    4. Page encrypted with new key. 

    5. Page is written into file. 

    6. Page id is added to reencrypted pages set(Bloom filter as it has constant size). 

    7. Page is unblocked. 

  4. Progress of reencryption is saved to WAL for failover after each X pages processed. X is configured in IgniteConfiguration. 

  5. End of each partition process is saved to WAL. 

  6. Process state: FINISHED. 

Motivation 

  1. Memory footprint [Thread count]*[page size]

  2. Minor affect on regular data operations. 

  3. Doesn“t displace hot pages from RAM during file scan process. 

Page decryption during reencryption process: 

During reencryption process page may be encrypted with previous key OR with new key. 

To decrypt page we have to do the following steps: 

  1. Block page from reencryption. 

  2. Check in reencrypted pages set is this page processed(see «Pages reencryption process description» #3.6) 

  3. If page not reencrypted yet we use old key for decryption. 

  4. If page reported as reencrypted(Bloom filter may be false positivewe: 

    1. Try to decrypt page with new key. 

    2. If fail we should try to use old key 

  5. Unblock page from reencryption. 

Process failover: 

If node fails in the middle of reencryption process we should resume reencryption process on node start. 

We should do following steps for started but not finished partition file: 

  1. Find last progress record in WAL. 

  2. Scan partition from the beginning to last progress record point and just add eache page to reencrypted pages set. 

  3. After it we have X pages that MAY BE reencrypted(and may be not). We should find fir not reencrypted page: 

    1. Trying to decrypt page with new key. 

    2. If fails then page is found 
      We should continue reencryption process starting from it. 

Process completion: 

Administrator initiates process completion via interface by using “cache key removal” command. 
Design assumeadministrator will check that all nodes successfully change cache key and reencrypt all pages and all required nodes are alive.

Cache group keys removal: 


Process start: 


Administrator initiates process via some kind of user interface(CLI, VisorWebConsole, JMX, etc). 


Process description: 


Message is sent by discovery. 

Message should contain: 


  • new cache key hash. 


When server node processed message following actions are executed: 


  1. Received cache key hash compared with known cache key hash. 

  2. Previous cache key removed from MetaStore. 

Monitoring command:


Reencryption process state. 
  • Inputcache id. 
  • Output: 
    • List of Tuples6 
      • Node ID 
      • Reencryption process state. 
      • Count of partition to process. 
      • Current partition index. 
      • Current partition id. 
      • Count of processed page in current partition. 


  • No labels