<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Claroty - Medium]]></title>
        <description><![CDATA[Claroty is the cyber-physical systems (CPS) protection company, empowering organizations to protect the mission-critical infrastructure that underpins modern life. - Medium]]></description>
        <link>https://medium.com/claroty?source=rss----382afe27fbb6---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Claroty - Medium</title>
            <link>https://medium.com/claroty?source=rss----382afe27fbb6---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 09:46:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/claroty" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The Art of On-Premise Development]]></title>
            <link>https://medium.com/claroty/the-art-of-on-premise-development-dd54fb2e8808?source=rss----382afe27fbb6---4</link>
            <guid isPermaLink="false">https://medium.com/p/dd54fb2e8808</guid>
            <category><![CDATA[application-development]]></category>
            <category><![CDATA[hybrid-cloud]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[on-premise]]></category>
            <dc:creator><![CDATA[Roee D]]></dc:creator>
            <pubDate>Thu, 21 Jul 2022 13:54:00 GMT</pubDate>
            <atom:updated>2022-07-21T17:28:49.627Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9Z_OFBOWLUHTuFvH.jpg" /></figure><p>There’s nothing like working with cloud managed services. Everything is a breeze, it’s quick and easily monitored. But what happens when the customer requirement for your application is to run on-premise? One that is supposed to run even in an air-gapped network?</p><p>My colleagues and I have been working on a solution that should support both on-premise and cloud deployment, and we got to witness first-hand the issues you can get from it.</p><p>There are obvious things that needs to be done when working on an on-premise solution, like replacing managed cloud services with self managed ones. In this article, I’ll review three important considerations that may initially be less obvious while deploying an on-premise application and share insight on how to mitigate them.</p><h3>The state of on-premise development in 2022</h3><p>There are many reasons for the fact that we see less and less on-premise deployment in today’s market, mostly related to the growing ubiquity of cloud-based SaaS solutions. So, why do we even need to talk about it?</p><p>A 2021 report from <a href="https://www.replicated.com/blog/the-state-of-on-prem-report/#:~:text=The%20State%20of%20On%2DPrem%3A%20Modern%20Solutions%20for%20a%20Traditional%20Problem,-David%20Hallinan&amp;text=The%20primary%20research%20goal%20was,and%20the%20use%20of%20Kubernetes.">Dimensional Research</a> has shown that <strong>92%</strong> of the surveyed companies indicate on-premise software sales are growing. <a href="https://www.nutanix.com/enterprise-cloud-index">Another research report</a> published in September 2021 by Nutantix concluded that the use of a private cloud solution <strong>rose through 2021</strong>, and 25% of the companies asked have considered it their most commonly used deployment model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4wO-DnYH35IF7qfO" /></figure><p>In trying to understand this trend, our initial assumption was that we’ll see those kind of deployments less and less, but that’s not necessarily the case.</p><p>Many organizations today choose a middle ground, favoring hybrid cloud solutions that can combine on-premise resources with a public/private cloud. They understand that they don’t necessarily have to choose, they can enjoy the benefits of both solutions, and change what is deployed/stored wherever and whenever they feel like.</p><p>So what are the (perhaps less obvious), key principles that are important for us to remember when developing software that will be deployed on-premise?</p><h3>Upgrades</h3><blockquote><em>“Great Scott! Are they still using version 1.6?!” — Doc Brown, Back to the Future 4 (probably)</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*xJu9tKwZbvJ-tUW7" /></figure><h4>The Issue</h4><p>You’re no longer in charge of upgrading the customer to the newest release. There is no promise that the customer will upgrade for a really long time.</p><h4>The Mitigation</h4><p>Upgrading your software should be as easy and fast as possible. Sure, there might be some pushbacks, with comments like “Why bother with the upgrade?”, but if the upgrade file is small and is fast to upgrade there’ll be less resistance.</p><p>Sometimes, your on-premise code might have a corresponding database, which might take more than a few seconds to migrate, and will slow down the upgrade. There are several ways to approach this, but one that I especially like and have seen being used in a few places, is to replicate the database and leverage a CDC tool, such as <a href="https://debezium.io/">Debezium</a>, to keep migrating the changes while the system is still running. When all the existing data + the new one that was created during the upgrade have finished migrating, replace the primary database with the secondary database, resulting in a very short downtime.</p><h3>Monitoring</h3><blockquote><em>“If the system crashed and nobody was around to hear it, did it really crash?”</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/220/0*jY8j856c4M9o4lYJ" /></figure><h4>The Issue</h4><p>How can we monitor an environment if we don’t have any access to it? How can we even retrieve crash logs?</p><h4>The Mitigation</h4><p>You can’t know if you have any issues in a totally isolated environment, so monitoring will have to be part of the solution you provide to your customer, with clear indications if something goes wrong. An on-premise monitoring solution must be in place, one which will monitor the machine’s free disk space to the stuff you’d monitor on the cloud. It should be something that is easily customizable, with scripts you can add to increase visibility.</p><p>Once again, there are many solutions for this. We’ve been using <a href="https://www.datadoghq.com/solutions/on-premises-monitoring/">Datadog</a> for one of our cloud solutions, with plans to utilize its on-premise capabilities as well. Just make sure that the <strong>critical </strong>alerts are properly shown to the users so they can contact the relevant support — it’s a lot nicer to get a big warning “The system is using 80% of the storage size” than seeing it suddenly crash as a result of a 100% usage.</p><p>Let’s say there is an actual bug in your code. Debugging remotely can be slow and troublesome, and many times getting the system’s logs is completing only half of the picture. So we’ve created a script, that dumps all the relevant application data, encrypts and packs. We then unpack it on a VM, and get a sort of replica of the customer application at the moment of the dump (logs, database, etc).</p><p>While not the cheapest, there are actually ways to do it today with the cloud providers, easily copying the VM/files and utilizing the cloud to get a customer replica.</p><p>This process is mostly useful when you want to safely and easily debug the full state of your application, reducing the latency that might occur with remote debugging.</p><h3>Machine size</h3><blockquote><em>“A slim application is a happy application!”</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*IWIm3vu2YC7WkJl5_2D0Iw.png" /></figure><h4>The Issue</h4><p>The limited on-premise resources don’t really allow you to scale. You might deploy on a big machine, but it’s never enough, and you definitely can’t tell customers to keep changing the machine on which the solution is deployed!</p><h4>The Mitigation</h4><p>The system <strong>has </strong>to fit its data to the machine spec it’s deployed on. Limitations and retention are your best friends to ensure that the system won’t be overwhelmed. This becomes especially important if we remember our first issue: the fact that we can’t control upgrades, might result in database information becoming stale/old/irrelevant, and you’ll need to set proper retention/limits policies.</p><p>There are several areas where you’d most likely want to enforce this:</p><ul><li>Logs (logrotate)</li><li>Files that might be created by the application</li><li>Database tables (limit amount of rows)</li><li>Amount of processes (fit amount of processes to machine’s specs)</li></ul><h4>Bonus</h4><p>Add to the monitoring solution some indications of if the system is about to reach some of the limits, and monitor if it might be maximizing machine resources. This way you can reduce and change the limits for different system parameters, and make sure the system always works in the best possible way.</p><h3>Wrapping up</h3><p>Developing on-premise applications is a difficult task. But going forward, software developers will have to understand how just like the hybrid cloud they’ll have to write hybrid applications that run on both cloud and on-premise instances.</p><p>The good news is that aside from the tips noted above, there are more and more solutions that are being created by cloud providers to keep cloud and on-premise environments as similar as possible, making deployments easier.</p><p>Having said that, developing applications like these still offers a unique challenge, forcing you to rethink the way you’ve developed your application so far.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd54fb2e8808" width="1" height="1" alt=""><hr><p><a href="https://medium.com/claroty/the-art-of-on-premise-development-dd54fb2e8808">The Art of On-Premise Development</a> was originally published in <a href="https://medium.com/claroty">Claroty</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloudy with a Chance of Risk: Managing Risks in Cloud-Managed OT Networks]]></title>
            <link>https://medium.com/claroty/cloudy-with-a-chance-of-risk-managing-risks-in-cloud-managed-ot-networks-460d7f0901d2?source=rss----382afe27fbb6---4</link>
            <guid isPermaLink="false">https://medium.com/p/460d7f0901d2</guid>
            <category><![CDATA[risk]]></category>
            <category><![CDATA[cloud-security]]></category>
            <category><![CDATA[operational-technology]]></category>
            <category><![CDATA[cloud-migration]]></category>
            <category><![CDATA[industrial-cyber-security]]></category>
            <dc:creator><![CDATA[Chen Fradkin]]></dc:creator>
            <pubDate>Thu, 30 Jun 2022 13:51:22 GMT</pubDate>
            <atom:updated>2022-06-30T13:54:14.700Z</atom:updated>
            <content:encoded><![CDATA[<p>Digital transformation: Most of us have probably already heard this term, sometime, somewhere. It’s somewhat difficult to miss when everyone is trying to reimagine their business in the digital age. Industrial organizations are no different in this regard, as they gradually incorporate cloud infrastructure to their cyber-physical operations and other processes. Across all sectors, industrial enterprises are looking to improve operations and usability, by making processes in OT networks more efficient and data driven. And so one thing leads to another, and they begin to consider adopting a cloud-based solution. This can deliver many significant advantages, including but not limited to:</p><ol><li>Better telemetry and analysis of device performance</li><li>Management of logic and remote device configuration</li><li>Improved diagnostics and troubleshooting</li><li>Centralized view of industrial processes</li><li>Redundancy — critical to business continuity</li><li>Reducing infrastructure costs</li></ol><p>However, when companies begin to manage their operational technology (OT) using cloud-based infrastructure, the tradeoff between user friendliness and security, that great convergence brings with it new risks and challenges. OT networks — once air-gapped — are now connected to the cloud, and therefore have a much larger attack surface exposed. As the number of organizations bringing OT into the cloud grows, threat actors may see an opportunity to target vulnerabilities exposed by said connectivity at scale.</p><p>In this blog, we’ll go through the various potential threats and risks of OT cloud migration, and offer guidance on how to manage them.</p><h3>Cloud Infrastructure in OT</h3><p>First thing’s first, before we dive into the risks that arise from cloud migration, it’s important to understand what this migration means for OT networks.</p><p>In general, migration to cloud-based infrastructure usually means that part of the organization’s infrastructure is hosted on remote servers, managed by third-party cloud providers like Google, Amazon, and Microsoft. Said infrastructure includes a cloud-based management platform that supports the different users of the organization’s services, for example admins or engineers. User and role policies define which functions each user may execute and its privileges.</p><p>When referring to cloud-managed OT networks, these concepts remain the same. Using the management platform, operators and administrators can deploy settings changes, edit configurations, and manage the plant’s technology network across the <a href="https://claroty.com/2022/06/07/blog-extended-internet-of-things-xiot-faq/">Extended Internet of Things (XIoT)</a>. These site leaders can also manage the logic that needs to be executed by the PLCs to control Level 0 devices (sensors, actuators, etc.), and configure which data will be collected and sent to the management platform.</p><p>Cloud providers offer numerous possible services and infrastructure setups, all available for industrial control systems (ICS), as well as IT. One example is a multi-tenant cloud environment, where each customer is given a separate, secure space for data and project storage. Each customer can only access its own stored data, and the cloud provider enforces a permissions and security policy to prevent access to other customers.</p><p>The architecture, illustrated below, is a typical example of ICS managed via a cloud-based platform. It creates a single point of control that essentially becomes a single point of failure. This leads us to talk about security risks…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/514/1*8kSWiTsDD4I1NWXV7wcmag.png" /></figure><h3>Security Risks</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*RyffyMhloUECf6UR3c2jow.jpeg" /><figcaption>Source: <a href="https://cloudtweaks.com/2011/08/the-lighter-side-of-the-cloud-the-migration-strategy/">CloudTweaks.com</a></figcaption></figure><h4>Single Point of Failure: When IT Security Challenges Become an Issue for OT Security</h4><p>In a typical air-gapped OT network, attackers looking to compromise an entire operation will need to gain access to each targeted site separately if they wish to gain control of the managed PLCs. But now, as the cloud-management platform has become a single point of failure, one simple vulnerability could be enough for an attacker to take over the management platform that provides access to all managed devices. Vulnerabilities that are usually a problem in IT security — such as web-based vulnerabilities and data exfiltration — can now become a challenge to OT security as well.</p><p>Creating a single point of failure is not necessarily limited to one user or customer, but rather to other customers as well. For example, let’s take a case of multi-tenant hosts, as explained above. An attacker, with access to the host system managed by a service provider, would theoretically be able to target any of the virtual instances on that host, and potentially every customer sharing the host system provided by the cloud provider.</p><h4>Pivoting Into ICS</h4><p>Executing code on ICS devices (e.g. PLCs) or enforcing a denial-of-service will interrupt operations and could cause significant damage, not only to the ICS company, but to the public as well. Which is why accessing the internal OT networks that control the process is the end goal of attackers. Movement of ICS services, such as HMIs or Historians, into the cloud-management platform further exposes the internal OT networks to threats and increases the attack surface.</p><p>As mentioned earlier, the migration to cloud includes a tradeoff between usability and security. One example of that tradeoff is a vendor’s ability to execute code on managed devices using the cloud-management platform. This capability is usually meant to make management and diagnosis easier, instead of restricting it to on-site support only. However, this can be risky if said capability was not designed and implemented properly by the vendors. When not done properly, it could be exploited by attackers to access internal networks of organizations and control critical devices.</p><p>The security of third-party partners — such as vendors and suppliers — must also be managed. A compromised vendor with access to sensitive systems could allow attackers access to cloud-managed systems.</p><h4>Bottom-Up vs. Top-Down</h4><p>There are two main attack scenarios in cloud-managed OT networks:</p><ol><li><strong>Top-down: </strong>The attack starts from the cloud and continues to take over all PLCs.</li><li><strong>Bottom-up</strong>: The attack starts from a single, remote PLC and continues to the cloud platform.</li></ol><p>In the top down approach, a compromise of the management console means you exploit a vulnerability in the cloud and have access to all the accounts and devices it manages. Next, an attacker can deploy malicious applications to all connected devices, enabling not only full control of endpoint devices (Level 1 of the Purdue Model), but also lateral network movement. Meaning the attack will move on to compromise other systems within the industrial network.</p><p>In the bottom up approach — attackers will target endpoint devices, and then move their way up to the cloud-based management console. Meaning they’ll first try to find vulnerabilities to exploit in the PLC. Claroty’s Team82 research team <a href="https://claroty.com/2021/07/21/blog-research-exploiting-vulnerabilities-in-the-ot-cloud-era/">has demonstrated</a> that such an approach is possible by exploiting a vulnerability in a cloud-managed PLC and eventually taking over the cloud-based host account.</p><p>These types of top-down, bottom-up attacks are innovative, and have been demonstrated as effective. They threaten process integrity by putting field devices, such as PLCs, at risk. They also threaten data integrity and whether organizations can trust the data uploads devices are sending back to the cloud.</p><p>The risks mentioned above are not the only ones to take into account when designing a cloud-managed OT network. Other potential issues and challenges, depending on the situation, may be relevant and should be addressed as well. Leading us to recommendations about managing security risks properly.</p><h3>Changing The Forecast: What You Need to Know</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*7_nLqggqhJIGSAPexUohkg.jpeg" /></figure><h4>Know Your Data — Encryption and Secure Communication</h4><p>Data security, once a lesser risk variable for industrial processes, should be elevated as a priority. Particularly in heavily regulated industries, where compliance is unforgiving. Organizations must not only evaluate threats, but also risks, such as a lack of protocol support for encryption and authentication.</p><p>Encryption, for example, may blind some tools from gaining full visibility into network assets. In an air-gapped environment, not encrypting data can be considered an acceptable risk, but once an asset is exposed online, it’s a different scenario. Data should be encrypted in transit as a best practice, and it will be imperative as companies begin to put services and applications, such as Historian databases, in the cloud receiving data from Level 1 devices like PLCs.</p><p>ICS companies should adhere to the following:</p><ul><li>Verify ICS devices’ support cloud protocols, such as MQTT or HTTPS via Web Client/REST. These are used to exchange data between PLC and cloud</li><li>Use security mechanisms, such as encryption and signing of data and communication with X.509 certificates or hardware-based encryption</li></ul><h4>Know Your Organization — Authentication and Identity Management</h4><p>The accelerated increase in remote work, due to COVID-19, and numerous incidents (e.g. the <a href="https://www.claroty.com/2021/02/16/blog-research-oldsmar-water-hack-highlights-systemic-problems-undermining-critical-infrastructure/">Oldsmar attack in February</a>) have demonstrated the risks associated with inadequate controls around access to systems and privilege management.</p><p>It’s critical to understand that an entire organization, including all its end devices, could be compromised because of lack of strong authentication or a single leak of main credentials. It emphasizes the importance of including authentication and identity management as part of an organization’s defense-in-depth plans for OT in the cloud.</p><p>ICS companies should adhere to the following:</p><ul><li>Add and enforce multi-factor authentication</li><li>Strengthen credentials, especially passwords to secure remote connections</li><li>Use granular user &amp; role policy</li></ul><h4>Know Your Responsibilities — Make The Blurred Lines Clear</h4><p>As process and system management in OT moves to the cloud, OT personnel (perhaps unlike IT people) may need a refresher on their responsibilities. As mentioned earlier, in cloud-managed networks part of the organization infrastructure is hosted on remote servers managed by <strong>third-party cloud providers</strong>. In many cases that involve third-party providers, whether the product provided is cloud, software, operating system, etc., managing security risks is more complicated. If a vulnerability is found in a third-party product, who is responsible to act, to mitigate, to update? As various third-party vulnerabilities and supply-chain attacks demonstrated — this is a pain point for everyone involved. Take the most recent <a href="https://www.claroty.com/2021/12/14/blog-research-what-you-need-to-know-about-the-log4j-zero-day-vulnerability/">Log4J</a> vulnerability as an example.</p><p>Naturally, third-party providers have their part to play, but ICS vendors’ and ICS companies’ CISOs have responsibility as well. Vendors should maintain a list of third-party components embedded within their products for easier identification of affected products, so they can advise customers how to act. CISOs should also maintain such a list, for easier identification of affected products within their OT network.</p><p>But how does it come into play in cloud infrastructure specifically? The cloud-provider is usually responsible for securing the host servers, virtual machines and physical security of data centers. Users/customers are usually responsible for data security (encryption), authentication and identity management, application security, and platform security (configurations/patching). Some responsibilities of the users may change depending on their selected services and terms.</p><p>Adhering to a shared responsibility model and defining a line between your responsibilities and the responsibilities of your cloud provider, is critical to reduce the risks in your cloud environment and is the first step to managing security risks in cloud-managed OT networks properly.</p><h3>Security vs. Usability — Why Not Both?</h3><blockquote>“Security at the expense of usability comes at the expense of security” <br>AviD’s Rule of Usability</blockquote><p>As described in this blog, migrating OT networks into the cloud is not without its challenges. Asset owners and managers overseeing cloud-managed OT networks need to assess and manage all these potential risks and more. The tradeoff between usability and security will become a risk management equation that ICS operators and owners will have to face going forward. The key is to make sure one doesn’t come completely at the expense of the other.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=460d7f0901d2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/claroty/cloudy-with-a-chance-of-risk-managing-risks-in-cloud-managed-ot-networks-460d7f0901d2">Cloudy with a Chance of Risk: Managing Risks in Cloud-Managed OT Networks</a> was originally published in <a href="https://medium.com/claroty">Claroty</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[NotPetya: Looking Back Five Years Later]]></title>
            <link>https://medium.com/claroty/notpetya-looking-back-five-years-later-c6741f1a17a0?source=rss----382afe27fbb6---4</link>
            <guid isPermaLink="false">https://medium.com/p/c6741f1a17a0</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[industrial-cyber-security]]></category>
            <category><![CDATA[malware]]></category>
            <category><![CDATA[ransomware]]></category>
            <category><![CDATA[cybercrime]]></category>
            <dc:creator><![CDATA[The Claroty Team]]></dc:creator>
            <pubDate>Mon, 27 Jun 2022 18:29:17 GMT</pubDate>
            <atom:updated>2022-06-27T18:29:17.720Z</atom:updated>
            <content:encoded><![CDATA[<p>Today, June 27, marks the fifth anniversary of the NotPetya ransomware attack, still widely regarded as the costliest and most destructive cyber attack in history. Just over a month after the similarly infamous WannaCry ransomware attack, NotPetya paralyzed operations at multinational corporations across a wide swath of critical infrastructure sectors including healthcare, energy, and transportation, resulting in an estimated $10 billion in damages. Still seeking to bring the threat actors to justice, the U.S. Dept. of State is offering a <a href="https://www.securityweek.com/us-offers-10-million-reward-russian-intelligence-officers-behind-notpetya-cyberattacks">reward of up to $10 million</a> for information on six officers behind the attack.</p><p>Looking back five years later, it’s clear that NotPetya has had a profound influence on the behavior of cyber threat actors and cybersecurity practitioners alike. It was only a matter of time for cybercriminals to realize that Operational Technology (OT) networks are critical to operations, and therefore extremely valuable. Adversaries have grown increasingly targeted in their ransomware strategies, shifting from opportunistic, spray-and-pray cyber attacks to more deliberate campaigns against specific companies with low tolerance for operation downtime and a greater willingness and ability to meet ransom demands. At the same time, the changes IT and OT security professionals have encountered over the last two years have been unprecedented and have had a dramatic impact on critical infrastructure.</p><p><strong>The world has changed dramatically</strong></p><p>Beginning in March of 2020, organizations pivoted quickly and those that were able to address a new, distributed model faster succeeded in continuing operations and gained competitive advantage. However, the acceleration of digital transformation and remote work also created more opportunities for threat actors, and we’ve seen an unprecedented increase in ransomware attacks on OT networks. In our <a href="https://security.claroty.com/report/global-state-industrial-cybersecurity-survey-2021">2021 global survey</a> of 1,100 IT and OT security professionals, 47% of respondents had their OT/ industrial control systems (ICS) environment impacted by a ransomware attack within the past year. Attacks against hospitals, oil pipelines, food supply chains, and other critical infrastructure, have brought into sharp focus the vulnerability of cyber-physical systems (CPS) and the impact on lives and livelihoods when they are disrupted. In fact, the <a href="https://www.ic3.gov/Home/AnnualReports">FBI’s Internet Crime Compliant Center (IC3) report</a> found ransomware hit 649 critical infrastructure entities in 2021.</p><p>Now, critical infrastructure networks are in the bullseye of geopolitical conflict. On April 20, the security agencies that comprise the Five Eyes intelligence alliance from countries including the U.S., Australia, Canada, New Zealand, and the United Kingdom, released a <a href="https://www.cisa.gov/uscert/ncas/alerts/aa22-110a">joint Cybersecurity Advisory (CSA)</a> warning of imminent and serious threats to critical infrastructure in countries that have sanctioned Russia or otherwise supported the Ukraine. Cybercrime groups have aligned with Russia, pledging to support the country’s efforts to wage targeted cyber warfare.</p><p>While ransomware tactics have shifted away from the likes of NotPetya, WannaCry, and other self-propagating ransomware, security practitioners would be naive to assume we’ll never see another widespread ransomware attack of this variety. In all likelihood, it’s inevitable that we’ll see similar occurrences in the future, but only under the right conditions.</p><p><strong>OT vulnerability management and network segmentation are more crucial than ever.</strong></p><p>NotPetya’s far-reaching impact would not have been possible if the “wormable,” NSA-developed EternalBlue exploit vulnerability had not leaked two months prior in April 2017. While it’s impossible to predict if and when a similarly ubiquitous vulnerability will be exploited by cybercriminals, security teams can proactively address two major factors that enabled NotPetya to infect such a large number of OT environments:</p><ul><li><strong>Poor vulnerability management:</strong> Since the patch for EternalBlue had been issued On April 14, 2017, more than two months prior to NotPetya, the entire ordeal could have been prevented if all organizations had applied the patch. Patching vulnerabilities before adversaries have the chance to exploit them at scale is essential for preventing attacks similar to NotPetya in the future, but administering security patches is disruptive and costly — especially in OT environments. As such, in order to manage and patch the vulnerabilities that matter most, security teams must have the visibility needed to identify <a href="https://claroty.com/2021/04/07/blog-pillars-reveal/">which security flaws are present</a> within OT assets, as well as the ability to accurately assess <a href="https://blog.claroty.com/ciso-series-ot-vulnerability-prioritization">the level of risk</a> posed by each vulnerability. Then, they can prioritize patching <a href="https://www.cisa.gov/known-exploited-vulnerabilities-catalog">known exploited vulnerabilities</a>, as the joint CSA suggests. In instances where patching isn’t possible or practical, such as with legacy systems, identify and implement compensating controls such as firewall rules and access control lists. Understanding the level of exposure will help determine where to focus resources and budget to prioritize crown jewels protection.</li><li><strong>Poor network segmentation:</strong> A major contributing factor behind NotPetya’s ability to spread like wildfire across organizations’ IT and OT environments was a lack of <a href="https://claroty.com/2022/02/02/blog-how-to-accelerate-segmentation-alongside-the-xiot/">segmentation</a>. Auditing for network segmentation to check for IT/OT segmentation will mitigate the risk of an attack on the IT network spreading to the OT network. In addition, virtual segmentation within the OT environment is a cost-effective and efficient way to establish what “normal” looks like and be alerted to lateral movement as malicious actors try to establish a presence, jump zones, and move across the environment. And if remote operations need direct access to the OT networks, make sure this is done through a secure remote access connection with strict controls over users, devices, and sessions.</li></ul><p><strong>Protection for CPS has become a greater priority for organizations</strong></p><p>NotPetya did not target industrial environments specifically. But due to its self-spreading capabilities and its use of an SMB vulnerability present in many OT environments, it wrought widespread havoc at industrial sites. The attack was a wake-up call for many CISOs and a harbinger of a new paradigm where the overlap between IT and OT security threats is more broadly recognized and prioritized in today’s hyper-connected environments.</p><p>CPS and the networks they operate on have become attractive targets for nation-state adversaries and criminals. These networks are critical, and therefore valuable. Fortunately, security leaders can accelerate the rate at which they get visibility and control over those assets and proactively prepare for the likely scenarios.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6741f1a17a0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/claroty/notpetya-looking-back-five-years-later-c6741f1a17a0">NotPetya: Looking Back Five Years Later</a> was originally published in <a href="https://medium.com/claroty">Claroty</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Four Easy Ways to Speed Up Your CI/CD Pipeline]]></title>
            <link>https://medium.com/claroty/four-easy-ways-to-speed-up-your-ci-cd-pipeline-a6d281ca8ba4?source=rss----382afe27fbb6---4</link>
            <guid isPermaLink="false">https://medium.com/p/a6d281ca8ba4</guid>
            <category><![CDATA[continuous-deployment]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <dc:creator><![CDATA[Alon Gouldman]]></dc:creator>
            <pubDate>Tue, 14 Jun 2022 12:03:37 GMT</pubDate>
            <atom:updated>2022-06-15T11:51:09.327Z</atom:updated>
            <content:encoded><![CDATA[<p>We’ve all been there: You’ve just finished three days of intensive debugging of some critical bug — it was a tough one! You came up with a neat solution, added unit tests, and input your code. 20 minutes later, the continuous delivery/continuous deployment (CI/CD) pipeline fails on a random test. You fix the error, try again, and after another costly 20 minutes, the CI pipeline indicates that your change broke a different area of the code.</p><p>That’s good — the pipeline exists to save you from breaking different areas in your code, but this waiting time between each push greatly harms the feedback loop on your changes.</p><p>This was how the development flow at Claroty looked a year ago. Our pipelines have protected us so many times from making expensive mistakes. But it slowed down the development process, and reduced the joy of coding at speed.</p><p>At Claroty alone, we have more than 7,000 unit tests, along with integration tests and some entire system tests. This gives us amazing coverage, but back then, we had one issue: We ended up with pipelines that took more than 20 minutes on average. We decided to take action, and we were able to reduce the time of our pipelines to less than 10 minutes!</p><p>In this article, I’ll share what the Claroty Engineering Team did to speed up our CI/CD pipeline, so that you too can make your pipeline faster. Let’s jump right in…</p><h3>Three things to keep in mind before you start</h3><h4>1. Only optimize bottlenecks</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*MUpJWtc43UvStEO5bSPJgg.png" /></figure><p>Any optimization that doesn’t address a bottleneck will not reduce the total run time. Your time is valuable — don’t waste it on optimizing tests that won’t reduce the total run time! Measure every step of your pipeline and ask yourself: Is it the build time that’s slowing you down? Specific test or job? Maybe it’s due to slow network or input/output (I/O) operations?</p><p>Optimize only what makes a difference.</p><h4>2. Take care of specific slow tests</h4><p>Sometimes you have specific tests that are extremely slow. You can run <a href="https://docs.pytest.org/en/6.2.x/usage.html#profiling-test-execution-duration">pytest with –durations</a> to find the slowest tests and take care of them one by one.</p><h4>3. Measure everything</h4><p>During our optimization journey, some of what we did turned out to actually be slower. Make sure to profile every change before and after, and make sure your change actually helped. At Claroty, we mostly use <a href="https://docs.python.org/3/library/profile.html">cProfile</a> and <a href="https://github.com/inconshreveable/sqltap">SQLTap</a>.</p><h4>Side note: A nice little hack with SQLTap + pytest</h4><p>A lot of our tests access a DB during the test run, which can slow things down. For this reason, I wanted to use SQLTap to find where I could optimize the way we interact with the DB.</p><p>Usually, you can surround the code section that you want to test with SQLTap. But when running many tests, where should you place your profiler code? I ended up editing pytest’s source code on my local machine. You can find the place where the tests start their run <a href="https://github.com/pytest-dev/pytest/blob/main/src/pytest/__main__.py">here</a>:</p><pre>&quot;&quot;&quot;The pytest entry point.&quot;&quot;&quot;</pre><pre>import pytest</pre><pre>if __name__ == &quot;__main__&quot;:<br>  -&gt; sqlptap code goes here ←-<br>  raise SystemExit(pytest.console_main())</pre><p>That way, I could profile many tests and find what was slowing me down.</p><p>With that out of the way, we are ready to start speeding up your pipelines:</p><h3>Run static tests first, and stop on failure</h3><p>It’s frustrating to wait 20 minutes, just to find out that you failed on something like a syntax error or mypy’s tests. A best practice to avoid this frustration would be to:</p><ol><li>Run the static tests first — they are usually faster. This way, if your code fails, you’ll get faster feedback.</li><li>There is no need to wait for a 5 minute test suite, just to find out that your second test failed. Run your tests with `pytest -x`, to stop at the first test that fails.</li></ol><h3>Running database in memory</h3><p>Some of our tests use a database. To make things faster, we can run the DB in memory instead of writing to files. Writing to a file is slow, while accessing the RAM is blazing fast.</p><p>In a production app, you should never run your DB in memory, because your data will be deleted on every restart. But for tests it doesn’t matter, as the data is temporary anyways.</p><p>We encountered a problem — in some of our tests, we’re using MariaDB, which doesn’t support running tables in memory. To solve this, we used <a href="https://www.thegeekstuff.com/2008/11/overview-of-ramfs-and-tmpfs-on-linux/">RAMFS</a>. RAMFS is a file system that runs in memory, and this is exactly what we need! This is how you setup your MariaDB to run in memory:</p><ol><li>Stop the MySQL engine:</li></ol><pre>/etc/int.d/mysql stop</pre><p>2. Setup the RAMFS:</p><pre>mkdir -p /var/ramfs <br>mount -t ramfs -o size=$size ramfs /var/ramfs/</pre><p>3. Setup the MySQL to use the new RAMFS:</p><pre>cp -R /var/lib/mysql /var/ramfs/<br>chown -R mysql:mysql /var/ramfs/mysql<br>echo &quot;datadir = /var/ramfs/mysql&quot; &gt;&gt; /etc/my.cnf.d/icsranger.cnf4</pre><pre># Start the MySQL engine again:<br>/etc/init.d/mysql start</pre><p>From the DB engine’s perspective, everything is normal. It writes and reads from files as usual. But from the operating system’s point of view, the files are actually in memory and are not permanent.</p><p>This is how much time a sample of 215 of our tests takes without RAMFS solution:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/0*zkQKsP_lamgYGm_Z" /></figure><p>and this is the same tests, with RAMFS — more than double the speed (!):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/0*ixDwwiHPW2PKCneN" /></figure><p>Other than MariaDB, there are also solutions for <a href="https://www.sqlite.org/inmemorydb.html">other</a><a href="https://gist.github.com/ellmetha/a17a824ac593de4aa386"> DBs</a>.</p><h3>Quick win: Parallel testing</h3><p>The idea here is simple. Instead of running all your tests one at a time in linear fashion, run them in parallel simultaneously!</p><p>Some unit tests are isolated and can run in parallel. They are separated from one another, and are completely independent. For those, you can run your tests with <a href="https://pypi.org/project/pytest-xdist/">xdist</a>.</p><p>But other tests are not isolated, and will affect each other when run in parallel — some of the tests might share DB, Redis, or other services. Perhaps there is another internal package that doesn’t know how to deal with isolating each test. Sometimes. you can solve the root cause of this by changing the way your services behave. But what if you can’t change it?</p><p>Here is a quick win, that doesn’t require any changes in your app itself: Our tests are running on Amazon Web Services (AWS), so in general, it doesn’t matter if you run one job for 20 minutes or four jobs for five minutes each. The cost will be practically identical. Instead of running the tests in parallel as part of the same job, we can split them into parallel jobs. That way, each job gets an isolated environment, and won’t share resources or state.</p><p>Here is how you do it:</p><ol><li>GitLab offers a feature that splits one job into multiple jobs. In your gitlab-ci.yml file, add a parallel keyword, with the number you want to split your tests to:</li></ol><pre>unit_tests:<br>  parallel: 5<br>  script:<br>    - python -m pytest</pre><p>This adds two environment variables to your jobs: CI_NODE_INDEX and CI_NODE_TOTAL. GitLab makes sure the CI_NODE_INDEX changes for every sub-job it runs.</p><p>2. Install <a href="https://pypi.org/project/pytest-test-groups/">pytest-test-groups</a> in your project dev environment:<br>pip install pytest-test-groups</p><p>3. When running your tests, use: pytest --test-group-count=$CI_NODE_TOTAL --test-group=$CI_NODE_INDEX</p><p>4. Done! With almost no setup and no time, you managed to split your job and run the tests in parallel.</p><p>We are running our pipelines on GitLab. But there are also similar solutions <a href="https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix">for GitHub actions</a>.</p><h3>Truncate &gt; drop and create</h3><p>A lot of our tests use the same table structure. To have a clean state for every test, we used to drop the database before each test and create a fresh one. After running SQLTap, we realized this operation takes time. As it turns out, it’s cheaper for the DB to truncate all the tables one by one, instead of dropping the entire DB.</p><p>Here is a sample of 204 tests when dropping &amp; creating the DB:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/0*AIxwm29od4uvVAVv" /></figure><p>and here are the same tests, when truncating the tables instead:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/0*jYXJDYpSUJIkcxgT" /></figure><p>That’s an 82% decrease for this single step!</p><p>Here is how you can achieve that:</p><ol><li>Move the creation of the DB to the setup of the test suite. You can do that using pytest’s fixture with scope=session.</li><li>In the setup of each test, truncate all the tables instead of dropping them:</li></ol><pre>for table in Base.metadata.tables.keys():<br>  session.execute(f&quot;TRUNCATE TABLE {table}&quot;)</pre><p>This syntax uses SQLAlchemy for getting the tables’ names, but you can plug in whatever you want.</p><h3>Where do you go from here?</h3><p>What I’ve covered is just a fraction of all the things we did. There are a lot of other ways to make sure your CI pipeline is blazing fast. For us it was a very exciting journey — we managed to reduce the pipeline’s time by more than 50% percent! Ask yourself: What other things can you do to reduce the pipelines’ time?</p><p>It will pay off big time!</p><h4>For more insights from Claroty, visit the <a href="https://claroty.com/blog/">Claroty Blog</a>.</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6d281ca8ba4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/claroty/four-easy-ways-to-speed-up-your-ci-cd-pipeline-a6d281ca8ba4">Four Easy Ways to Speed Up Your CI/CD Pipeline</a> was originally published in <a href="https://medium.com/claroty">Claroty</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>