Shares of CyberArk (NASDAQ:CYBR) have rallied 20% since the beginning of the year, easily outperforming the basket of its industry peers in the PureFunds ISE Cybersecurity ETF, which dipped 2% during that period.

But after that big rally, CyberArk now trades at 75 times trailing earnings and nearly 50 times forward earnings -- quite high relative to its projected annual earnings growth rate of 20% over the next five years. Even so, I believe that CyberArk's best days could still be ahead, for three simple reasons.

Image source: Getty Images.

1. Data breaches are on the rise

The total number of personal records exposed in data breaches in 2015 doubled to nearly 178 million, according to the Identity Theft Resource Center. High profile breaches, like the recent DNC hack, indicate that hackers are growing bolder and attacks are becoming increasingly sophisticated.

Most data breaches come from external sources. Companies like FireEye (NASDAQ:FEYE), Palo Alto Networks (NYSE:PANW), and Cisco try to prevent those attacks with threat prevention solutions and firewalls. A smaller percentage (about 8%) comes from internal breaches by disgruntled employees and agents of corporate espionage, and CyberArk dominates that niche as the "best in breed" player in privileged account management (PAM) solutions.

2. A well-protected niche

CyberArk's PAM platform is the only one certified by the U.S. Department of Defense, which gives it a major advantage over more diversified competitors like CA, its only meaningful rival in the PAM space. Its platform is used by over 2,600 customers worldwide, including 40% of the Fortune 100 companies and 17 of the 20 biggest banks in the world.

In the past, many bears claimed that bigger IT players like HPE (NYSE:HPE) or IBM (NYSE:IBM) could sweep away smaller cybersecurity firms like CyberArk by bundling similar security solutions in their bigger IT platforms.

Yet that hasn't happened to CyberArk -- HPE and IBM both recently signed partnerships with CyberArk to integrate its PAM solutions into their IT security platforms. Earlier this year, CyberArk formed the C3 Alliance for companies to integrate its PAM solutions in a similar manner. Major security players like Symantec, FireEye, and Intel Security have already joined that consortium.

3. Disciplined cost controls

Unlike many other cybersecurity companies, CyberArk is profitable on both non-GAAP and GAAP bases. That's because the company generally controls its expenses -- especially stock based compensation -- better than its peers FireEye and Palo Alto Networks.

CyberArk spent just 7% of its revenue on stock-based compensation last quarter. FireEye and Palo Alto respectively spent 38% and 33% of their revenues on stock-based compensation during their corresponding quarters, which resulted in GAAP losses for both companies.

CyberArk expects expenses to rise this year as it hires new sales staff, but its strong record of tight cost controls should keep its bottom line growth on track. Analysts expect CyberArk's full-year earnings to dip 9% this year, but bounce back with 24% growth next year.

4. The cybersecurity market is ripe for consolidation

Many cybersecurity stocks, including CyberArk, currently trade well below their all-time highs due to concerns about sluggish enterprise spending, competition, and their lofty valuations. However, that weakness indicates that the sector could be ripe for consolidation, and CyberArk's profitability and "best in breed" position in the PAM market make it a lucrative takeover target for a large number of cybersecurity and IT players.

Check Point Software (NASDAQ:CHKP) was reportedly interested in buying CyberArk earlier this year, but CyberArk CEO Udi Mokady shot down those rumors and declared that he was more interested in "building a large company." Therefore, CyberArk might eventually acquire other cybersecurity firms to expand out of its PAM niche.

Should you buy CyberArk today?

CyberArk is a highly volatile stock with a lofty valuation, but I believe that it's still one of the best long-term plays in cybersecurity. Investors need some exposure to the cybersecurity sector, and CyberArk's profitable niche makes it a fairly stable bet in a market filled with spendthrifts propped up on lofty valuations.