This repository was archived by the owner on May 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
160 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
version: "2" | ||
|
||
services: | ||
sonarqube-server: | ||
build: | ||
context: . | ||
dockerfile: docker/Dockerfile.sonarqube | ||
networks: | ||
- sonarqube-network | ||
ports: | ||
- "9000:9000" | ||
environment: | ||
- SONARQUBE_WEB_JVM_OPTS=-Djavax.net.ssl.keyStore=/root/keystore -Djavax.net.ssl.keyStorePassword=changeit | ||
|
||
ldap-server: | ||
build: | ||
context: . | ||
dockerfile: docker/Dockerfile.ldap | ||
networks: | ||
- sonarqube-network | ||
environment: | ||
- HOSTNAME=ldap-server | ||
- LDAP_TLS_CRT_FILENAME=my-cert.crt | ||
- LDAP_TLS_KEY_FILENAME=my-cert.key | ||
- LDAP_TLS_CA_CRT_FILENAME=my-ca.crt | ||
- LDAP_TLS_ENFORCE=true | ||
- LDAP_TLS_VERIFY_CLIENT=demand | ||
|
||
networks: | ||
sonarqube-network: | ||
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/certs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
FROM osixia/openldap | ||
|
||
COPY docker/tester.ldif /container/service/slapd/assets/config/bootstrap/ldif/tester.ldif | ||
|
||
COPY docker/certs/server.crt /container/service/slapd/assets/certs/my-cert.crt | ||
COPY docker/certs/server.key /container/service/slapd/assets/certs/my-cert.key | ||
COPY docker/certs/ca.crt /container/service/slapd/assets/certs/my-ca.crt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM sonarqube:lts-alpine | ||
|
||
COPY docker/sonar.properties /opt/sonarqube/conf/sonar.properties | ||
COPY sonar-ldap-plugin/target/sonar-ldap-plugin-*-SNAPSHOT.jar /opt/sonarqube/extensions/plugins/ | ||
|
||
COPY docker/certs/ca.crt /root/ca.crt | ||
COPY docker/certs/client.p12 /root/client.p12 | ||
|
||
RUN keytool -import -trustcacerts -alias my-ca -file /root/ca.crt -keystore /etc/ssl/certs/java/cacerts -storepass changeit -noprompt | ||
|
||
RUN keytool -importkeystore \ | ||
-deststorepass changeit -destkeypass changeit -destkeystore /root/keystore \ | ||
-srckeystore /root/client.p12 -srcstoretype PKCS12 -srcstorepass pass | ||
|
||
RUN keytool -list -v -keystore /root/keystore -storepass changeit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
cd docker | ||
mkdir certs | ||
cd certs | ||
|
||
openssl genrsa -out ca.key 4096 | ||
openssl req -x509 -new -nodes -key ca.key -days 9131 -out ca.crt -subj "/C=CH/ST=Geneva/L=Geneva/O=Example/CN=example.org" | ||
|
||
openssl genrsa -out server.key 4096 | ||
openssl req -new -key server.key -out server.csr -subj "/C=CH/ST=Geneva/L=Geneva/O=Example/CN=ldap-server" | ||
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt -days 9131 | ||
|
||
openssl genrsa -out client.key 4096 | ||
openssl req -new -key client.key -out client.csr -subj "/C=CH/ST=Geneva/L=Geneva/O=Example/CN=sonarqube-server" | ||
openssl x509 -req -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out client.crt -days 9131 | ||
|
||
cat client.crt ca.crt > cert-chain.txt | ||
openssl pkcs12 -export -inkey client.key -in cert-chain.txt -out client.p12 -password pass:pass | ||
rm cert-chain.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# LDAP configuration | ||
|
||
# General Configuration | ||
sonar.security.realm=LDAP | ||
|
||
ldap.url=ldap://ldap-server:389 | ||
ldap.StartTLS=true | ||
|
||
ldap.bindDn=cn=admin,dc=example,dc=org | ||
ldap.bindPassword=admin | ||
|
||
# User Configuration | ||
ldap.user.baseDn=dc=example,dc=org | ||
ldap.user.request=(&(objectClass=inetOrgPerson)(uid={login})) | ||
ldap.user.realNameAttribute=cn | ||
ldap.user.emailAttribute=mail | ||
|
||
# Group Configuration | ||
#ldap.group.baseDn=ou=groups,dc=example,dc=org | ||
#ldap.group.request=(&(objectClass=posixGroup)(memberUid={uid})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
dn: uid=tester,dc=example,dc=org | ||
changetype: add | ||
uid: tester | ||
cn: Tester | ||
sn: Tester | ||
objectClass: top | ||
objectClass: inetOrgPerson | ||
userPassword: test | ||
mail: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters