Profile Applicability:
- Level 1
Description:
This check ensures that the web app hosted in Azure App Service is using a supported version of Java. Java is a widely used programming language for building robust applications, and ensuring that the version of Java used by your app is supported helps mitigate security risks and ensures compatibility with libraries, frameworks, and tools.
Rationale:
Using an unsupported Java version can expose your application to security vulnerabilities, as older versions do not receive security patches or updates. Additionally, outdated versions of Java may not be compatible with modern libraries, frameworks, or features. Ensuring that the app uses a supported Java version helps keep the application secure and functional.
Impact:
Pros:
Ensures the app runs on a secure and stable version of Java.
Reduces the risk of security vulnerabilities associated with unsupported Java versions.
Improves compatibility with modern libraries, tools, and frameworks.
Cons:
Updating Java versions may require code adjustments or testing to ensure compatibility with new language features or changes in deprecated functionality.
Some older Java-based applications may require modifications to work with newer Java versions.
Default Value:
By default, Azure App Service supports several versions of Java. However, it is up to the app owner to ensure that the latest version or a compatible version is used.
Pre-requisites:
Ensure that the app's code and dependencies are compatible with the Java version configured in Azure App Service. Verify that the app supports modern Java versions if upgrading from an older one.
Test Plan:
Using Azure Console:
Log in to the Azure portal at https://portal.azure.com.
Go to the App Services blade.
Select the app you want to review.
Under the Settings section, click on Configuration.
In the General Settings section, check the Java version used for the app.
Verify that the Java version displayed is one of the currently supported versions (e.g., Java 11, Java 8).
Using Azure CLI:
To check the Java version used by the app, run the following command:
az webapp config show --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> --query javaVersion
The output should return the Java version in use by the app. Verify that the version is supported by the Java community and Azure App Service.
Implementation Plan:
Using Azure Console:
Log in to the Azure portal at https://portal.azure.com.
Go to App Services.
Select the app for which you want to configure the Java version.
Under the Settings section, click on Configuration.
In the General Settings section, select the latest supported Java version (e.g., Java 11, Java 8).
Click Save to apply the changes.
Using Azure CLI:
To set the Java version for an app, run the following command:
az webapp config set --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> --java-version <JAVA_VERSION>
Example:
az webapp config set --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> --java-version 11
Backout Plan:
Using Azure Console:
Log in to the Azure portal at https://portal.azure.com.
Go to App Services.
Select the app for which you want to revert the Java version.
Under the Settings section, click on Configuration.
In the General Settings section, change the Java version to the previous version.
Click Save to apply the changes.
Using Azure CLI:
To revert the Java version, run the following command:
az webapp config set --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> --java-version <PREVIOUS_JAVA_VERSION>
Example:
az webapp config set --resource-group <RESOURCE_GROUP_NAME> --name <APP_NAME> --java-version 8