Security threats are constantly rising and getting more sophisticated, thanks to bad actors utilizing artificial intelligence (AI). AI-enabled cyberattacks increased an estimated 72% in 2025 and that's led to a rapid increase in the number of companies using AI to fight threats, with about two-thirds now doing so.
As security complexities increase, cybersecurity companies are more important than ever, driving what will become a $377 billion market by 2028, according to IDC. As companies rise to meet the increasing threats, investors have the potential to benefit from the companies leading the pack. Here's why Palo Alto Networks (PANW 0.11%) and Microsoft (MSFT +0.59%) are two of the best cybersecurity stocks to buy right now.
Image source: Getty Images.
Palo Alto continues to expand its security footprint
Palo Alto recently made a very significant move to expand its security lead by purchasing Cyberark Software for $25 billion. The move helps the company, which was already a leader in cybersecurity, expand its footprint in identity and access control. The move, while pricey, means Palo Alto can offer a comprehensive cybersecurity solution to its clients, once the deal closes in the next few months.
But it's worth mentioning that Palo Alto would already be a top cybersecurity company even without the purchase. In the fiscal first quarter (which ended Oct. 31), the company's sales rose 16% to $2.5 billion, and its non-GAAP (adjusted) net income rose by 19% to $0.93 per share.
Palo Alto's business is highly profitable, with management reporting another quarter of an approximately 30% operating margin and guiding toward an adjusted free-cash-flow margin of 40% or higher by fiscal 2028. With the company's profitability already high and Palo Alto on the verge of closing its Cyberark deal to expand its security services, shareholders have a lot to look forward to.

NASDAQ: PANW
Key Data Points
Microsoft isn't just an AI and cloud company
Microsoft is best known for its Azure cloud computing business, its growing influence in artificial intelligence with Copilot, and its Microsoft 365 software offerings. That's important to note because the AI cloud market is estimated to reach $2 trillion globally by 2030.
But the company is also an important player in the cybersecurity space, with 1.5 million cybersecurity customers globally. Microsoft has an Azure Security service it offers to its cloud customers, allowing the company to benefit from both hosting clients' cloud networks and their need to secure them.
In 2025, Microsoft earned an estimated $37 billion in cybersecurity sales, which accounted for about 14% of its total sales, making it the largest cybersecurity company by revenue. If it continues to grow at a similar rate, Microsoft could reach $50 billion in security sales by 2030.

NASDAQ: MSFT
Key Data Points
Microsoft is already delivering strong results for shareholders. Revenue climbed 18% year over year to $77.7 billion, in its fiscal first quarter of 2026, ended Sept. 30, 2025, while non-GAAP earnings surged 22% to $30.8 billion. By capitalizing on the rapid adoption of AI -- and the growing demand for security services that protect AI-driven cloud infrastructure -- Microsoft is well positioned to continue rewarding shareholders as it evolves into an increasingly key player in cybersecurity.
One quick note about cybersecurity stocks
All tech stocks can be volatile, but cybersecurity stocks sometimes fall on news of security breaches. No cybersecurity system is foolproof, so some breaches are inevitable. But as long as Microsoft and Palo Alto deal with any problems quickly and no lasting damage is done, investors shouldn't panic-sell when cyberattacks occur.





