Pentesting magnolia
Preparations
For a basic understanding of the CMS I will be deploying a basic setup of the Magnolia application. For that I will follow this setup of Magnolia using Azure App Service: http://www.royal-technology.net/deploying-magnolia-using-azure-app-service.html
Prerrequisites
Having azure cli:
Checked. Otherwise go to https://learn.microsoft.com/en-us/cli/azure/get-started-with-azure-cli
Have maven installed.
First I create my virtual environment in a specific folder for this project. Then, you enter the folder.
Now we create a maven project: https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
Under this directory you will notice the following standard project structure.
The src/main/java
directory contains the project source code, the src/test/java
directory contains the test source, and the pom.xml
file is the project's Project Object Model, or POM.
Now, we login into Azure
This will take you to a MFA signing-in process.
Having Maven Plugin for Azure App Service. This takes me to install these plugins provided by Microsoft: https://github.com/microsoft/azure-maven-plugins/tree/develop/azure-webapp-maven-plugin
After that, clon the repo out of your project folder
Then I entered the folder:
Once you are set, go to the folder of your maven project and run:
You will be asked the following:
To deploy the app:
Some troubleshooting will make you change things such as source and target of the application.
Response, a lot of verbose code and:
Installing Visual Studio Code with the following extensions: - Maven for JAVA from Microsoft - Extension Pack for JAVA from Microsoft - Azure App Service Extension by Microsoft: App Service is Azure's fully-managed Platform as a Service (PaaS) that lets you deploy and scale web, mobile, and API apps. Use the Azure App Service extension for VS Code to quickly create, manage, and deploy your websites. Wiki: https://github.com/Microsoft/vscode-azureappservice/wiki - Azure CLI Tools: Scrapbooks for developing and running commands with the Azure CLI.
Create a service principal
Service principals are dedicated Azure accounts for automated tools providing an account without administrator privileges. Using a service principal is more secure than using a regular user account. To enable Maven to deploy the Magnolia project on Azure, create a service principal with password-based authentication:
https://learn.microsoft.com/en-us/entra/msal/java/build/maven
Building with Maven
To be able to build with maven, you need a working installation of Java and Maven.
Once you have successfully installed Java and Maven, clone the microsoft-authentication-library-for-java repository.
From you shell or command line:
$ git clone https://github.com/AzureAD/microsoft-authentication-library-for-java.git
$ cd microsoft-authentication-library-for-java
Then run:
mvn clean
mvn package
You should now have a "target" directory with msal4j-x.x.x.jar
.
To install, run:
mvn install -DskipITs