Discover the best practices for organizations to follow when their source code repositories are compromised.
Cyber attacks have become inevitable for organizations, leaving many wondering when their systems will be the next target. While not every attack can be prevented, an effective incident response plan can lessen potential damage.
Most organizations understand the fundamental steps that should be taken in the event of an incident; however, there is a noticeable gap in establishing a cohesive and well-defined strategy for securing their software development platforms, like GitHub, and source code hosted on these platforms. Without a successful plan for securing their development pipeline, organizations risk increasing the impact of a breach from internal and external threats, including the integrity of the source code, which can undermine consumer trust and disrupt business continuity.
Organizations should consider the following steps when establishing an incident response plan for their source code hosted in GitHub:
Evaluate and confirm the compromise. Identify when the codebase was breached and which specific projects or repositories may be susceptible to the impact. Understanding the nature of the incident will allow for a more precise and effective incident response. Suppose a specific date or timeframe can be identified when the breach occurred. In that case, teams can utilize git’s version control capabilities to roll back the affected repositories to a state before the compromise occurred.
Any compromised secrets, access tokens, API keys, or other credentials and secrets should be revoked and rotated immediately if a threat actor has potentially gained access to them.
Pull audit logs from GitHub to get detailed records of activities within your GitHub repositories and organizations and offer insights into user actions, changes, and potential security incidents. Audit logs should be reviewed for indications of anomalous activity access control violations and to assist in constructing an accurate timeline of the incident.
Repository commits should be reviewed to determine if there is any indication that a threat actor made changes directly in the source code. For example, if there are several unverified commits within the timeframe of the suspected breach, this might warrant further investigation into what was committed to the codebase. Additionally, looking at commit volume, commit date, and expected contributors can help organizations determine a baseline - what is normal behavior for the developers. This can help identify behavior or activities that stray from what is expected.
Perform an automated comparison of commits immediately before and after the suspected branch. Running a git diff of two commits allows you to see the differences in the content of your codebase between those two specific points in history. If a threat actor committed malicious code, you could see those changes.
Depending on impact and legal implications, the vulnerability should be disclosed to necessary parties, either publicly or privately. GitHub’s Security Advisories provide a means to disclose, fix, and publish information about a vulnerability. This allows consumers to update packages with ease and can also assist in determining the impact of the security vulnerability.
While it is virtually impossible to prevent every cyber attack, a successful incident response plan is critical in mitigating any potential damages. Organizations should proactively develop a plan for securing their development platforms, like GitHub, to ensure an established, repeatable plan is in place. In doing so, organizations can better position themselves to sufficiently respond to any threats and quickly return to normal business operations.