-
Notifications
You must be signed in to change notification settings - Fork 2
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
15 changed files
with
345 additions
and
702 deletions.
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 |
---|---|---|
|
@@ -27,7 +27,7 @@ RUN echo "${CAS_PLUGIN_JAR_SHA256} *${BUILDER_HOME}/sonar-cas-plugin-${CAS_PLUGI | |
FROM BASE | ||
|
||
LABEL NAME="official/sonar" \ | ||
VERSION="9.9.1-3" \ | ||
VERSION="9.9.1-4" \ | ||
maintainer="[email protected]" | ||
|
||
RUN set -eux \ | ||
|
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,10 @@ | ||
# Globale Berechtigungen | ||
|
||
Neben den projektbezogenen Berechtigungen (siehe [permission_template](permission_template_de.md)) existieren die | ||
globalen Berechtigungen, welche zum Start des Dogus eingerichtet werden. | ||
|
||
Die Admin-Gruppe des Cloudogu EcoSystems erhält dabei generell die folgenden Berechtigungen: | ||
- admin | ||
- profileadmin | ||
- gateadmin | ||
- provisioning |
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 @@ | ||
# Permission template | ||
|
||
„Permission Templates“ sind ein Mechanismus von SonarQube, um Vorlagen für Projektberechtigungen zu erstellen. Die | ||
Admin-Gruppe des Cloudogu EcoSystems wird der Standardvorlage („Default Template“) beim Start des Dogus automatisch | ||
hinzugefügt, um sicherzustellen, dass Nutzer mit der Admin-Gruppe die nötigen Berechtigungen auf allen Projekten besitzen. | ||
|
||
Die Admin-Gruppe des Cloudogu EcoSystems wird dabei mit folgenden Berechtigungen hinzugefügt: | ||
- admin | ||
- codeviewer | ||
- issueadmin | ||
- securityhotspotadmin | ||
- scan | ||
- user | ||
|
||
Die Einstellungen können unter `Administration -> Security -> Permisssion Templates` überprüft werden. | ||
*siehe setup.json für weitere Informationen* | ||
|
||
# Korrektur von falsch konfigurierten Projekten | ||
|
||
Neue Projekte, die mit der Standardvorlage angelegt wurden, mit der die Admin-Gruppe nicht verknüpft war, können | ||
nachträglich korrigiert werden. | ||
|
||
Dazu sind folgende Schritte durchzuführen: | ||
- Konfigurationsschlüssel `/config/sonar/amend_projects_with_ces_admin_permissions` auf den Wert `all` setzen | ||
- Dogu neu starten z.B. mittels `cesapp restart sonar` | ||
- Dies sorgt dafür, dass die Admin-Gruppe allen Projekten mit den nötigen Berechtigungen hinzugefügt wird. | ||
- Nach erfolgreicher Korrektur der Berechtigungen wird der Konfigurationsschlüssel auf den Wert `none` gesetzt. | ||
|
||
*siehe Beschreibung `configuration` in der Datei `dogu.json` für weitere Informationen* | ||
|
||
Die Gruppe wird mittels API-Endpunkt `permissions/add_group` hinzugefügt. |
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
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,30 @@ | ||
import java.util.Base64; | ||
import javax.crypto.SecretKeyFactory; | ||
import javax.crypto.spec.PBEKeySpec; | ||
|
||
public class PasswordHasher { | ||
private static final int KEY_LEN = 512; | ||
private static final int HASH_ITERATIONS = 100_000; | ||
private static final int PARAM_SALT_INDEX = 0; | ||
private static final int PARAM_PASSWORD_INDEX = 1; | ||
|
||
public static void main(String[] args) { | ||
var saltStr = args[PARAM_SALT_INDEX]; | ||
var password = args[PARAM_PASSWORD_INDEX]; | ||
byte[] salt = Base64.getDecoder().decode(saltStr); | ||
var hashedPassword = hash(salt, password, HASH_ITERATIONS); | ||
hashedPassword = String.format("%d$%s", HASH_ITERATIONS, hashedPassword); | ||
System.out.print(hashedPassword); | ||
} | ||
|
||
private static String hash(byte[] salt, String password, int iterations) { | ||
try { | ||
SecretKeyFactory skf = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512"); | ||
PBEKeySpec spec = new PBEKeySpec(password.toCharArray(), salt, iterations, KEY_LEN); | ||
byte[] hash = skf.generateSecret(spec).getEncoded(); | ||
return Base64.getEncoder().encodeToString(hash); | ||
} catch (Exception e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.