4
0

SECURITY 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. Security Design of corosync
  2. The corosync project intends to mitigate the following threats:
  3. 1. forged group messaging messages which are intended to fault the corosync
  4. executive
  5. 2. forged group messaging messages which are intended to fault applications
  6. using corosync apis
  7. 3. monitoring of network data to capture sensitive information
  8. The corosync project does not intend to mitigate the following threats:
  9. 1. physical access to the hardware which could expose the private key
  10. 2. privledged access to the operating system which could expose the private key
  11. or be used to inject errors into the corosync executive.
  12. 3. library user creates requests which are intended to fault the corosync
  13. executive
  14. The corosync project mitigates the threats using two mechanisms:
  15. 1. Authentication
  16. 2. Secrecy
  17. Library Interface
  18. -----------------
  19. The corosync executive authenticates every library user. The library is only
  20. allowed to access services if it's GID is corosync or 0. Unauthorized library
  21. users are rejected.
  22. The corosync group is a trusted group. If the administrator doesn't trust the
  23. application, it should not be added to the group! Any member of the corosync group
  24. could potentially send a malformed request to the executive and cause it to
  25. fault.
  26. Group Messaging Interface
  27. -------------------------
  28. Group messaging uses UDP/IP to communicate with other corosync executives using
  29. messages. It is possible without authentication of every packet that an
  30. attacker could forge messages. These forged messages could fault the corosync
  31. executive distributed state machines. It would also be possible to corrupt
  32. end applications by forging changes.
  33. Since messages are sent using UDP/IP it would be possible to snoop those
  34. messages and rebuild sensitive data.
  35. To solve these problems, the group messaging interface uses two new interfaces
  36. interal to it's implementation:
  37. 1. encrypt_and_sign - encrypts and signs a message securely
  38. 2. authenticate_and_decrypt - authenticates and decrypts a message securely
  39. When the executive wants to send a message over the network, it uses
  40. encrypt_and_sign to prepare the message to be sent. When the executive
  41. wants to receive a message from the network, it uses
  42. authenticate_and_decrypt to verify the message is valid and decrypt it.
  43. Corosync uses AES256/SHA-1 which from the Mozilla Network Security
  44. Services (libnss) library.
  45. The internal functions utilize the following algorithms:
  46. sha1 - hash algorithm secure for using with hmac
  47. hmac - produces a 16 byte digest from any length input
  48. Every message starts with a
  49. struct security {
  50. unsigned char digest[20]; A one way hash digest
  51. unsigned char salt[16]; A securely generated random number
  52. }
  53. USING LIBNSS
  54. ------------
  55. When corosync is started up libnss is initialised,
  56. the private key is read into memory and stored for later use by the code.
  57. When a message is sent (encrypt_and_sign):
  58. ------------------------------------------
  59. - The message is encrypted using AES.
  60. - A digest of that message is then created using SHA256 and based on the
  61. private key.
  62. - the message is then transmitted.
  63. When a message is received (decrypt_and_authenticate):
  64. - A Digest of the encrypted message is created using the private key
  65. - That digest is compared to the one in the message security_header
  66. - If they do not match the packet is rejected
  67. - If they do match then the message is decrypted using the private key.
  68. - The message is processed.
  69. Comments welcome mailto:discuss@corosync.org