VCS Proxy
VCS Proxy to connect to customer's VCS in private networks.
The Resourcely VCS Proxy provides secure access to Version Control System (VCS) APIs, such as GitHub and GitLab, within private networks. It establishes a secure ngrok tunnel to the Resourcely infrastructure, enabling seamless communication between Resourcely and your internal VCS without exposing these systems to the public internet. This setup ensures that Resourcely can interact with on-premise VCS environments while maintaining robust security and privacy.
How does it work?
The proxy is a very shallow wrapper around the Ngrok agent. At startup, it connects to a specific Ngrok https edge, listens for incoming requests from the Resourcely backend, and proxies those requests to the VCS (eg GitHub/GiLab) endpoints. Thus, the Proxy does not need to accept ingress traffic.
Security Benefits
This proxy only forwards requests to the environment values of RESOURCELY_VCS_API_SERVER
and RESOURCELY_VCS_WEB_SERVER
. This allows you to restrict the containers egress traffic to only allow access to your VCS instances.
Additionally, we use a custom egress domain (tunnel.<region>.proxy.resourcely.io
) for establishing the tunnel between this container and ngrok. Because of this, instead of your firewall needing to allow egress to a generic ngrok domain, you can use this Resourcely specific domain. Doing this ensures that only Resourcely owned ngrok edges can be accessed from within your firewall.
Authentication?
Authentication is required both ways. The Ngrok edge network will authenticate requests coming from Resourcely before relaying them to this Proxy. Likewise, the edge network requires this proxy to provide a valid auth token to connect and listen for incoming requests.
Setup?
The Proxy is intended to be run in a Docker container that is allowed to reach out and connect to the Ngrok edge network. Thus traffic egress must be allowed, but ingress is not needed.
The Proxy uses the following variables in the environment (can be fed to the Docker container):
Required
RESOURCELY_VCS_PROVIDER
: Which VCS is the proxy destination: eg: gitlab, githubRESOURCELY_NGROK_EDGE
: Label of the ngrok edge to connect to. Same as the edge= value in the ngrok agent tunnel command: ngrok tunnel --label edge=edghts_1 https://github.acme.comRESOURCELY_NGROK_TOKEN
: Token used by the ngrok agent to authenticate with ngrok edgeRESOURCELY_VCS_API_SERVER
: Origin server at which the VCS API can be accessed including the scheme. eg https://api.github.comRESOURCELY_VCS_WEB_SERVER
: Origin server at which repositories can be accessed in a browser from the VCS including the scheme. eg https://github.com
Optional
RESOURCELY_EGRESS_REGION
: The region that this container will use to tunnel to ngrok's proxy. Must be one of: [in,us,us-cal-1,eu,au,ap,jp]. Defaults tous
Configure VCS Proxy
To ensure that you onboard smoothly on the proxy, you need to make sure the following is true:
You can run our VCS-proxy container and allow egress traffic to the Ngrok proxy domain
tunnel.<region>.
proxy.resourcely.io
, and valid values for region are[in,us,us-cal-1,eu,au,ap,jp]
on port 443 .You have VCS admin permissions as some administrative actions are needed, such as creating a VCS app and webhook.
Your Self-hosted VCS webhooks can reach our API
api.resourcely.io
over port 443.
1. Running the Proxy
Option 1: Kubernetes
Option 2: docker-compose.yml
You can use docker-compose.yml
to run the container with the required environment variables and configurations, similar to what’s specified in the Kubernetes deployment.yaml
file:
Replace the placeholders in angle brackets (<...>
) with your actual values.
Running the Container
To start the container, use the following command in the directory where your docker-compose.yml
is located:
Or, if you prefer to run it directly using docker run
without docker-compose
:
2. Create and install Resourcely App
Gitlab Setup
Step 1: GitLab OAuth application
Resourcely needs a GitLab OAuth application so users can authorize us to open PRs and browse repos. The application should be named “Resourcely” and have the settings in the image below
You can create the application quickly using the following cURL command:
Example Response (Resourcely will need this info):
Please save the response and share it with Resourcely using secret sharing tool.
Resourcely will complete Step 1 onboarding using information above before proceeding
Step 2: Install the App from the UI
Connect with Gitlab and follow instructions here https://docs.resourcely.io/resourcely-terms/settings/change-management/gitlab
Github Setup
Step 1: Github application
Resourcly needs a Github application so users can authorize us to open PRs and browse repos.
Navigate to this link (please substitute GITHUB_URL and GITHUB_ORG)
Choose “Only on this account”
Click “Create Github App”
On next screen, copy your App ID, Client ID, and Client Secret (click Generate a new client secret)
At the bottom of the screen, generate a private key, it will download a .pem file - to get the base64 value of the .pem file, find where the file was downloaded and run
Please save the response and share it with Resourcely using secret sharing tool.
Resourcely will complete Step 1 onboarding using information above before proceeding
Step 2: Install the oAuth App via CURL command
Get Resourcely Token JWT token from browser https://portal.resourcely.io/
Replace
token
andgithub_host
Navigate to the installation URL in the response of the request above and follow installation flow.
Then you will get kicked back to step 2 of the change management onboarding flow where you can create a Webhook.
Last updated