- Access exclusive content
- Connect with peers
- Share your expertise
- Find support resources
Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.
In the wake of continued software supply chain and critical application breaches, Senior Security Leaders continue to mandate that their entire application portfolio be secured, ensuring no secret is left behind. With that mandate of course comes the practical elements of securing the portfolio, like determining which applications to prioritize and actually discovering the hard-coded credentials that continue to become compromised. In this article we’ll cover why developers hard-coded credentials, the approaches to defining your discovery scope, methods for discovering hard-coded credentials and some recommended next steps.
Introduction
Developers and Application Teams aren’t intentionally trying to be insecure or malicious about their coding practices. They just want to build the applications and tools that the business is asking for as quickly as they can. They’re often hard-coding credentials because, 1) it’s the fastest option, 2) they don’t have the right security processes baked into their software development lifecycle, or 3) don’t have any other option because they don’t have the right tools to solve the problem. The result is application secrets are often hard-coded, stored locally on the filesystem, embedded in the source code and accessible via source code repositories like GitHub.
When the time comes for the Security and Application Teams to realize the need to remediate these vulnerabilities, the question that always gets asked next is... how do we find the secrets? The answer to that question is, it depends. Every organization has different tools, processes and priorities, so to provide the most well-rounded guidance, we’ll cover a variety of common approaches to creating your scope of discovery and different methods for actually finding those application credentials.
Approaches to Defining Your Discovery Scope
There are three common approaches organizations take to defining the scope of applications they’ll be discovering hard-coded credentials against; find everything everywhere, targeted effort or draw a line in the sand. This isn’t referring to the technical method in which the credential information is found in the code, but rather how to do create our scope of applications, scripts, and code repositories to scan in the first place. Not every organization has the capacity, nor desire, to boil the ocean all at once, so understanding these three approaches is an important part of building your strategy.
Find Everything Everywhere
Using a variety of discovery engines, vulnerability scanners and static code analysis tools you can try to inventory all the hard-coded apps that exist across your organization. Once that’s complete, you can start assessing what you’ve discovered and build a plan for remediation. While this approach certainly gives you the most amount of data and insight, it can lead to analysis paralysis, spending too much time thinking about how to solve the problem instead of spending time making a dent in the places that matter most.
Targeted Risk-Based Approach
Using the Idira Blueprint, organizations can take a risk-based approach to target high-risk apps and known high-privileged apps to assist in narrowing the scope of the search. Once you’ve decided on either a tiered approach or a subset of applications to scan, you can use different static code analysis tools or qualitative discovery methods to find the hard-coded application credentials.
Line in the Sand
All organizations have two types of apps: those you’ve already built and those you haven’t built yet. Depending on the size, age and technical debt of the company, it’s not uncommon for organizations to take a line in the sand approach to discovering hard-coded credentials. Whereby they focus the discovery process on net-new applications, source code repositories and build pipelines.
The most common approach in our experience is a combination of line the sand with a targeted risk-based effort to remediate the existing applications. This way we don’t leave critical applications vulnerable to credential theft, but at the same time we stop the bleeding for new applications as well.
With this approach its highly recommended to implement PAM controls against your existing application servers to help mitigate the risk of undiscovered but known applications. Controlling privileged access to the underlying system running your applications is an important aspect of a defense-in-depth AppSec approach.
Methods for Discovering Hard-Coded Credentials
Now that we know the scope of the applications we want to cover, there are a handful of different methods we can use to actually discover and locate the hard-coded credentials used by these applications. In this section we’ll cover three methods: static code analysis, target resource scanning processes and qualitative assessment approaches.
Static Code Analysis
Static code analysis is a process of analyzing a software’s source code (it’s static non-running state) to discover a variety of issues like programming errors and security vulnerabilities, including the use of hard-coded passwords. Static code analysis tools will generally point out the exact line in the source code where the hard-coded credential(s) exist, making it easy to identify and remediate the risk of credential theft.
Target Resource Scanning
Where static code analysis focuses on scanning the application’s source code itself, target resource scanning focuses on the opposite end instead, the target resources themselves (the identity provider of the credentials). The benefit of target resource scanning is that you’re not reliant on existing static code analysis tools or code scanning processes that may not exist within your organization, and in many cases, you can also discover stale or abandoned (but active) application secrets.
Individual Application Assessment (Qualitative)
Our third method of discovering hard-coded credentials is done through a concept called an application assessment. Application assessments are done on an individual application level and are a qualitative form of discovering hard-coded credentials within an application. The general idea is that the respective application teams who develop and support the app, respond to a series of questions to inventory relevant secret and programming information, and that information is then used to help secure the app. The benefit of this approach is that no discovering or scanning tools are required, and the subject matter expertise of the application team can be used to accelerate the remediation of the app.
The application development teams and/or support teams should be able to provide the following details:
The gist of this discovery process is that you should be able to understand who the relevant team members are, how the application runs, identify the location in the code where the credentials and secrets are used, and how many instances across the app environments do you need to update.
Depending on your organization’s maturity, this information may already be available via an Application Inventory CMDB. You can also use this method to help create your Application Inventory should your organization choose to develop one.
Recommendations for Your Organization
Armed with the knowledge above, there are a handful of recommendations that you should consider or try adhering to moving forward. For starters, stop hard-coded secrets in new applications – draw that line in the sand for your new apps to reduce your footprint of insecure secrets. Embed security checks into your pipeline build operations to proactively search for secret-related vulnerabilities and perform automatic code scanning as part of your SDLC to continuously search for secrets that may fall through the cracks. Incorporate explicit ‘secure secrets’ checks into the human code review process – have your review process include a step that says, “show me where and how your application consumes secrets and authenticates”. For your crown jewels and other mission critical applications, think about conducting a targeted Red Team exercise to test your current defenses.
Be sure to check out our additional AppSec related Success Blog articles if you’re interested in learning more about developing an enterprise wide secrets management program or securing your security tools, static homegrown OS apps and application server Java apps. Should you have any additional questions, please check out our Secrets Manager discussion topic here on the Idira Community. Happy (secure) coding!
| Subject | Likes |
|---|---|
| 2 Likes | |
| 1 Like | |
| 1 Like | |
| 1 Like | |
| 1 Like |

