{"id":420,"date":"2019-06-11T22:28:04","date_gmt":"2019-06-11T22:28:04","guid":{"rendered":"https:\/\/mybloguat.n-dol.org\/?p=401"},"modified":"2022-06-07T22:26:13","modified_gmt":"2022-06-07T22:26:13","slug":"install-workspace-one-uem-scim-adapter-on-photon-os","status":"publish","type":"post","link":"https:\/\/blog.n-dol.org\/2019\/06\/11\/install-workspace-one-uem-scim-adapter-on-photon-os\/","title":{"rendered":"Install Workspace ONE UEM SCIM Adapter on Photon OS"},"content":{"rendered":"\n
Joe Rainone<\/strong><\/a> & Matt Williams<\/strong><\/a> have created an awesome piece of work called Workspace ONE SCIM Adapter<\/a><\/strong>, it has been released as a fling, read more about here: https:\/\/blog.virtualprivateer.com\/2019\/06\/08\/ws1-uem-scim-adapter\/<\/a> If you missed the news, VMware photon OS is a lightweight container ready Linux distribution. Created by VMware, in 2015, it help having a quick Linux base for deploying container anywhere. For example, vCenter appliance 6.5+ run on Photon OS. Photon OS can be deployed on multiple type of layer, Azure, Amazon, vSphere, Google Cloud, you name it (yes, Raspberry is in the list). Workspace ONE UEM SCIM Adapter have some prerequisites, detailed here : The adapter requires NodeJS to run. To install it, run<\/p>\n\n\n\n The adapter is packed as a Photon OS use This will save the configuration for IPv4<\/p>\n\n\n\n This will save the configuration for IPv6<\/p>\n\n\n\n If you want to enable the port on both IPv4 and IPv6, you need to execute both commands.<\/p>\n\n\n\n We are going to run the adapter with a service account, to create it:<\/p>\n\n\n\n Create the directory, which will contain the SCIM adapter. In this blog, I’m going to use We now need to change \/opt permission to allow other user to read and execute, As we are using a service account, the log folder need to be created and owner changed as the service account can’t write in the You will need to upload the archive onto the server. My favorite way is The installation is straight forward. Extract the archive content in the folder previously created. Example:<\/p>\n\n\n\n Now the adapter have been installed, we need to configure it. Change:<\/p>\n\n\n\n Photon OS use SystemD as the daemon system, we are going to use it to With the following content: Once we have created the daemon file, we need to enable it to start at boot time.<\/p>\n\n\n\n And finally, we can start it<\/p>\n\n\n\n To validate that the adapter is up and running, do a curl on localhost first.<\/p>\n\n\n\n You should have The second test is to access from a another machine to validate that the service is not blocked by Curl<\/p>\n\n\n\n PowerShell<\/p>\n\n\n\n If the service doesn’t start, you need to have a look with the following command.<\/p>\n\n\n\n If the error state it can’t access a file make sure the We have now the service up and running on Photon OS. We also need to configure the directory (i.e: Azure AD, Okta, etc.) to point to the adapter.<\/p>\n\n\n\n For the configuration of Azure AD, follow Matt’s post here: https:\/\/blog.virtualprivateer.com\/2019\/06\/08\/ws1-uem-scim-adapter\/<\/a><\/p>\n\n\n\n
In a nutshell, it provides capability to do SCIM provisioning into Workspace ONE UEM.
This blog post is about installing this component on VMware Photon OS, it is meant to be educational so no script here :).<\/p>\n\n\n\n\n\n\n\nWhat is Photon OS<\/h2>\n\n\n\n
More info: https:\/\/vmware.github.io\/photon\/<\/a><\/p>\n\n\n\nHow to deploy Photon OS<\/h2>\n\n\n\n
This blog post assume that you already have deployed Photon OS, meaning network is up, you have either root or sudo permission and you can either type command in the console or SSH to it.
You can follow the documentation from here : https:\/\/vmware.github.io\/photon\/assets\/files\/html\/3.0\/photon_installation\/<\/a><\/p>\n\n\n\nPreparation for the installation<\/h2>\n\n\n\n
https:\/\/labs.vmware.com\/flings\/workspace-one-uem-scim-adapter#requirements<\/a><\/p>\n\n\n\nSoftware Installation<\/h3>\n\n\n\n
tdnf install nodejs<\/code><\/pre>\n\n\n\n
tar.gz<\/code> archive. Photon don’t include
tar<\/code> by default, so you need to install it.<\/p>\n\n\n\n
tdnf install tar<\/code><\/pre>\n\n\n\n
Network<\/h3>\n\n\n\n
iptables<\/code> and block any port from the outside.
The adapter can run on any port<\/strong>, the default port is 9000<\/strong>. <\/p>\n\n\n\nOpen Port<\/h4>\n\n\n\n
iptables -A INPUT -p tcp --dport 9000 -j ACCEPT<\/code><\/pre>\n\n\n\n
Save IPtables configuration<\/h4>\n\n\n\n
iptables-save > \/etc\/systemd\/scripts\/ip4save<\/code><\/pre>\n\n\n\n
iptables-save > \/etc\/systemd\/scripts\/ip6save<\/code><\/pre>\n\n\n\n
Service Account<\/h3>\n\n\n\n
useradd --system --no-create-home --shell \/bin\/bash --user-group ws1scimadapter<\/code><\/pre>\n\n\n\n
Folder<\/h3>\n\n\n\n
\/opt\/ws1scim<\/code> but you can use anything else.<\/p>\n\n\n\n
mkdir --parents --mode=755 \/opt\/ws1scim<\/code><\/pre>\n\n\n\n
mkdir<\/code> only add 755 from the above command on the final directory.<\/p>\n\n\n\n
chmod 755 \/opt<\/code><\/pre>\n\n\n\n
\/var\/log<\/code> folder<\/p>\n\n\n\n
mkdir --mode=755 \/var\/log\/ws1scim\/\nchown ws1scimadapter:ws1scimadapter \/var\/log\/ws1scim\/<\/code><\/pre>\n\n\n\n
Upload<\/h3>\n\n\n\n
curl<\/code> from a web server as
curl<\/code> is by default on Photon OS and don’t require any SSH\/SFTP.<\/p>\n\n\n\n
curl http:\/\/mywebserver.domain.tld\/files\/WS1SCIMAdapter\/ws1_uem_scim_adapter.tar.gz -o \/root\/ws1_uem_scim_adapter.tar.gz<\/code><\/pre>\n\n\n\n
Adapter Installation<\/h2>\n\n\n\n
Change archivelocation<\/code> and
installationfolder<\/code> accordingly.<\/p>\n\n\n\n
tar -xzvf <archivelocation>\/ws1_uem_scim_adapter.tar.gz -C <installationfolder><\/code><\/pre>\n\n\n\n
tar -xzvf \/root\/ws1_uem_scim_adapter.tar.gz -C \/opt\/ws1scim<\/code><\/pre>\n\n\n\n
Adapter Configuration<\/h2>\n\n\n\n
Edit the file plugin-airwatch.json<\/code> in
installationfolder<\/code><\/p>\n\n\n\n
vi \/opt\/ws1scim\/config\/plugin-airwatch.json<\/code><\/pre>\n\n\n\n
port<\/code> to change the network port, this should the same port as defined in the
iptables<\/code> rule created earlier.<\/li>
localhostonly<\/code> to
false<\/code>, if you plan to use an external reverse proxy<\/li>
baseUrl<\/code> to the API server url defined in “Sites URL” in UEM<\/li>
tenantCode<\/code> to the dedicated API Key generated at the customer OG<\/li><\/ul>\n\n\n\n
{\n "scimgateway": {\n "scimversion": "2.0",\n "loglevel": "info",\n "localhostonly": false,\n "port": 9000,\n "auth": {\n[...file.cut...]\n },\n "endpoint": {\n "entity": {\n "undefined": {\n "baseUrl": "https:\/\/{APIServerURL}\/api",\n "username": null,\n "password": null,\n "tenantCode": "{RESTAPIKey}"\n }\n }\n }\n }<\/code><\/pre>\n\n\n\n
Persistent runtime<\/h2>\n\n\n\n
start<\/code> and
stop<\/code> NodeJS.
We are going to create a daemon file:<\/p>\n\n\n\nvi \/etc\/systemd\/system\/ws1scimadapter.service<\/code><\/pre>\n\n\n\n
Change installationfolder<\/code> to the folder created previously.<\/p>\n\n\n\n
[Unit]\nDescription=Workspace ONE UEM SCIM Adapter\nDocumentation=https:\/\/labs.vmware.com\/flings\/workspace-one-uem-scim-adapter\nAfter=network.target\n\n[Service]\nType=simple\nUser=ws1scimadapter\nRestart=on-failure\nExecStart=\/usr\/bin\/node <installationfolder>\/index.js\n\n[Install]\nWantedBy=multi-user.target<\/code><\/pre>\n\n\n\n
systemctl enable ws1scimadapter<\/code><\/pre>\n\n\n\n
systemctl start ws1scimadapter<\/code><\/pre>\n\n\n\n
Validation<\/h3>\n\n\n\n
curl -vv http:\/\/localhost:9000\/ping<\/code><\/pre>\n\n\n\n
hello<\/code> response<\/p>\n\n\n\n
user@photon-machine [ ~ ]# curl -vv http:\/\/localhost:9000\/ping\n* Trying 127.0.0.1...\n* TCP_NODELAY set\n* Connected to localhost (127.0.0.1) port 9000 (#0)\n> GET \/ping HTTP\/1.1\n> Host: localhost:9000\n> User-Agent: curl\/7.61.1\n> Accept: *\/*\n>\n< HTTP\/1.1 200 OK\n< Content-Type: text\/plain; charset=utf-8\n< Content-Length: 5\n< Date: Mon, 10 Jun 2019 12:11:58 GMT\n< Connection: keep-alive\n<\n* Connection #0 to host localhost left intact\nhello\nuser@photon-machine [ ~ ]#<\/code><\/pre>\n\n\n\n
iptables<\/code>, this test only works<\/span> if
localhostonly<\/code> is set to
false<\/code> in the
plugin-airwatch.json<\/code> file.<\/p>\n\n\n\n
curl -vv http:\/\/<ipaddess>:9000\/ping<\/code><\/pre>\n\n\n\n
Invoke-WebRequest -Uri http:\/\/<ipaddess>:9000\/ping<\/code><\/pre>\n\n\n\n
Troubleshooting<\/h3>\n\n\n\n
journalctl --unit=ws1scimadapter<\/code><\/pre>\n\n\n\n
ws1scimadapter<\/code> user can access the folders, you can use the following command to logon as the service account and navigate the folders<\/p>\n\n\n\n
su -l ws1scimadapter<\/code><\/pre>\n\n\n\n
What’s next ?<\/h2>\n\n\n\n
Secure the Adapter<\/h3>\n\n\n\n
This service need now to be exposed to the internet, however has the adapter don’t take care of certificate, it’s a HTTP service, we need to secure it with a reverse proxy, either on the machine itself or an external one.
As directory synchronization can be long, the reverse proxy should have a 60 minutes timeout as a best practice.<\/p>\n\n\n\nDirectory Configuration<\/h3>\n\n\n\n
Comment, Feedback, Bug<\/h3>\n\n\n\n