<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Falco – Security-Concept</title><link>https://v0-43--falcosecurity.netlify.app/tags/security-concept/</link><description>Recent content in Security-Concept on Falco</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Mon, 11 Mar 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://v0-43--falcosecurity.netlify.app/tags/security-concept/feed.xml" rel="self" type="application/rss+xml"/><item><title>Blog: Preventing attacker persistence with Falco on AWS</title><link>https://v0-43--falcosecurity.netlify.app/blog/aws-detection/</link><pubDate>Mon, 11 Mar 2024 00:00:00 +0000</pubDate><guid>https://v0-43--falcosecurity.netlify.app/blog/aws-detection/</guid><description>
&lt;p&gt;I recently read an &lt;a href="https://medium.com/@MorattiSec/the-crow-flies-at-midnight-exploring-red-team-persistence-via-aws-lex-chatbots-b3de1edb7893"&gt;interesting blog&lt;/a&gt; on how hackers could use a Lambda function alongside Lex to establish persistence in an AWS account. For those unfamiliar with the term, persistence is when attackers leverage some technique to retain access to systems without being detected. A &lt;a href="https://www.nbcnews.com/tech/security/chinese-hackers-cisa-cyber-5-years-us-infrastructure-attack-rcna137706"&gt;recent news article&lt;/a&gt; cited a study that reported that some Chinese hackers have lurked in systems for up to FIVE YEARS! Luckily for all of us, Falco can be used to detect the exact scenario detailed in the blog and immediately raise an alert.&lt;/p&gt;
&lt;p&gt;The blog detailed how an attacker who has gained access to an AWS account could modify an existing Lex-based Lambda function to provide a set of AWS credentials. In short, the attacker modified the function of the Lex-based chatbot to respond whenever a secret phrase was entered with the Lambda’s AWS key ID and secret key.&lt;/p&gt;
&lt;p&gt;The author notes there are several ways to establish persistence on AWS, and maybe this wasn’t the most practical, but I still found it a fun exercise. It got me thinking: How could Falco help here? My immediate thought was to use Falco’s &lt;a href="https://github.com/falcosecurity/plugins/blob/master/plugins/cloudtrail/README.md"&gt;AWS Cloudtrail plugin&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The plugin, as the name implies, ingests Cloudtrail events. The events can be evaluated against a &lt;a href="https://github.com/falcosecurity/plugins/blob/master/plugins/cloudtrail/rules/aws_cloudtrail_rules.yaml#L237,L252"&gt;set of rules&lt;/a&gt; to alert engineers of any suspicious activity. There are currently just over 20 different rules that can be assessed. They include scenarios like creating new users, having someone log into the root account without MFA, changing permissions on an S3 bucket, and, most relevant to our discussion here, modifying a Lambda function.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;- &lt;span style="color:#008000;font-weight:bold"&gt;rule&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;Update Lambda Function Code&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;desc&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;Detect updates to a Lambda function code.&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;condition&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;ct.name=&amp;#34;UpdateFunctionCode20150331v2&amp;#34; and not ct.error exists&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;output&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;The code of a Lambda function has been updated.&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;(requesting user=%ct.user,&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;requesting IP=%ct.srcip,&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;AWS region=%ct.region,&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;lambda function=%ct.request.functionname)&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;priority&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;WARNING&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;tags&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- cloud&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- MITRE_TA0003_persistence&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- aws_lambda&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;source&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;aws_cloudtrail&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Alternatively, you could create custom rules based on a whole list of AWS CloudTrail events. In the below Falco rule, we referenced the Cloudtrail event name &lt;a href="https://gist.github.com/pkazi/8b5a1374771f6efa5d55b92d8835718c#file-cloudtraileventnames-list-L2882"&gt;UpdateFunctionCode20150331v2&lt;/a&gt;. Over 3000 event names can be used with Falco for deep incident response and forensics in the cloud.&lt;/p&gt;
&lt;p&gt;So, in the scenario above, whenever the attacker modifies the function, an entry is written to the Cloudtrail logs (note that Cloudtrail is enabled by default, so no extra work is needed to get it running). Those logs would be immediately forwarded to Falco via the Cloudtrail plugin. Falco would evaluate the event against the ruleset and fire off an alert that the rule had been violated.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt; The code of a Lambda function has been updated.
(requesting user=mikegcoleman, requesting IP=10.0.01, AWS region=us-west-1,lambda function=AirlinesBusinessLogic)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Upon receiving the alert, an AWS engineer could review whether or not the change had been authorized and act accordingly.&lt;/p&gt;
&lt;p&gt;Now, it’s important to note that there are other ways that Lambda functions can be stored. For instance, the function's code can be zipped up and then stored in an S3 bucket. The rules we used above wouldn't cover this scenario. You could very likely craft a rule to ensure that a bucket’s contents have not been modified. We will save that for another blog.&lt;/p&gt;
&lt;p&gt;The &lt;a href="https://github.com/falcosecurity/plugins/"&gt;Falco plugins repository&lt;/a&gt; includes the AWS Cloudtrail plugin and plugins for &lt;a href="https://github.com/falcosecurity/plugins/tree/master/plugins/okta"&gt;Okta&lt;/a&gt;, &lt;a href="https://github.com/falcosecurity/plugins/tree/master/plugins/github"&gt;GitHub&lt;/a&gt;, &lt;a href="https://github.com/falcosecurity/plugins/tree/master/plugins/gcpaudit"&gt;Google Cloud&lt;/a&gt;, and more. In fact, I recently published a &lt;a href="https://github.com/falcosecurity/plugins/blob/master/plugins/gcpaudit/walkthrough.md"&gt;walkthrough&lt;/a&gt; on how to use the Google Cloud plugin. Be sure to check it if you’d like to learn more about how plugins are installed and configured.&lt;/p&gt;</description></item><item><title>Blog: Automate Kubernetes Network Security with Falco Talon</title><link>https://v0-43--falcosecurity.netlify.app/blog/falco-network-security/</link><pubDate>Fri, 09 Feb 2024 00:00:00 +0000</pubDate><guid>https://v0-43--falcosecurity.netlify.app/blog/falco-network-security/</guid><description>
&lt;img src="https://v0-43--falcosecurity.netlify.app/blog/falco-network-security/falco-network-featured_hu_4092a71b5ae627b3.png" width="640" height="366"/>&lt;ul&gt;
&lt;li&gt;Falco Talon Repository: &lt;a href="https://github.com/Falco-Talon/falco-talon"&gt;https://github.com/Falco-Talon/falco-talon&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Falco Talon Documentation: &lt;a href="https://docs.falco-talon.org/"&gt;https://docs.falco-talon.org/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="card card-sm pageinfo pageinfo-warning my-4"&gt;
&lt;div class="card-body"&gt;
&lt;div class="card-text"&gt;
&lt;p&gt;Falco Talon is currently under active development and remains in the alpha stage; therefore, breaking changes may occur at any time, and the documentation may not always be up to date.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Setting up robust network security in Kubernetes is a challenge that demands both precision and adaptability. NetworkPolicy offers the potential for highly specific network configurations, enabling or blocking traffic based on a comprehensive set of criteria. However, the dynamic nature of network topologies and the complexities of managing policy implementations present ongoing challenges. The need for constant policy updates, especially in response to changing threat landscapes, introduces risks such as the potential for misconfiguration and the unintended dropping of packets.&lt;/p&gt;
&lt;h2 id="the-challenge-of-ip-based-network-policies"&gt;The Challenge of IP-Based Network Policies&lt;/h2&gt;
&lt;p&gt;Building network policies around IP addresses is notoriously challenging. For instance, threat feeds, which list known malicious IP addresses, are constantly changing. An IP address associated with a malicious entity one week might be reassigned and deemed safe the next. This fluidity necessitates an agile approach to network policy management, integrating solutions like NetworkSets to dynamically update policies based on the latest intelligence. However, the sheer volume of threat intelligence feeds – from Tor IP lists to cryptomining blocklists – complicates this integration, making it a daunting task to maintain accurate network controls.&lt;/p&gt;
&lt;p&gt;Here, Falco Talon emerges as a transformative solution. By leveraging Falco's detection capabilities, such as identifying &lt;a href="https://thomas.labarussias.fr/falco-rules-explorer/?hash=0d2e8a0dd3369a030f7acfaab682ad92"&gt;Outbound Connections to C2 Servers&lt;/a&gt;, Falco Talon can instantly update Kubernetes network policies to block all egress traffic except allowed CIDR ranges. This is facilitated through the &lt;a href="https://docs.falco-talon.org/docs/actionners/list/#kubernetesnetworkpolicy"&gt;kubernetes:networkpolicy&lt;/a&gt; Talon action, demonstrating a seamless integration of dynamic threat detection with network policy enforcement.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;- action: Disable outbound connections
actionner: kubernetes:networkpolicy
parameters:
allow:
- &amp;#34;192.168.1.0/24&amp;#34;
- &amp;#34;172.17.0.0/16&amp;#34;
- &amp;#34;10.0.0.0/32&amp;#34;
- rule: Suspicious outbound connection
match:
rules:
- Outbound Connections to C2 Servers
actions:
- action: Disable outbound connections
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;While this would certainly block the egress network connections, it’s not really convenient for some organizations as it’s a scorched-earth approach to blocking traffic but still relies on an IP-based allowlist on each Talon rule - rather than blocking the actual suspicious IP address specified in the Falco rule. Instead, we will propose the use of labels as a response action in Talon to better isolate network traffic at runtime.&lt;/p&gt;
&lt;h2 id="shifting-from-ips-to-labels-for-network-security"&gt;Shifting from IPs to Labels for Network Security&lt;/h2&gt;
&lt;p&gt;While IP-based blocking is effective in response to specific threats detected by Falco, it's not the most scalable solution for ongoing network policy management in production environments. An alternative approach focuses on using labels to create quarantine-style network policies. This method involves configuring a network policy that applies a default-deny stance on all ingress and egress traffic for pods matching certain labels, effectively isolating potentially compromised workloads. This can easily be achieved with the below one-liner:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;kubectl label pod &amp;lt;pod-name&amp;gt; -n &amp;lt;namespace-name&amp;gt; quarantine=true
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This is certainly a cleaner approach than the previous enforced network policy implementation, but the challenge here is the manual process of labeling those suspected workloads, which can be cumbersome and slow in response to emerging threats. How many minutes will it take our security team to enforce this label action, and what happens if this happens over the weekend?&lt;/p&gt;
&lt;p&gt;Falco Talon addresses this gap with its &lt;a href="https://docs.falco-talon.org/docs/actionners/list/#kuberneteslabelize"&gt;kubernetes:labelize&lt;/a&gt; response action. Upon detecting a threat, such as the &lt;a href="https://thomas.labarussias.fr/falco-rules-explorer/?hash=3f01c102c6d26af968d5eb6b6777085d"&gt;Detect outbound connections to common miner pool ports&lt;/a&gt;, Talon can automatically apply a &lt;code&gt;quarantine:true&lt;/code&gt; label to the affected pod, triggering the enforcement of the quarantine network policy in real-time. This capability not only enhances the speed and efficiency of response actions but also underscores the power of integrating dynamic threat detection with network policy enforcement.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;- action: Quarantine Pod in Network Policy
actionner: kubernetes:labelize
parameters:
labels:
quarantine: true
- rule: Suspicious outbound connection
match:
rules:
- Detect outbound connections to common miner pool ports
actions:
- action: Quarantine Pod in Network Policy
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;While Talon can apply the label, you still need a component that will enforce the quarantine. Most CNI's can do this, but for the purpose of this blog I'll add an example with Calico:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;apiVersion: projectcalico.org/v3
kind: GlobalNetworkPolicy
metadata:
name: quarantine
spec:
selector: quarantine == &amp;#34;true&amp;#34;
ingress:
- action: Deny
source: {}
destination: {}
egress:
- action: Deny
source: {}
destination: {}
types:
- Ingress
- Egress
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;The integration of Falco Talon into Kubernetes network security strategies represents a significant advancement in the field. By automating the enforcement of network policies based on real-time threat detection, Falco Talon simplifies the complexities associated with managing network security in a constantly evolving landscape. Whether responding to immediate threats through IP-based policies or proactively isolating workloads with label-based quarantine policies, Falco Talon provides a flexible, powerful tool for enhancing the security and resilience of Kubernetes environments. As organizations navigate the challenges of cloud-native security, solutions like Falco Talon offer a beacon of adaptability and effectiveness, ensuring that network security keeps pace with the dynamic nature of containerized deployments.&lt;/p&gt;</description></item><item><title>Blog: Install and Test Atomic Red in Kubernetes</title><link>https://v0-43--falcosecurity.netlify.app/blog/falco-atomic-red/</link><pubDate>Tue, 12 Dec 2023 00:00:00 +0000</pubDate><guid>https://v0-43--falcosecurity.netlify.app/blog/falco-atomic-red/</guid><description>
&lt;p&gt;In cloud-native environments, where applications scale up and down much faster than traditional monolithic application architectures, the ability to proactively identify and respond to threats in real time is paramount. As more organizations embrace cloud-native architectures for application delivery, more robust security measures need to be introduced. In this blog post, we delve into the dynamic realm of Kubernetes threat detection by exploring how open source Falco can seamlessly detect Atomic Red Team tests in real time within Kubernetes environments.&lt;/p&gt;
&lt;p&gt;Atomic Red Team is a powerful framework designed to simulate real-world attacks, providing organizations with a controlled environment to validate the effectiveness of their security measures. We take this a step further by deploying Atomic Red to Kubernetes with a single command, creating a realistic testing ground for evaluating the responsiveness of Falco.&lt;/p&gt;
&lt;p&gt;Our journey begins with the effortless deployment of Atomic Red to Kubernetes, showcasing the simplicity and efficiency of orchestrating security testing within containerized environments. Once deployed, we invoke specific Atomic Red Team tests, simulating a range of threat scenarios. The true test lies in Falco's ability to detect these threats in line with the MITRE ATT&amp;amp;CK framework, a globally-recognized matrix mapping adversary techniques to defensive tactics.&lt;/p&gt;
&lt;p&gt;This exploration is not just about identifying threats; it's a collaborative effort to enhance Falco's coverage. Should we identify any gaps in detection, we dive deeper, revising the executed techniques and crafting custom rules. This iterative process aims to extend our MITRE ATT&amp;amp;CK coverage, aligning Falco with the industry's best practices for threat detection and mitigation.&lt;/p&gt;
&lt;h2 id="deploying-atomic-red-team"&gt;Deploying Atomic Red Team&lt;/h2&gt;
&lt;p&gt;To avoid any potential service disruption in production environments, we recommend installing Atomic Red in a test lab environment, or at least a staging environment of Kubernetes. We have a step-by-step video for installing Atomic Red on &lt;a href="https://www.youtube.com/watch?v=5QjGnHGnxxo"&gt;Youtube&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Before we start the deployment, remember to create the atomic-red network namespace.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;kubectl create ns atomic-red
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;A single pod will be deployed with privileged set to true.
Atomic Red requires admin-level securityContext to perform certain actions that require elevated permissions.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;kubectl apply -f - &amp;lt;&amp;lt;EOF&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;apiVersion&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;apps/v1&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;kind&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;Deployment&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;metadata&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;name&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;atomicred&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;namespace&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;atomic-red&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;labels&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;app&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;atomicred&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;spec&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;replicas&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#666"&gt;1&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;selector&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;matchLabels&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;app&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;atomicred&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;template&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;metadata&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;labels&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;app&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;atomicred&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;spec&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;containers&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;- &lt;span style="color:#008000;font-weight:bold"&gt;name&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;atomicred&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;image&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;issif/atomic-red:latest&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;imagePullPolicy&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#b44"&gt;&amp;#34;IfNotPresent&amp;#34;&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;command&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;[&lt;span style="color:#b44"&gt;&amp;#34;sleep&amp;#34;&lt;/span&gt;,&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#b44"&gt;&amp;#34;3560d&amp;#34;&lt;/span&gt;]&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;securityContext&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;privileged&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#a2f;font-weight:bold"&gt;true&lt;/span&gt;&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;nodeSelector&lt;/span&gt;:&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#bbb"&gt; &lt;/span&gt;&lt;span style="color:#008000;font-weight:bold"&gt;kubernetes.io/os&lt;/span&gt;:&lt;span style="color:#bbb"&gt; &lt;/span&gt;linux&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;EOF&lt;span style="color:#bbb"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note: This creates a pod called 'atomicred' in the 'atomic-red' network namespace.
You can check on the state of the installation with the below command:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;kubectl get pods -n atomic-red
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;If you ever want to remove the Atomic Red project from your Kubernetes cluster, simply run:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;kubectl delete deployment atomicred -n atomic-red
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;img src="images/atomic-install.png" alt="" loading="lazy" /&gt;
&lt;/p&gt;
&lt;h2 id="familiarize-yourself-with-atomic-red-tests"&gt;Familiarize Yourself with Atomic Red Tests&lt;/h2&gt;
&lt;p&gt;Once deployed, you will need to shell into the Atomic Red pod to perform the following test scenarios.
This might seem a little confusing, but Atomic Red was developed with PowerShell in mind, so the below instructions ask the user to shell into a container, and once they are in the running pod, they must run Powershell to import and invoke the various Atomic Test Scenarios.&lt;/p&gt;
&lt;p&gt;Once you are familiar with this logic, you’ll find Atomic Red is a truly simple security simulation tool.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;kubectl exec -it -n atomic-red deploy/atomicred -- bash
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;As mentioned, you need to run Powershell once you are in the Atomic Red pod:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;pwsh
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now, you can finally load the Atomic Red Team module:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;Import-Module &amp;#34;~/AtomicRedTeam/invoke-atomicredteam/Invoke-AtomicRedTeam.psd1&amp;#34; -Force
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;img src="images/import.png" alt="" loading="lazy" /&gt;
&lt;/p&gt;
&lt;p&gt;Check the details of the TTPs:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;Invoke-AtomicTest T1070.004 -ShowDetails
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;img src="images/show-details.png" alt="" loading="lazy" /&gt;
&lt;/p&gt;
&lt;p&gt;Check the prerequisites to ensure the test conditions are right:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;Invoke-AtomicTest T1070.004 -GetPreReqs
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can see in the below screenshot, there are no prerequisites required to perform these tests.
As a result, we can invoke the bulk file deletion test scenario.&lt;/p&gt;
&lt;p&gt;&lt;img src="images/prereqs.png" alt="" loading="lazy" /&gt;
&lt;/p&gt;
&lt;p&gt;Remove the feature flags to execute the test simulation.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;Invoke-AtomicTest T1070.004
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This test will attempt to delete individual files or individual directories. When we have Falco installed, this Atomic test should trigger the 'Warning bulk data removed from disk' rule by default. Next, we discuss Falco’s installation.&lt;/p&gt;
&lt;p&gt;&lt;img src="images/file-deletion.png" alt="" loading="lazy" /&gt;
&lt;/p&gt;
&lt;p&gt;Congrats! Now that we know how Atomic Red works, let’s install Falco and run it side-by-side against Atomic Red to prove it detects these tests in real time. We will need to open two terminal windows to see the real-time response detections.&lt;/p&gt;
&lt;h2 id="installing-testing-falco"&gt;Installing &amp;amp; Testing Falco&lt;/h2&gt;
&lt;p&gt;For this lab guide, we can install Falco via Helm on a fixed version prior to the segregation of rules into different rules feeds, such as 'incubating', 'sandbox' and 'stable'. The reason we are doing this is to ensure all Falco rules are accessible in our lab scenario. To use the latest version of Falco, simply remove the '--version' feature flag from the Helm install script.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;helm install falco falcosecurity/falco --namespace falco \
--create-namespace \
--set tty=true \
--version 3.3.0
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;img src="images/install-falco.png" alt="" loading="lazy" /&gt;
&lt;/p&gt;
&lt;p&gt;Just like the Atomic Red deployment, we need to monitor the progress of the Falco installation. The pods will change state a few times during the installation, but should eventually all be in a 'RUNNING' status after about a minute or so.&lt;/p&gt;
&lt;p&gt;Please use the below command to check on the status change of Falco pods:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;kubectl get pods -n falco -w
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Once Falco is installed, we can track the events as they are generated using the following command in the second terminal window.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;kubectl logs -f --tail=0 -n falco -c falco -l app.kubernetes.io/name=falco
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Jump back into the first terminal window and re-run the bulk file deletion Atomic Test - 'T1070.004':&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;Invoke-AtomicTest T1070.004
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;img src="images/falco-detection1.png" alt="" loading="lazy" /&gt;
&lt;/p&gt;
&lt;p&gt;You’re going to identify certain noise in the detection rules. For example, all Atomic Tests are run under the 'Root' user, therefore, we will always get a detection for scripts running under root. To ignore this noise, let’s instead just check for the specific Falco rule we are looking to detect:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;kubectl logs -f --tail=0 -n falco -c falco -l app.kubernetes.io/name=falco | grep &amp;#39;Bulk data has been removed from disk&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;img src="images/falco-detection2.png" alt="" loading="lazy" /&gt;
&lt;/p&gt;
&lt;p&gt;Hurrah! We see the exact detection matching the context of the Atomic Red test scenario.
Let’s move on to the next Atomic Test to invoke. There are a bunch of test scenarios for Linux that you can test out today.&lt;/p&gt;
&lt;p&gt;Check out the list on the official &lt;a href="https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/Indexes/Indexes-Markdown/linux-index.md"&gt;Atomic Red Team Github project&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="t1556-003-modify-authentication-process"&gt;T1556.003 Modify Authentication Process&lt;/h2&gt;
&lt;p&gt;In this scenario, Atomic Red generates three Pluggable Authentication Modules (PAM): two malicious PAM rules for Linux and FreeBSD, as well as a malicious PAM module for Linux. These programs can be used to open and read sensitive file content, and we can agree that they are non-trusted programs. Again, we have an &lt;a href="https://thomas.labarussias.fr/falco-rules-explorer/?source=syscalls&amp;amp;hash=5116b3ca0c5fad246cc41ca67938a315"&gt;out-of-the-box rule&lt;/a&gt; for these activities:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;kubectl logs -f --tail=0 -n falco -c falco -l app.kubernetes.io/name=falco | grep &amp;#39;Sensitive file opened for reading by non-trusted program&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now, it's time to simulate our threat:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;Invoke-AtomicTest T1556.003
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;img src="images/pam-auth.png" alt="" loading="lazy" /&gt;
&lt;/p&gt;
&lt;h2 id="t1036-005-masquerading-match-legitimate-name-or-location"&gt;T1036.005 Masquerading: Match Legitimate Name or Location&lt;/h2&gt;
&lt;p&gt;This test scenario executes a process from a directory masquerading as the current parent directory.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;kubectl logs -f --tail=0 -n falco -c falco -l app.kubernetes.io/name=falco | grep &amp;#39;Executing binary not part of base&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now, it's time to simulate our threat.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;Invoke-AtomicTest T1036.005
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can see that in the left terminal window, there is an echo message in the terminal saying '”Hello from the Atomic Red Team.”' Any string output in the command line can also be detected in Falco’s outputs.&lt;/p&gt;
&lt;p&gt;&lt;img src="images/masquerading.png" alt="" loading="lazy" /&gt;
&lt;/p&gt;
&lt;h2 id="t1070-002-indicator-removal-on-host"&gt;T1070.002 Indicator Removal on Host&lt;/h2&gt;
&lt;p&gt;Adversaries may clear system logs to hide evidence of an intrusion. macOS and Linux both keep track of system or user-initiated actions via system logs. The majority of native system logging is stored under the '/var/log/' directory.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;kubectl logs -f --tail=0 -n falco -c falco -l app.kubernetes.io/name=falco | grep &amp;#39;Log files were tampered&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now, it's time to simulate our threat:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;Invoke-AtomicTest T1070.002
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;img src="images/tampering.png" alt="" loading="lazy" /&gt;
&lt;/p&gt;
&lt;h2 id="t1070-003-clear-command-history"&gt;T1070.003 Clear Command History&lt;/h2&gt;
&lt;p&gt;In addition to clearing system logs, an adversary may clear the command history of a compromised account to conceal the actions undertaken during an intrusion. Various command interpreters keep track of the commands users type in their terminals so that users can retrace what they've done.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;kubectl logs -f --tail=0 -n falco -c falco -l app.kubernetes.io/name=falco | grep &amp;#39;Shell history had been deleted or renamed&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now, it's time to simulate our threat:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;Invoke-AtomicTest T1070.003
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can see from the below screenshot that four different operations were performed. Therefore, four unique Falco detections were triggered on those individual attempts to clear the command line history.&lt;/p&gt;
&lt;p&gt;&lt;img src="images/shell-history.png" alt="" loading="lazy" /&gt;
&lt;/p&gt;
&lt;h2 id="t1014-loadable-kernel-module-based-rootkit"&gt;T1014 Loadable Kernel Module Based Rootkit&lt;/h2&gt;
&lt;p&gt;Adversaries may use Rootkits to hide the presence of programs, files, network connections, services, drivers, and other system components. Rootkits are programs that hide the existence of malware by intercepting/hooking and modifying operating system API calls that supply system information.&lt;/p&gt;
&lt;p&gt;Rootkits may reside at the user or kernel level in the operating system or lower, to include a hypervisor, Master Boot Record, or System Firmware. As such, it’s critical that Falco detects Rootkits in real time.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;kubectl logs -f --tail=0 -n falco -c falco -l app.kubernetes.io/name=falco | grep &amp;#39;Linux Kernel Module injection from container detected&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now, it's time to simulate our threat:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;Invoke-AtomicTest T1014
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Falco is detecting the Linux kernel module injection attempt, whether it was a successful execution or not.&lt;/p&gt;
&lt;p&gt;&lt;img src="images/rootkit.png" alt="" loading="lazy" /&gt;
&lt;/p&gt;
&lt;h2 id="t1037-004-custom-rule-boot-initialization-rc-scripts"&gt;T1037.004 [CUSTOM RULE] Boot Initialization - RC Scripts&lt;/h2&gt;
&lt;p&gt;Adversaries may establish persistence by modifying RC scripts that are executed during a Unix-like system’s startup. These files allow system administrators to map and start custom services at startup for different run levels. RC scripts require root privileges to modify.&lt;/p&gt;
&lt;p&gt;Command to simulate the 'T1037.004' test:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;Invoke-AtomicTest T1037.004
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You’ll notice that this is the first test where we don’t get a useful Falco detection related to the threat. As a result, we need to create a 'custom-rules.yaml' file with the custom Falco rule for detecting boot initialization scripts.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;cat &amp;gt; custom-rules.yaml &amp;lt;&amp;lt;EOF
customRules:
custom_rules.yaml: |-
- rule: Base64-encoded Python Script Execution
desc: &amp;gt;
This rule detects base64-encoded Python scripts on command line arguments.
condition: &amp;gt;
spawned_process and (
((proc.cmdline contains &amp;#34;python -c&amp;#34; or proc.cmdline contains &amp;#34;python3 -c&amp;#34; or proc.cmdline contains &amp;#34;python2 -c&amp;#34;) and (proc.cmdline contains &amp;#34;echo&amp;#34; or proc.cmdline icontains &amp;#34;base64&amp;#34;)) or ((proc.cmdline contains &amp;#34;import&amp;#34; and proc.cmdline contains &amp;#34;base64&amp;#34; and proc.cmdline contains &amp;#34;decode&amp;#34;)))
output: &amp;gt;
Potentially malicious Python script encoded on command line
(proc.cmdline=%proc.cmdline user.name=%user.name proc.name=%proc.name
proc.pname=%proc.pname evt.type=%evt.type gparent=%proc.aname[2]
ggparent=%proc.aname[3] gggparent=%proc.aname[4] evt.res=%evt.res
container.id=%container.id container.name=%container.name file=%fd.name)
priority: warning
tags:
- T1037.004
- MITRE_Defense_Evasion
source: syscall
EOF
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Adversaries can establish persistence by adding a malicious binary path or shell commands to 'rc.local', 'rc.common', and other RC scripts specific to the Unix-like distribution. Upon reboot, the system executes the script's contents as root, resulting in persistence.&lt;/p&gt;
&lt;p&gt;Let’s try upgrading Falco to reflect the 'custom-rules.yaml' file:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;helm upgrade falco falcosecurity/falco \
-n falco \
--set tty=true \
--version 3.3.0 \
--reuse-values \
-f custom-rules.yaml
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Granted, there’s no obvious formatting issues when creating the 'custom-rules.yaml' manifest, you should be able to successfully upgrade Falco and the pods should be in a 'RUNNING' state. If there was an issue with the custom rules file, the Falco pod state will likely change to 'CrashLoopBackOff'.&lt;/p&gt;
&lt;p&gt;&lt;img src="images/falco-upgrade.png" alt="" loading="lazy" /&gt;
&lt;/p&gt;
&lt;p&gt;Let’s see if we detect the Atomic test after upgrading Falco with the newly-created custom rule.
Remember to have Falco running in a second terminal window with the following command:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;kubectl logs -f --tail=0 -n falco -c falco -l app.kubernetes.io/name=falco | grep &amp;#39;Potentially malicious Python script&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We can simulate the technique ID 'T1037.004' one last time:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;Invoke-AtomicTest T1037.004
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;img src="images/python.png" alt="" loading="lazy" /&gt;
&lt;/p&gt;
&lt;p&gt;Hurrah! We detected the boot initialization scripts with the above command. To recap, adversaries looking to abuse those RC scripts are especially effective for lightweight Unix-like distributions using the root user as default, such as IoT or embedded systems. If you are wondering why the Falco rule was specifically looking at Base64-encoded Python scripts, well, we need to look back at the details associated with the Atomic test simulation.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;Invoke-AtomicTest T1037.004 -ShowDetails
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We can see from the command that it is using the 'python3' command to run Python scripts. However, the script itself is executed as a base64-encoded string to evade some traditional detection tools.&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;In conclusion, this article serves as a comprehensive guide aimed at enhancing knowledge in cloud-native threat simulation and detection. Its primary audience includes security practitioners, DevOps teams, and anyone involved in securing Kubernetes environments. The focal point is the utilization of Atomic Red for deploying test simulations aligned with the MITRE ATT&amp;amp;CK framework and leveraging Falco to detect these threats in real time.&lt;/p&gt;
&lt;p&gt;The article not only illustrates how Atomic Red can be instrumental in improving the rules shipped with Falco, but also emphasizes its role in identifying potential gaps in coverage. By doing so, it offers a valuable resource for customers seeking alternative methods to validate the effectiveness of their Falco rules and, consequently, fortify the security posture of their Kubernetes deployments.&lt;/p&gt;
&lt;p&gt;The notion of creating a realistic testing ground for evaluating the responsiveness of Falco is particularly beneficial for DevOps teams. This facet addresses the need for hands-on experience in threat simulation, adversarial approaches, and understanding the intricacies of the MITRE ATT&amp;amp;CK framework. In providing this practical testing environment, the article empowers DevOps teams to proactively enhance their security measures, ensuring robust coverage and responsiveness in the dynamic landscape of Kubernetes threat detection.&lt;/p&gt;</description></item></channel></rss>