Creating a GitLab Configuration Source Provider

Create a configuration source provider in Resource Manager from GitLab.

Before You Begin

Following are the prerequisites to connect Oracle Cloud Infrastructure Resource Manager to GitLab.

  • Private Git server: Network information is required to set up a private endpoint for use with the configuration source provider, including an SSL certificate. For more information, see Private Git Server.
  • Public Git server: This server must be accessible over the internet using a public IP address. (This accessibility requirement doesn't apply to GitLab.com.)
  • Resolvable URL: Ensure that Resource Manager can resolve the server URL. Ensure that the server is deployed with a well-known root certificate, such as DigiCert, so that OCI can trust its endpoint.
  • Network configuration for IP addresses: Configure your network to allow access from OCI IP address ranges. Ensure that you include ranges for all relevant services, including the Oracle Services Network (tag: OSN).
  • Ingress rules: Enable network ingress rules on the VCN where the server is deployed to allow access from OCI IP addresses.
  • Repository permissions: You must have admin or owner permissions for the repository.
  • Personal access token (PAT): You must have a PAT to the server. To create a PAT, see the relevant guidance and documentation:
    Note

    Resource Manager reads the customer's repository content but doesn't push changes to the repository.

Importing an Existing Certificate

To access a private GitLab server, make its associated SSL certificate available in the Oracle Cloud Infrastructure Certificates service.

For more information about the Certificates service, see Certificates.

After the certificate is in the Certificates service, you can select it along with a private endpoint when you create the configuration source provider.

  1. Get the certificate information for your private Git server.
    1. Install the OpenSSL command line application.

      For Linux, run: sudo yum install openssl

      For MacOS, run: brew install openssl

      For Windows, download the openssl binary from Win32/Win64 OpenSSL and configure the environment.

    2. Get the certificate chain.

      Run the following command, replacing $SERVERNAME with the server URL and $PORT with the server's TCP port:

      openssl s_client -connect $SERVERNAME:$PORT -servername $SERVERNAME -showcerts 2>&1 < /dev/null | sed -n '/-----BEGIN/,/-----END/p' > certChain.pem
    3. Get the server certificate.

      Run the following command, replacing $SERVERNAME with the server URL and $PORT with the server's TCP port:

      echo -n | openssl s_client -connect $SERVERNAME:$PORT -servername $SERVERNAME | openssl x509 > $SERVERNAME.pem
    4. Get the private key.

      Example source of private key from NGINX Gitlab Server (/etc/gitlab/gitlab.rb):

      nginx['ssl_certificate_key'] = <Path_to_PRIVATE_KEY>
  2. Import the certificate.

    See Importing a Certificate.

    After the certificate is in the Certificates service, you can select it along with a private endpoint when you create the configuration source provider.