PageRenderTime 1305ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/doc/user/admin_area/settings/external_authorization.md

https://gitlab.com/markglenfletcher/gitlab-ee
Markdown | 134 lines | 101 code | 33 blank | 0 comment | 0 complexity | 2f551f6a8d26eac6378d90efdcf9424e MD5 | raw file
  1. ---
  2. type: reference
  3. ---
  4. # External authorization control **(CORE ONLY)**
  5. > [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/4216) in
  6. > [GitLab Premium](https://about.gitlab.com/pricing/) 10.6.
  7. > [Moved](https://gitlab.com/gitlab-org/gitlab-foss/merge_requests/27056) to
  8. > [GitLab Core](https://about.gitlab.com/pricing/) in 11.10.
  9. In highly controlled environments, it may be necessary for access policy to be
  10. controlled by an external service that permits access based on project
  11. classification and user access. GitLab provides a way to check project
  12. authorization with your own defined service.
  13. ## Overview
  14. Once the external service is configured and enabled, when a project is accessed,
  15. a request is made to the external service with the user information and project
  16. classification label assigned to the project. When the service replies with a
  17. known response, the result is cached for 6 hours.
  18. If the external authorization is enabled, GitLab will further block pages and
  19. functionality that render cross-project data. That includes:
  20. - most pages under Dashboard (Activity, Milestones, Snippets, Assigned merge
  21. requests, Assigned issues, Todos)
  22. - under a specific group (Activity, Contribution analytics, Issues, Issue boards,
  23. Labels, Milestones, Merge requests)
  24. - Global and Group search will be disabled
  25. This is to prevent performing to many requests at once to the external
  26. authorization service.
  27. Whenever access is granted or denied this is logged in a logfile called
  28. `external-policy-access-control.log`.
  29. Read more about logs GitLab keeps in the [omnibus documentation][omnibus-log-docs].
  30. ## Configuration
  31. The external authorization service can be enabled by an admin on the GitLab's
  32. admin area under the settings page:
  33. ![Enable external authorization service](img/external_authorization_service_settings.png)
  34. The available required properties are:
  35. - **Service URL**: The URL to make authorization requests to. When leaving the
  36. URL blank, cross project features will remain available while still being able
  37. to specify classification labels for projects.
  38. - **External authorization request timeout**: The timeout after which an
  39. authorization request is aborted. When a request times out, access is denied
  40. to the user.
  41. - **Client authentication certificate**: The certificate to use to authenticate
  42. with the external authorization service.
  43. - **Client authentication key**: Private key for the certificate when
  44. authentication is required for the external authorization service, this is
  45. encrypted when stored.
  46. - **Client authentication key password**: Passphrase to use for the private key when authenticating with the external service this is encrypted when stored.
  47. - **Default classification label**: The classification label to use when
  48. requesting authorization if no specific label is defined on the project
  49. When using TLS Authentication with a self signed certificate, the CA certificate
  50. needs to be trused by the openssl installation. When using GitLab installed using
  51. Omnibus, learn to install a custom CA in the
  52. [omnibus documentation][omnibus-ssl-docs]. Alternatively learn where to install
  53. custom certificates using `openssl version -d`.
  54. ## How it works
  55. When GitLab requests access, it will send a JSON POST request to the external
  56. service with this body:
  57. ```json
  58. {
  59. "user_identifier": "jane@acme.org",
  60. "project_classification_label": "project-label",
  61. "user_ldap_dn": "CN=Jane Doe,CN=admin,DC=acme",
  62. "identities": [
  63. { "provider": "ldap", "extern_uid": "CN=Jane Doe,CN=admin,DC=acme" },
  64. { "provider": "bitbucket", "extern_uid": "2435223452345" }
  65. ]
  66. }
  67. ```
  68. The `user_ldap_dn` is optional and is only sent when the user is logged in
  69. through LDAP.
  70. `identities` will contain the details of all the identities associated with the user. This will be an empty array if there are no identities associated with the user.
  71. When the external authorization service responds with a status code 200, the
  72. user is granted access. When the external service responds with a status code
  73. 401 or 403, the user is denied access. In any case, the request is cached for 6 hours.
  74. When denying access, a `reason` can be optionally specified in the JSON body:
  75. ```json
  76. {
  77. "reason": "You are not allowed access to this project."
  78. }
  79. ```
  80. Any other status code than 200, 401 or 403 will also deny access to the user, but the
  81. response will not be cached.
  82. If the service times out (after 500ms), a message "External Policy Server did
  83. not respond" will be displayed.
  84. ## Classification labels
  85. You can use your own classification label in the project's
  86. **Settings > General > General project settings** page in the "Classification
  87. label" box. When no classification label is specified on a project, the default
  88. label defined in the [global settings](#configuration) will be used.
  89. The label will be shown on all project pages in the upper right corner.
  90. ![classification label on project page](img/classification_label_on_project_page.png)
  91. <!-- ## Troubleshooting
  92. Include any troubleshooting steps that you can foresee. If you know beforehand what issues
  93. one might have when setting this up, or when something is changed, or on upgrading, it's
  94. important to describe those, too. Think of things that may go wrong and include them here.
  95. This is important to minimize requests for support, and to avoid doc comments with
  96. questions that you know someone might ask.
  97. Each scenario can be a third-level heading, e.g. `### Getting error message X`.
  98. If you have none to add when creating a doc, leave this section in place
  99. but commented out to help encourage others to add to it in the future. -->
  100. [omnibus-ssl-docs]: https://docs.gitlab.com/omnibus/settings/ssl.html
  101. [omnibus-log-docs]: https://docs.gitlab.com/omnibus/settings/logs.html