|
| 1 | +--- |
| 2 | +title: BambooHR |
| 3 | +description: Configure the BambooHR external data provider to extend your access policies. |
| 4 | +--- |
| 5 | + |
| 6 | +import Tabs from '@theme/Tabs'; |
| 7 | +import TabItem from '@theme/TabItem'; |
| 8 | + |
| 9 | +The BambooHR integration provides integration with HR data such as group memberships, employment status, out of the office, location, etc. |
| 10 | + |
| 11 | +:::caution |
| 12 | +The external data sources we provide are meant to be examples and inspiration for users to create their own data sources. We won't maintain these integrations in perpituity, and changes to the APIs they interact with may break them in the future. |
| 13 | + |
| 14 | +The [datasource](https://github.com/pomerium/datasource) project is open-source, and if the community wishes to provide contributions to keep it working in the future, we will shepherd those updates. |
| 15 | +::: |
| 16 | + |
| 17 | +## Install |
| 18 | + |
| 19 | +1. Create new BambooHR API key by navigating to **Your profile** → **API Keys**, and adding a new API Key. |
| 20 | + |
| 21 | +1. In order to correctly parse dates returned by BambooHR API you will need to provide a time zone - either an `UTC` or [IANA Time Zone] database name, i.e. `America/New_York`. |
| 22 | + |
| 23 | +<Tabs> |
| 24 | +<TabItem value="compose" label="Docker Compose"> |
| 25 | + |
| 26 | +These instructions assume a local testing environment using [Docker Compose]. Adjust as needed for your deployment environment. |
| 27 | + |
| 28 | +1. Add the datasource docker image to Docker Compose: |
| 29 | + |
| 30 | + ```yaml showLineNumbers |
| 31 | + version: "3" |
| 32 | + services: |
| 33 | + bamboohr: |
| 34 | + image: docker.cloudsmith.io/pomerium/datasource/datasource:main |
| 35 | + command: |
| 36 | + - bamboohr |
| 37 | + - --bamboohr-api-key=$YOUR_API_KEY |
| 38 | + - --bamboohr-subdomain=$YOUR_BAMBOOHR_SUBDOMAIN |
| 39 | + - --bamboohr-time-zone=America/New_York |
| 40 | + - --address=:8080 |
| 41 | + container_name: bamboohr |
| 42 | + restart: always |
| 43 | + expose: |
| 44 | + - 8080 |
| 45 | + ``` |
| 46 | +
|
| 47 | +1. Bring up the new container. |
| 48 | +
|
| 49 | +</TabItem> |
| 50 | +<TabItem value="binary" label="Binary"> |
| 51 | +
|
| 52 | +These instructions assume a local testing environment. Adjust as needed for your deployment environment. |
| 53 | +
|
| 54 | +1. Download the latest [release] of the [Pomerium datasource] project and extract it. |
| 55 | +
|
| 56 | +1. Change directory and run the binary: |
| 57 | +
|
| 58 | + ```sh |
| 59 | + cd pomerium-datasource-* |
| 60 | + ./pomerium-datasource bamboohr --bamboohr-api-key=$YOUR_API_KEY --bamboohr-subdomian=$YOUR_BAMBOOHR_SUBDOMAIN --bamboohr-time-zone=America/New_York |
| 61 | + ``` |
| 62 | + |
| 63 | + The output should resemble: |
| 64 | + |
| 65 | + ```sh |
| 66 | + {"level":"info","message":"ready"} |
| 67 | + ``` |
| 68 | + |
| 69 | +</TabItem> |
| 70 | +</Tabs> |
| 71 | + |
| 72 | +## Configure Configure External Data Source |
| 73 | + |
| 74 | +BambooHR data connector exposes two API endpoints: |
| 75 | + |
| 76 | +- `/employees/all` returns all employees |
| 77 | +- `/employees/available` returns employees that are not currently out of the office due to vacation or other leave reasons. |
| 78 | + |
| 79 | +To create new external data record: |
| 80 | + |
| 81 | +1. In the Pomerium Enterprise Console, navigate to **CONFIGURE** → **External Data** and click **+ ADD EXTERNAL DATA SOURCE**. |
| 82 | + |
| 83 | +1. Fill out the following fields: |
| 84 | + |
| 85 | + | Field | Content | Notes | |
| 86 | + | :---------- | :----------------------------------------- | :-------------------------------------------------------------------------------- | |
| 87 | + | URL | `http://bamboohr:8080/employees/available` | Adjust for the endpoint you'll write policies against. | |
| 88 | + | Record type | `pomerium.io/BambooHRAvailable` | As above, adjust to somethinglike pomerium.io/BambooHRAll for the other endpoint. | |
| 89 | + | Foreign Key | `user.email` | Pomerium uses the users's email to associate IdP and Bamboo user entries. | |
| 90 | + |
| 91 | +1. Click **SAVE EXTERNAL DATA SOURCE**. |
| 92 | + |
| 93 | +1. Define a new policy. The example policy below only allows access to the persons in the *Marketing* department and only when they are not on vacation. |
| 94 | + |
| 95 | + <Tabs> |
| 96 | + <TabItem value="builder" label="Builder"> |
| 97 | + |
| 98 | +  |
| 99 | + |
| 100 | + </TabItem> |
| 101 | + <TabItem value="editor" label="Editor"> |
| 102 | + |
| 103 | + ```yaml showLineNumbers |
| 104 | + allow: |
| 105 | + and: |
| 106 | + - record: |
| 107 | + field: department |
| 108 | + is: Marketing |
| 109 | + type: pomerium.io/BambooHRAvailable |
| 110 | + ``` |
| 111 | +
|
| 112 | + </TabItem> |
| 113 | + </Tabs> |
| 114 | +
|
| 115 | +## Reference |
| 116 | +
|
| 117 | +The BambooHR data source provides the following record details; see [BambooHR Field Reference] for details. |
| 118 | +
|
| 119 | +- `department` |
| 120 | +- `division` |
| 121 | +- `status` |
| 122 | +- `first_name` |
| 123 | +- `last_name` |
| 124 | +- `country` |
| 125 | +- `state` |
| 126 | + |
| 127 | +[datasource]: https://github.com/pomerium/pomerium |
| 128 | +[Docker Compose]: https://docs.docker.com/compose/ |
| 129 | +[IANA Time Zone]: https://www.iana.org/time-zones |
| 130 | +[BambooHR Field Reference]: https://documentation.bamboohr.com/docs/list-of-field-names |
| 131 | +[release]: https://github.com/pomerium/datasource/releases |
| 132 | +[Pomerium datasource]: https://github.com/pomerium/datasource |
0 commit comments