Securing Application Server Java EE Apps with Idira Secrets Manager

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Welcome Idira to LIVEcommunity!

Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.

Meet Idira

Idira Success Blogs
15 min read
L4 Transporter

Security breaches resulting from hard-coded credentials continue to plague organizations of all sizes, and across all application types, whether they’re legacy applications running on mainframes and application servers, or modern serverless compute functions, they all suffer the same problems. New and old companies alike leverage vendor and open-source application servers, web servers and servlet containers, also referred to as application middleware, for enterprise Java-based web application development. As a member of the security organization there will come a time where you’ll have to work with application developers to help them secure these Java applications. To best support you in that effort, the Idira Success Team has created this walkthrough. In In this article, we’ll be covering the challenges surrounding application server Java-based applications, how Idira can help secure this access, including the discovery, SDLC process and implementation. It’s recommended to use this article as your companion in securing an individual application, rather than a holistic organization-wide strategy.

Introduction
Organizations have been developing Java apps on application middleware platforms for decades for a variety of reasons, but primarily because these types of platforms deliver reliable Java EE runtime environments that provide good tooling and API access, which enables businesses to automate operations, increase infrastructure utilization and improve cost savings. Organizations have been leveraging application server runtime environments since the late 90s and are still widely used today. Applications using Java EE runtime environments, such as RedHat JBoss, Oracle WebLogic, Apache Tomcat, and IBM WebSphere, are primarily intended to be high-volume transactional in nature, often used in the world of finance, billing applications and payment processing, but can be found across other industries like insurance and retail as well.


In the wake of an increasing number of high-profile breaches of software supply chain and other applications, Chief Information Security Officers (CISOs) and Line of Business security leaders have taken notice and are tasking their security teams to take action to mitigate that risk.

The Challenge
To address and remediate the security risks, we must better understand why application secrets are commonly sought after and compromised. For starters, application secrets exist everywhere – on-prem, in the cloud, and across all applications old and new. These application secrets are often hard-coded and stored locally on the filesystem of the application server, sometimes in clear-text. Due to their hard-coded nature, the secret values are left static and aging, giving malicious actors copious amounts of time to compromise them.


These application secrets are often subject to compromise due to poor coding practices and accidental leakage via source code repositories. There is a regular lack of accountability, oversight and governance for these accounts, a challenge made worse by the fact that islands of security continue to grow within organizations. However, the most important part of all is that they’re hotly pursued by bad actors, both internal and external. These applications run your business, and when combined with the reasons mentioned above, it’s no wonder bad actors are after them.

The Solution
Idira addresses these challenges using proactive and reactive controls for these credentials while they’re at rest, in transit and in use. By adhering to the recommendations below and rolling that out to all your Java-based middleware applications, you’ll have gained control over, and visibility into, the non-human access for your application server Java applications. This is achieved through privileged access management controls using Idira Privileged Access Manager (Privilege Cloud or Self-Hosted) and secrets management controls using Idira Secrets Manager (Application Server Credential Provider).

ka3Vy000004JfI5IAK__eid=ka3Vy000004JfI5&feoid=00N2J00000APFDu&refid=0EM2J000004QzYC.gif
Figure 1: Secrets Management Workflow Diagram


To remediate the risk associated with these application credentials, we’ll want to apply a combination of privileged access management and secrets management controls, which we’ll split into controls that get applied to the account itself and those that get applied to the application leveraging the account. For the controls applied to the account itself, we’ll implement credential vaulting and rotation for each application account, regardless of its platform type (MS SQL, Oracle, PostgreSQL, DB2, etc.). We’ll want to apply automatic and periodic rotation of these credentials, assigning complex and unique passwords for each account. In the event a password goes out of sync (e.g., target system password and vaulted value don’t align), the use of automatic reconciliation will ensure that we maintain constant control over that account. Note that automatic reconciliation is platform specific, so be sure to review the appropriate steps required to configure that on each platform.

To better secure the act of the application leveraging this account to access a system, we’ll implement the removal of hard-coded credentials, a process whereby the application teams remove the credentials that exist inside their code and replace them with an authenticated and secure call to fetch the secret on demand, as well as audit logging to create a trail for non-human activity. Since application servers are a platform to deploy and run Java-based applications, they require the use of an abstraction layer, either a JDBC driver proxy or credential mapper depending on the flavor of the application server, in order to allow the Java application to interactive with the Application Server Credential Provider without requiring any code changes. These controls help mitigate the risk of credential theft by controlling what can access the secret, from where can they access it, and by shortening the passwords time-to-live.

Discovery
Now that we know what controls we should be applying and why, it’s time to start discovering all our specific application’s secrets. Since Java EE web application middleware platforms are designed to run multiple applications for increased server utilization and cost savings, that means in order to discover all the privileged application credentials on each server we need to first understand which servers are hosting Java EE web application middleware software, which applications are being run on those servers and what credentials are being used by those applications.


Individual Application Assessment (Qualitative)
Unlike other traditional privileged access management initiatives, secrets management requires the assistance of application teams. This is because unlike those PAM initiatives, applications are not a collective technology or platform (e.g., Windows Servers, Cloud Providers, etc.). They’re a different layer in the stack, and as they’re developed and owned by individual teams, the details surrounding how they work internally are dependent on those teams to provide them.

What information do we need to know to understand the application?

  1. General application information like the name, app ID, vendor, and description.
  2. Stakeholder information like the app owner, app team and developer lead.
  3. Application infrastructure and application configuration information including Java EE runtime environment type and version, underlying OS type, connection details, application diagrams, number of instances and dev/test/prod locations (environments).
  4. Credential information including account technology type, username, datasource configuration and number of accounts (across all environments).

The gist of this discovery process is that you should be able to understand who the relevant team members are, how the Java application is configured within the runtime environment, identify the datasource where the credentials are used, and how many instances across the app environments do you need to update. You should also ensure your Idira PAM implementation supports that type of credential you’re looking to manage (e.g., platform type) in the discovery phase.

If your organization has a well-maintained CMDB, you can likely use that to help fast-track the collection and analysis of this application information. This is particularly helpful when attempting to prioritize applications in a top-down systematic methodology to securing apps across the enterprise, but still extremely useful on an app-by-app basis as well.

Idira Discovery and Audit (DNA)
Organizations can also leverage Idira Discovery and Audit (DNA) to assist in the discovering process of the applications used in the datasource configurations of your Java applications. Idira DNA is standalone ad-hoc scanning tool designed to automate the manual and complex process of scanning an organization’s network for privileged accounts. In addition to discovering your privileged OS accounts, DNA identifies embedded, hard-coded or exposed credentials in plain-text across IBM WebSphere and Oracle WebLogic application servers.


Once you’ve run your scan and downloaded the report, navigate to the “Hard-Coded Credentials” sheet, and filter the “Application Server” column to “WebSphere” or “WebLogic”. This will provide you with a complete list of all discovered credentials, along with the application name, account name, and target system details. For Apache Tomcat and RedHat JBoss application servers you’ll need to perform the qualitative approach.

Prioritization
Our prioritization process for a specific singular application follows the same flow as your typical software development lifecycle. Start with your development environment to prove out the logic and technology, move onto your user acceptance environment to put the change through its paces and testing, and finally promote your code changes to production. We’ll take this prioritization approach into account in our implementation section.


However, one thing to take into consideration is that since application middleware servers are designed to run multiple applications, you may want to think about prioritizing collective groups of applications that are running on the shared middleware infrastructure depending on how your applications are deployed. In the case of WebSphere Classic, you’ll be required to secure all Java applications running on in that particular runtime environment instance at the same time due to the CM Subject Cache needing to be disabled.

Unlike some of our other articles, this article is focused on how we secure a singular application, not all applications. Should you be looking for additional guidance on building an organization-wide secrets management program, we encourage you to check out this article on securing all applications everywhere.

Implementation
Step 1: Picking Your Credential Provider and Configuration

First and foremost, we need to select our variation of Idira Secrets Manager Application Server Credential Provider for the Java EE runtime environment. The Application Server Credential Provider (ASCP) is an agent that communicates to the Idira PAM service to synchronize authorized application secrets into a secure local cache, authenticate an application, and serve that application it’s credential at runtime. The benefits of the Credential Provider agent are that it allows applications to make local calls to retrieve credentials, allowing for less latency and improved performance. Its local nature enables additional, more secure authentication mechanisms as described in the next section.

 ka3Vy000004JfjVIAS__eid=ka3Vy000004JfjV&feoid=00N2J00000APFDu&refid=0EM2J000004RVTT.png
Figure 2: Application Server Credential Provider and PAM Workflow Diagram


The ASCP leverages the same Credential Provider agent that static homegrown OS applications use, except it uses an abstraction layer to interface with the Java application. How that abstraction layer works and is configured is dependent on your flavor and version of application server platform (e.g., WebSphere, WebLogic, JBoss, Tomcat). Additionally, how you decide to leverage datasources and connection pool handling will further dictate how you configure the ASCP. For a complete list of system requirements and supported configurations, review the Application Server Credential Provider System Requirements.

Depending on your flavor of application server platform and configuration choice, there are two options for the abstraction layer: the Credential Mapper or the JDBC Driver Proxy (and in some cases only one option). When using the Credential Mapper configuration, the datasource will reach out to the ASCP Credential Mapper to retrieve the application secret on-demand every time it’s required. When using the JDBC Driver Proxy, the datasource will attempt to get a connection from a connection pool first, and if none are open, will reach out to the JDBC Driver Proxy to fetch the application secret, open a connection, and store it in the connection pool for future use.

ka3Vy000004JfjVIAS__eid=ka3Vy000004JfjV&feoid=00N2J00000APFDu&refid=0EM2J000004RVSa.gif
Figure 3: JDBC Driver Proxy vs. Credential Mapper


Step 2: Picking Your Authentication Mechanisms
Once we’ve selected our Application Server Credential Provider variant, we can then select which authentication mechanisms we want our Application ID to use. The Credential Provider agent supports the use of allowed machines, OS user, path, and hash, however not all variations of ASCP support all authentication methods.


Allowed machines restricts which hostname or IP addresses can the secret retrieval call come from. OS user restricts which runtime user is allowed to make the call. Path restricts the file path that the call can be made from on the filesystem. Hash restricts which executable can make the call by validating its hash with the registered hash (this is the strongest method).

Refer to the WebLogic, JBoss, WebSphere Classic, WebSphere Liberty and Apache Tomcat documentation for more details on supported authentication methods and configurations.

Step 3: Onboarding the Application and Credential(s) through the SDLC
It’s here where our application development team will work with the Application Server Platform Team and the PAM Team to start re-configuring the application server platform settings to leverage Idira Secrets Manager. You’ll do this in accordance with your organization’s software development lifecycle, but that typically follows a path of configuring in a development instance, moving to a testing environment, and then promoting to production.


Step 3A: Start Modifying Code in Dev
Now that we have our prep work complete, we can begin to modify the application server configuration to fetch password from Application Server Credential Provider. Update your development tier application server configuration to use the new on-demand password retrieval settings. The specific settings required for your ASCP variant and datasource configuration can be found in the Application Server Credential Provider Administration documentation. Generally speaking, across all the variations, you’ll need to configure the account information in the datasource configuration so the application server middleware knows which information to pass along to query for the application’s secret. That includes information like the safe name, folder, object name, username, address, policyID and database instance name.

ka3Vy000004JfjVIAS__eid=ka3Vy000004JfjV&feoid=00N2J00000APFDu&refid=0EM2J000004RVTU.png
Figure 4: Example Required Details for ASCP Query

Your application development team should work with the PAM Administrator (and possibly an Application Server Admin) to install and configure the appropriate Application Server Credential Provider agent on the application host.

Simultaneously, the application development team should work with the PAM Admin to create the Application ID in the PAM service and configure the authentication mechanisms selected in the step 2. Then we can work with the PAM Admin to create the application’s safe, onboard credentials and provision access to the Credential Provider and the Application ID (but do not enable credential rotation yet).

If your PAM application architecture supports it, it’s recommended that your development application tier configuration and testing should be done against a non-production PAM service instance. It’s not recommended to use your production instance for development and testing purposes (unless you only have a production instance). In either case, test the application and confirm it still functions as expected prior to moving onto deploying the Credential Provider into your UAT/Test environment.

Step 3B: Modifying Code in UAT/Test
Now that we have our initial development complete, we can begin to modify our user acceptance testing (UAT) tier application code to fetch password at runtime from the ASCP.  You will need to again install and configure your Credential Provider, have the application development team work with the PAM Admin to create the Application ID in the PAM service and configure the authentication mechanisms selected in the step 2. Then we can work with the PAM Admin to create the application’s safe, onboard credentials and provision access to the Credential Provider and the Application ID.


If you’ve opted to use hash-based authentication, you’ll need to create a hash according to your specific ASCP instructions. Once you’ve obtained the hash, update the authentication mechanisms accordingly. If you try to create a hash and then modify your application, the authentication will fail – and that’s by design. The hash authentication mechanism is the strictest form of Application ID authentication, and so any modification to the code after the hash is registered will result in authentication failure.

Once your modifications are made, test to confirm that application fetches credential successfully. Then enable credential rotation, trigger credential change and test application again.

Step 3C: Promote Code to Production
Once again, we’ll go through all the same steps as we did in our UAT environment, but for our production instance. Be sure to thoroughly test your application upon go-live to ensure it’s functioning as expected. If you’ve opted to use hash-based authentication, be sure that you’ve updated the hash value prior to your final go-live.


Note: If you opt to leverage hash-based authentication, you will need to repeat the hashing process referenced above regularly when new builds of the application are tested and deployed.

Defense in Depth Considerations
While our primary focus of this article has been on securing the application’s access to privileged accounts, there are additional defense in depth considerations on both the server-side and resource-side of our application that are worthy of review.


Server-Side Security
Consider implementing PAM controls for all interactive access to the application middleware server itself. This is common for high-risk, mission critical applications. It’s important to protect administrative access on the host the application runs, as operating systems are still susceptible to in-memory based attacks. Consider implementing endpoint privilege management controls to control which processes and users can access the Credential Provider cache (although this would be a bit extreme).


Explore these additional articles to learn more about securing Windows Server Admin access and *NIX Server Admin access.

Resource-Side Restrictions
If the target resource supports additional authentication restrictions such as IP restrictions, consider implementing them, or additional logging and monitoring on the resource-side. This too is typically reserved for those high-risk, mission critical applications that are vital to your business.


Making Progress, One Cup of Java A Time
Armed with the insight above, you should feel empowered to start engaging with your application teams and application middleware platform teams and begin tackling the secrets management security for your Java EE runtime applications. We encourage you to check out the Application Server Credential Provider documentation for more details on leveraging the Secrets Management service to secure your middleware applications. Should you have any additional questions, please check out our Secrets Manager discussion topic here on the Idira Community. Happy (secure) coding!

  • 1982 Views
  • 0 comments
  • 0 Likes
Top Liked Authors