Easy CA management
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
1.8 KiB

  1. CA manager
  2. ==========
  3. This tools collection is our take on managing a CA, signing SSH keys and certificates, signin SSL certificates.
  4. ### Tools
  5. #### `request_server.py`
  6. This is a shell for a user, the shell only reads the input from the user and return a JSON. We like to use this user with Ansible to request and retrive ssh host certificates.
  7. The server logs can be found at `/home/request/request_server.log`
  8. ##### sign_request
  9. The input must be a JSON file, e.g
  10. ```JSON
  11. {
  12. "request": {
  13. "keyType": "ssh_host",
  14. "hostName": "my_new_server",
  15. "keyData": "ssh-ed25519 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa root@my_new_server"
  16. },
  17. "type": "sign_request"
  18. }
  19. ```
  20. the example is a `sign_request` for a ssh host certificate.
  21. ```JSON
  22. {
  23. "request": {
  24. "keyType": "ssh_user",
  25. "userName": "my_username",
  26. "keyData": "ssh-ed25519 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa my_username@my_hostname",
  27. "rootRequested": true
  28. },
  29. "type": "sign_request"
  30. }
  31. ```
  32. This example is `sign_request` for a ssh user certificate with root access.
  33. The shell just output a json with `status`, `reason`, `failed` and `msg` keys.
  34. ```JSON
  35. {
  36. "failed" : ...,
  37. "msg" : ...,
  38. "reason" : ...,
  39. "status" : ...
  40. }
  41. ```
  42. The keys `failed` and `msg` are only requested to comply with ansible.
  43. #### `manager.py`
  44. This is a shell for a user, the shell limits the commands to the one we are interested, like generating a SSH/SSL CA, signing keys.
  45. ```
  46. # LILiK CA Manager
  47. Welcome to the certification authority shell.
  48. Type help or ? to list commands.
  49. (CA Manager)> ?
  50. Documented commands (type help <topic>):
  51. ========================================
  52. describe_cas gen_ca help ls_ca ls_requests quit sign_request
  53. ```
  54. ### Configuration
  55. The only configuration needed is the path where to operate, modifying te file `paths.py` is all is needed.