I am trying to configure SAST through SonarQube and have added the required pipeline configuration, but the GitLab Runner is throwing an error saying, “SonarQube Server is unable to connect.”
SonarQube is running on AWS ECS. I have reviewed all inbound and outbound traffic rules in the security group and NACL, and they are configured correctly. The SonarQube token and host configuration URL are also set up correctly.
Do you have any suggestions on how to resolve this connectivity issue with the GitLab Runner to run SAST successfully?
Error details:
.gitlab-ci.yml
Configuration
stage: test
only:
refs:
- dev
# dependencies:
# # - get-binaries
# - build
image: maven:3-eclipse-temurin-17
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar" # Defines the location of the analysis task cache
GIT_DEPTH: "0" # Tells git to fetch all the branches of the project, required by the analysis task
cache:
policy: pull
key: "${CI_COMMIT_SHORT_SHA}"
paths:
- sonar-scanner/
script:
- mvn verify sonar:sonar -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.login=$SONAR_TOKEN
interruptible: true
allow_failure: true
Versions
Gitlab Versions:
GitLab.com SaaS