Creating a Bitbucket Server Configuration Source Provider

Create a configuration source provider in Resource Manager from Bitbucket Server.

Before You Begin

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

Private server
Public server
Access token
  • Permissions to clone the repository and read the server information
  • Stored as a secret in a vault that you can access (through policies) when creating the configuration source provider

Creating a Certificate

Create a server certificate, certificate chain, and private key for a private Bitbucket server.

  1. Note the passphrase to use for creating the certificate.
  2. Connect to your private compute instance.
  3. Create the server certificate.

    For example, use 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.

    Example commands, using vi for file creation (you can alternatively use touch):

    sudo openssl genrsa -des3 -out myCA.key 2048
    sudo openssl req -x509 -new -nodes -key myCA.key -sha256 -days 1825 -out myCA.pem
    sudo openssl genrsa -des3 -out <key-name>.key 2048 
    sudo openssl req -new -key <key-name>.key -out <key-name>.csr
    sudo vi ./<file-name> 
    sudo openssl x509 -req -in <key-name>.csr -CA myCA.pem -CAkey myCA.key -CAcreateserial -out rms<key-name>.crt -days 825 -sha256 -extfile <key-name>.ext
    cat <key-name>.crt
    cat myCA.pem
    sudo touch cert_chain.crt
  4. Create the certificate chain (cert_chain.crt):
    1. Copy the contents of <key-name>.crt to the top of cert_chain.crt.
    2. Underneath, copy the contents of myCA.pem.
      The root certificate (.pem contents) must follow the individual certificate (.crt contents).
    3. Save the file.
  5. Create the private key (<key-name>.npass.key) by running the following OpenSSL command:
    sudo openssl rsa -in <key-name>.key -out <key-name>.npass.key

Importing an Existing Certificate

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

For more information about the Certificates service, see Certificates.

  1. Note the passphrase and the locations of the certificate chain, server certificate, and 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.