Repository for the SecArchUnit master's thesis at Software Engineering.
The ArchUnit extension can be found in this separate repository: SecArchUnit/ArchUnit
The thesis report (both the LaTeX workspace and the compiled PDF) is synced nightly in the thesis branch.
- Java 11
- Maven (to build SecArchUnit)
- Gradle (to build our fork of ArchUnit)
- Open the relevant test project in your IDE
- Run the SecurityTest class (constraints 1-5) as a JUnit test
- Run the ExtensionTest class (constraints 6-7) as a JUnit test
- SonarQube (tested on version 8.2.0.32929)
- sonar-scanner (tested on version 4.2.0.1873)
- Download the latest version of SonarQube Community Edition
- Extract it to a directory of your choice
- Set the environment variable SONARQUBE_HOME to the location of the extracted directory
- Find the directory for your OS under
$SONARQUBE_HOME/bin
and add it to your PATH - Start SonarQube by executing the command:
StartSonar
(Windows) orsonar.sh
(Linux/MacOS) - Open SonarQube in your browser: http://localhost:9000
- Log in with default credentials admin:admin
- Download the latest version of SonarScanner
- Extract it to a directory of your choice
- Add
<extracted directory>/bin
to your PATH
- Go to the directory of the relevant test project, e.g.
SecArchUnit/Validation/jpetstore
- Copy
sonarcustomrules-1.0-SNAPSHOT.jar
to$SONARQUBE_HOME/extensions/plugins
- Restart SonarQube to load the plugin
- Set up the project in SonarQube
- Open SonarQube in your browser: http://localhost:9000
- Create a new project
- Set projectKey so that it matches the one in
sonar-project.properties
for your test project
- Set projectKey so that it matches the one in
- Create a new quality profile for the project
- Activate the applicable rules under the secarchunit tag
- Assign the newly created quality profile to the project
- Open a terminal in the project directory and run:
sonar-scanner
- See constraint violations in the SonarQube frontend
- PMD (tested on version 6.23.0)
- Download the latest version of PMD
- Extract it to a directory of your choice
- Set the environment variable PMD_HOME to the location of the extracted directory
- Add the directory
$PMD_HOME/bin
to your PATH
- Go to the directory of the relevant test project, e.g.
SecArchUnit/Validation/jpetstore
- Copy
pmd-custom-rules-1.0-SNAPSHOT.jar
to$PMD_HOME/lib
- Extract annotations from the system:
./pmd-dump-annotations.sh
- This creates text files that describe the locations of all the
@UserInput
and@InputValidation
annotations
- This creates text files that describe the locations of all the
- Validate the constraints:
./pmd-test.sh