IQ Server Configuration

IQ Server Configuration

The IQ Server configuration options let you enable or disable SCM integration features. The setup includes the following parts:

You can use Secure Shell (SSH) for Git operations such as cloning, fetching, and pushing.

The term pull request is equivalent to merge request in GitLab terminology.

Prerequisites

An access token for any of the following Source Control Management (SCM) Systems:

IQ Server Configuration

Base URL Configuration

Base URL Configuration in IQ Server Version 138 and Later

The Base URL is set using the Rest API.

Example:

curl -u admin:admin123 -X PUT -H "Content-Type: application/json" -d '{"baseUrl": "http://127.0.0.1:8070"}' http://localhost:8070/api/v2/config

Base URL Configuration in IQ Server Version 137 and Earlier

Uncomment the BaseURL parameter in your config.yml

Example

baseUrl: http://nexus-iq-server.example.com/

Git Client Configuration

Git Client configuration is optional but recommended. Sonatype IQ Server includes JGit, a Java-based Git implementation that supports all SCM features without external software.

JGit does not support two git clone features that can improve performance: shallow clone and sparse checkout. Shallow clone lets us clone the least amount of git history. Sparse checkout lets us only check out the files we need. These two git clone features improve performance with large disk-space savings and reduced network traffic.

When the IQ Server uses Native Git, it supports shallow clones and sparse checkouts without additional configuration.

Tip

If a native Git client is installed and available on the system path, IQ will prefer it over JGit. This behaviour can be overridden.

Sonatype IQ Server uses git's repository clone feature for the following:

Note

Native Git is required in order to use SSH for Git operations.

Set Git Client in IQ Server

Use the Source Control Configuration REST API.

For prior versions, specify the gitImplementation and gitExecutable in your config file:

sourceControl:
  gitImplementation: java
  gitExecutable: /usr/bin/git

Minimum Git Client Version

GPG Commit Signing Configuration

GPG (GNU Privacy Guard) commit signing allows IQ Server to cryptographically sign commits created during automated remediation and pull-request creation.

This ensures commit authenticity and enables the Verified badge on commits in your Source Control Management (SCM) system.

Prerequisites:

  1. Configure the GPG Agent

To enable automated passphrase handling, configure the GPG agent:

mkdir -p ~/.gnupg
echo "allow-preset-passphrase" >> ~/.gnupg/gpg-agent.conf
gpgconf --kill gpg-agent

The agent restarts automatically on the next GPG operation.

  1. Generate the Key Pair

Run:

gpg --full-generate-key

Suggested values (adapt as needed):

Prompt Recommendation
Key type RSA and RSA
Key size 4096 bits
Expiration Based on policy (e.g. 2 years or no expiration)
Real name Nexus IQ Server or automation account name
Email address Must match commitEmail in IQ Server
Comment Optional (“Automated commit signing”)
Passphrase Optional (but recommended for security)
  1. List and Export Your GPG Key
gpg --list-secret-keys --keyid-format=long

Example output:

sec   rsa4096/ABCD123456789012 2025-01-15 [SC] [expires: 2027-01-15]
         1234567890ABCDEF1234567890ABCDEF12345678
uid           [ultimate] Nexus IQ Server <nexus-iq@yourcompany.com>
ssb   rsa4096/9876543210FEDCBA 2025-01-15 [E] [expires: 2027-01-15]

Here the key ID is ABCD123456789012.

  1. Configure GPG in IQ Server

Use the Source Control Configuration REST API to set the GPG signing properties.

curl -u admin:admin123 -X PUT \
     -H "Content-Type: application/json" \
     -d '{
       "commitEmail": "nexus-iq@yourcompany.com",
       "gpgSigningKey": "ABCD123456789012",
       "gpgPassphrase": "your-secure-passphrase"
     }' \
     http://localhost:8070/api/v2/config/sourceControl

Note

  1. Configure GPG in Your SCM System

After configuring GPG in IQ Server, you need to add the public GPG key to your SCM system to verify signed commits.

Export your public key using the following command:

gpg --armor --export ABCD123456789012

Copy the entire output, including the lines:

   -----BEGIN PGP PUBLIC KEY BLOCK-----
...
   -----END PGP PUBLIC KEY BLOCK-----

Add the copied key to your SCM system as described below.

GitHub

GitLab

Bitbucket (Server or Cloud)

Azure DevOps

  1. Verifying GPG Signing

After configuration:

Configure IQ Server With Your SCM System

Configuring Sonatype IQ Server with a Source Control Management (SCM) system requires the Edit IQ elements permission.

  1. Log in to Sonatype IQ Server.

  2. Select Orgs and Policies.

  3. Navigate to the Root Organization.

  4. Scroll to Source Control Configuration.

  5. Click the button under Configuration to open the settings for your SCM.

  6. Select your Source Control Management System.

  7. Enter your access token. This will be used as the default access token for all organizations.

    Note Make sure your token includes the minimum required scopes for your SCM (for example, repo read/write on GitHub, Code & Pull requests on Bitbucket). For a detailed list of provider-specific permissions, see Create an Access Token.

  8. Enter your Default Branch (defaults to master)

  9. Enable or disable Use SSH for Git operations.

    1. Disabled by default
    2. Requires native Git
  10. Enable or disable Automated Remediation with GoldenPRs™. Automated Remediation with GoldenPRs™ automatically generates pull requests with remediation suggestions for policy violations found on the default branch. It helps keep dependencies secure and up to date by recommending safe, non-breaking versions, reducing manual remediation effort.

    1. This option is disabled by default. It must be enabled in order to use the Automated Pull Requests feature

These settings apply only to automated remediation pull requests (Auto PRs). - Close AutoPRs when one or more required checks fail: Pull requests often include one or more mandatory checks that run on each commit. If any of these required checks fail, the Auto PR closes automatically. This prevents failing pull requests from remaining open unnecessarily. Available for Github and Gitlab repositories. - Close AutoPRs that haven’t been merged or closed after: Sometimes, pull requests remain open for a long time without being merged or closed manually. This option lets you configure Auto PRs to close automatically after a specified number of days. It helps keep your repository clean by removing stale pull requests. Available for all supported SCM providers (GitHub, GitLab, Azure DevOps, Bitbucket Cloud and Bitbucket Data Center). 11. Enable or disable Pull Request Commenting. 1. Enabled by default. It must be enabled in order to use the Pull Request Commenting feature. 12. Enable or disable Source Control Evaluations. 1. Enabled by default. Must be enabled to use the feature that includes evaluating the repository or pull requests 13. Enable or disable Automated Commit Feedback. 1. Enabled by default. Must be enabled to allow the creation of commit statuses based on source control evaluation results. 14. Enable or disable Manual Pull Requests. 1. Enabled by default. When suggested version updates are available, displays an option to manually create a pull request targeting the default branch. 15. Click the Create or Update button.

All Source control configuration options can be overwritten at the organization and application levels. This allows you to use multiple SCM providers and access tokens with IQ Server.

Application Source Control Configuration

An application is configured like an organization with an additional field: Repository Clone URL.

Enter a valid HTTP(S) URL for the Repository Clone URL field.

This URL is used to connect to your SCM. All SCM features use the SCM's REST APIs behind the scenes.

Note

Changing the Repository Clone URL resets the existing source control data for the application. This action cannot be undone.

Resetting the Repository Clone URL results in:

Note

If you want to enable SSH, check SSH for Git operations.

Automatic SCM Configuration

With Automatic SCM Configuration turned on, the repository URL will be automatically discovered from the Git project information and configured for the IQ application. Enable Automatic SCM Configuration via the configuration menu in the toolbar.

See the Automatic SCM Configuration page for more information.

Testing the Configuration

To test the configuration:

  1. Navigate to an application with SCM Configured (it can inherit from a parent organization).
  2. Select Source Control Configuration.
  3. Click Test Configuration.

Note

Testing the SCM Configuration is only available at the Application Level.

The 'Test Configuration' button is available once any changes have been saved with the 'Update' button.

There are three checks that are run:

SSH for Git Operations

SSH can be used for Git operations such as clone, fetch, and push. To enable SSH, select the option Use SSH for Git Operations in the configuration screen.

On Root Organization:

On a Child Organization or an Application:

SSH requires native Git and a properly configured SSH key that is available to IQ. Configuring an SSH key is beyond the scope of this help document. Please consult your security or operations team.

Some important notes