Top 9 Tips For CI - CD Security
Top 9 Tips For CI - CD Security
9 Ways
to Prevent a Supply
Chain Attack
on Your CI/CD Server
Introduction
How can you enhance the security of your CI/CD server and avoid a data breach?
Conclusions
About JetBrains
About TeamCity
Next steps
Introduction
To prevent data breaches and business disruptions that may result in huge financial
losses, properly securing your CI/CD server should be a top priority today. Moreover,
Google reveals in its “2022 Accelerate State of DevOps Report” that implementing
appropriate security controls has a positive effect on software delivery performance and
even brings additional benefits, such as reduced developer burnout.
Introduction
This whitepaper highlights 9 best practices for strengthening the security of both
on-premises and cloud-based CI/CD solutions. However, since a significant number of
companies worldwide use on-premises CI/CD servers, around 50% according to one of
our recent studies, some of these tips are only applicable to on-premises setups.
Top 9 security tips to prevent
an attack on your CI/CD server
1. Keep your CI/CD server up to date
When using a cloud-based CI/CD solution, this will generally be done for you
automatically, though you may have to trigger major updates manually.
TeamCity will automatically notify you via the UI when a new update becomes
available. You can also manually check for new versions under Server
Administration | Updates for TeamCity itself and under Server Administration |
Plugins for any available plugin updates. You can also subscribe to the security
notification service to receive the latest information about security issues that may
affect TeamCity or any other JetBrains products.
TeamCity undergoes regular security assessments and updates to fix any potential
security issues.
Top 9 security tips to prevent an attack on your CI/CD server
Use of stolen or compromised credentials remains the most common cause of data
breaches. Breaches caused by stolen or compromised credentials have an average cost
of USD 4.5 million. Moreover, such breaches usually have the longest lifecycle, requiring
on average around 243 days to identify and another 84 days to contain.
If you’re using Versioned Settings (in the Kotlin DSL or XML format), never store
your credentials in configuration files. Use tokens instead.
Where it’s the case, use one of our external authentication modules, ranging from
LDAP and Windows Domain integration to authenticating via GitHub, GitLab, or
others. You can then disable the built-in authentication of TeamCity so that it will
no longer keep hashed passwords in the internal database.
You may consider using a tool like HashiCorp Vault, which lets you manage and
rotate all the sensitive credentials you’ll be using in a build and which integrates
well with TeamCity.
This will help you minimize the attack surface if a malicious actor gains access to one of
the users.
Learn more about per-project and role-based authorization and access control in
TeamCity
TeamCity allows you to configure custom roles with permission levels suited to a
given user’s needs. It also offers several roles predefined out of the box:
System Admin Project Developer
Project Admin Project Viewer