<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>security Archives | Cloudar</title>
	<atom:link href="https://cloudar.be/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>https://cloudar.be/tag/security/</link>
	<description>100% Focus On AWS // 100% Customer Obsession</description>
	<lastBuildDate>Thu, 09 Jan 2025 10:13:41 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Achievement Unlocked: Global Security &#038; Compliance Acceleration on AWS</title>
		<link>https://cloudar.be/awsblog/achievement-unlocked-global-security-compliance-acceleration-on-aws/</link>
		
		<dc:creator><![CDATA[Team Cloudar]]></dc:creator>
		<pubDate>Thu, 19 Dec 2024 10:08:36 +0000</pubDate>
				<category><![CDATA[AWS Blog]]></category>
		<category><![CDATA[Cloudar news]]></category>
		<category><![CDATA[Company news]]></category>
		<category><![CDATA[Compliance]]></category>
		<category><![CDATA[Managed Services]]></category>
		<category><![CDATA[Security & Compliance]]></category>
		<category><![CDATA[security]]></category>
		<guid isPermaLink="false">https://cloudar.be/?p=22511</guid>

					<description><![CDATA[<p>Achievement Unlocked: Global Security &#38; Compliance Acceleration on AWS Cloudar has achieved the AWS Global Security &#38; Compliance Acceleration (GSCA) certification, underscoring our commitment to providing secure, compliant cloud solutions. For AWS users, this milestone brings several benefits, helping them streamline operations, meet compliance requirements, and ensure the highest levels of security. &#160; About the [&#8230;]</p>
<p>The post <a href="https://cloudar.be/awsblog/achievement-unlocked-global-security-compliance-acceleration-on-aws/">Achievement Unlocked: Global Security &#038; Compliance Acceleration on AWS</a> appeared first on <a href="https://cloudar.be">Cloudar</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>Achievement Unlocked:<br />
Global Security &amp; Compliance Acceleration on AWS</h1>
<p><em>Cloudar has achieved the AWS Global Security &amp; Compliance Acceleration (GSCA) certification, underscoring our commitment to providing secure, compliant cloud solutions. For AWS users, this milestone brings several benefits, helping them streamline operations, meet compliance requirements, and ensure the highest levels of security.</em></p>
<p>&nbsp;</p>
<p><strong>About the AWS Global Security &amp; Compliance Acceleration Program</strong></p>
<p>AWS designed the GSCA program to support partners in strengthening the security and compliance of cloud environments. Through the GSCA program, we have gained access to advanced training, resources, and AWS experts, enabling us to fine-tune our security capabilities and stay ahead of ever-evolving threats.</p>
<p>This program emphasizes automation, governance, and continuous monitoring, empowering us to proactively address security challenges and scale securely in the cloud.</p>
<p>&nbsp;</p>
<p><strong>Enhanced security posture</strong></p>
<p>With this certification, Cloudar can provide customers with ready-to-go security solutions, customized to fit their unique requirements. From secure infrastructure setup to automated incident response, we can ensure your workloads are protected from day one.</p>
<p>By adhering to AWS’s best practices, we can ensure that your infrastructure is secure by design. We leverage tools like AWS Security Hub, Amazon GuardDuty and AWS Config to provide customers with continuous threat detection, rapid incident response, and real-time insights into security events. This means your business can identify and mitigate risks before they escalate.</p>
<p>&nbsp;</p>
<p><strong>Regulatory compliance</strong></p>
<p>Compliance is no longer an afterthought. Cloudar uses AWS-native tools to continuously monitor for regulatory compliance and offers pre-built templates to help meet industry standards, reducing the time and effort required to maintain compliance.</p>
<p>Whether your business operates in a heavily regulated industry like healthcare, finance, or government, the GSCA certification ensures that we can help you meet key regulatory requirements such as GDPR, HIPAA, SOC 2, and more.</p>
<p>&nbsp;</p>
<p><strong>Faster time-to-market:</strong></p>
<p>By automating security and compliance processes such as patch management, configuration drift detection, and log monitoring, we can significantly reduce the time it takes to implement secure, compliant workloads on AWS.</p>
<p>Cloudar ensures that our customers can maintain a high security posture without the overhead of manual intervention. This leads to lower operational costs and more efficient resource allocation, so you can focus on innovation and growth, while we handle the complexities of cloud security.</p>
<p>&nbsp;</p>
<p><strong>Cloudar helps you leverage the power of AWS Security</strong></p>
<p>Cloudar&#8217;s approach goes beyond simply implementing AWS’s built-in tools. We work closely with your teams to tailor solutions that fit your specific business needs, ensuring that you get the most out of the AWS cloud while keeping your data secure and compliant.</p>
<p>We design cloud architectures that follow AWS’s security best practices, but are customized to fit the scale, complexity, and compliance needs of your business.</p>
<p>Whether you&#8217;re migrating to the cloud or optimizing existing workloads, Cloudar ensures a smooth integration of AWS security services with your current operations.</p>
<p>But our support doesn’t stop after deployment: Cloudar continuously monitors your cloud environment, ensuring you stay compliant and secure as your business grows.</p>
<p>&nbsp;</p>
<p><strong>The Cloudar Difference</strong></p>
<p>At Cloudar, we understand that security and compliance aren’t just checkboxes &#8211; they’re critical to building trust with your customers and staying ahead in a competitive market.</p>
<p>By achieving the Global Security &amp; Compliance Acceleration on AWS, Cloudar once again proves that we are not just a partner, but a trusted ally in your cloud journey.</p>
<p>We provide peace of mind that your AWS workloads are not only running efficiently but are also secured against threats and aligned with the latest regulatory standards.</p>
<p>&nbsp;</p>
<p>If you’d like to learn more about how Cloudar can enhance your cloud security and compliance, or if you&#8217;re ready to take your AWS workloads to the next level, don’t hesitate to get in touch with our team today!</p>
<p>The post <a href="https://cloudar.be/awsblog/achievement-unlocked-global-security-compliance-acceleration-on-aws/">Achievement Unlocked: Global Security &#038; Compliance Acceleration on AWS</a> appeared first on <a href="https://cloudar.be">Cloudar</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Security Incident: Be Prepared &#8211; Memory Dumps</title>
		<link>https://cloudar.be/awsblog/security-incident-be-prepared-memory-dumps/</link>
					<comments>https://cloudar.be/awsblog/security-incident-be-prepared-memory-dumps/#respond</comments>
		
		<dc:creator><![CDATA[Koenraad de Boevé]]></dc:creator>
		<pubDate>Sun, 25 Nov 2018 08:43:45 +0000</pubDate>
				<category><![CDATA[AWS Blog]]></category>
		<category><![CDATA[ACL]]></category>
		<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Forensics]]></category>
		<category><![CDATA[Memory Dump]]></category>
		<category><![CDATA[security]]></category>
		<guid isPermaLink="false">https://cloudar.be/?p=9688</guid>

					<description><![CDATA[<p>Memory Dumps You just finished setting up your super-duper AWS environment.. Highly available &#38; Fault Tolerant: check! Backups in place: check! MFA enforced: check! Security Groups and NACLs: check! CloudTrail enabled: check! You even deserve bonus points for activating Amazon GuardDuty and putting AWS WAF &#38; Shield in front of your CloudFront distribution and loadbalancers. [&#8230;]</p>
<p>The post <a href="https://cloudar.be/awsblog/security-incident-be-prepared-memory-dumps/">Security Incident: Be Prepared &#8211; Memory Dumps</a> appeared first on <a href="https://cloudar.be">Cloudar</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2>Memory Dumps</h2>
<p>You just finished setting up your super-duper AWS environment..</p>
<p>Highly available &amp; Fault Tolerant: check!<br />
Backups in place: check!<br />
MFA enforced: check!<br />
Security Groups and NACLs: check!<br />
CloudTrail enabled: check!</p>
<p>You even deserve bonus points for activating Amazon GuardDuty and putting AWS WAF &amp; Shield in front of your CloudFront distribution and loadbalancers.<br />
Time to lean back with a bit of smugness, while you take a sip of your well-deserved cup of coffee.</p>
<p>Seems like you have covered all your bases, or have you?</p>
<p>One often overlooked topic is security incident response.<br />
While a lot of security incidents can (and should) be mitigated through automation,<br />
some incidents will require manual intervention, such as information and evidence gathering during and after a successful malicious attack on one of your instances.</p>
<p>Effective incident response and forensics require preparation, well ahead of time.<br />
It is critical to have your forensics and remediation tools readily available for whenever the proverbial shit hits the fan.<br />
Documenting your investigative steps and being able to execute them swiftly, will contribute to a well-controlled, thorough and effective investigation.</p>
<p>In this blog post, I&#8217;d like to focus on some of the first steps you might take in your investigation:</p>
<ul>
<li>Building a forensics workstation and  taking a memory dump of a compromised instance.</li>
<li>Preparation steps and tools, both for windows and linux.</li>
<li>The forensics investigation process.</li>
<li>An investigation of a real memory dump.</li>
</ul>
<p>Although some great tools are already available from <a href="https://www.threatresponse.cloud/" target="_blank" rel="noopener noreferrer">Threadresponse</a> (such as AWS_IR and Margarita Shotgun), we will build a solution ourselves, in order to gain a thorough knowledge on how the process works behind the scenes.<br />
Creating a memory dump is  something that  should be done immediately, as it provides a snapshot of the memory at the time of the attack.<br />
The dump can then be analyzed and used to build a timeline, improve security after the fact and optionally provide evidence for any follow up with law enforcement.</p>
<h3>Tools</h3>
<ul>
<li>Linux: LiME ( Linux Memory Extractor )</li>
<li>Windows: <a href="https://marketing.accessdata.com/ftkimager4.2.0" target="_blank" rel="noopener noreferrer">FTK</a> or <a href="https://belkasoft.com/get" target="_blank" rel="noopener noreferrer">Belkasoft Live  RamCapturer</a><br />
( both are free, but require registration, you get the download link in a mail )</li>
<li>Volatility</li>
</ul>
<h3>Preparation Steps</h3>
<h4>Create Quarantine and Forensic Security Groups</h4>
<ol>
<li><strong>Forensics Security Group.</strong><br />
This SG will be attached to your Forensics Workstation later on.</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true ">aws ec2 create-security-group --group-name ForensicsSG \
--description "Forensics SG" --vpc-id &lt;your vpc id&gt; \
--profile &lt;your profile&gt;</pre>
<p>This will output something like this:</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:default decode:true ">{
    "GroupId": "sg-22222222222222222"
}</pre>
<p>Now we use this GroupId to add an inbound rule that allows  SSH  connection towards our Forensics Workstation</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:default decode:true">aws ec2 authorize-security-group-ingress --group-id sg-22222222222222222 \
--protocol tcp --port 22 --cidr &lt;your cidr&gt; --profile &lt;your profile</pre>
<p>By default , outbound everything is allowed, and in this case, that is ok, so we leave it at that.</li>
<li><strong>Quarantine Security Group</strong><br />
This SG will be attached to the compromised instance, to isolate it from any network, except the forensics network.</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true">aws ec2 create-security-group --group-name QuarantineSG \
--description "Quarantine SG" --vpc-id &lt;your vpc id&gt; \
--profile &lt;your profile&gt;
</pre>
<p>Output will look similar to the following:</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true">{
    "GroupId": "sg-111111111111111111"
}</pre>
<p>Remove all rules from outbound ( egress )</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true">aws ec2 revoke-security-group-egress --group-id sg-11111111111111111 \
--ip-permissions '[{"IpProtocol": "-1","IpRanges": [{"CidrIp": "0.0.0.0/0"}],"Ipv6Ranges": [{"CidrIpv6": "::/0"}]}]' \
--profile &lt;your profile&gt;</pre>
<p>Add rules to allow access from the Forensics Security Group</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:default decode:true ">aws ec2 authorize-security-group-ingress --group-id sg-11111111111111111 \
--ip-permissions '[
    {"IpProtocol":"tcp","FromPort":22,"ToPort":22,"UserIdGroupPairs":[
        {"GroupId": "sg-22222222222222222","Description": "SSH access from the ForensicsSG"}
    ]},
    {"IpProtocol":"tcp","FromPort":4444,"ToPort":4444,"UserIdGroupPairs":[
        {"GroupId":"sg-22222222222222222","Description":"Access from the ForensicsSG for LiME dump over TCP"}
    ]},
    {"IpProtocol":"tcp","FromPort":3389,"ToPort":3389,"UserIdGroupPairs":[
        {"GroupId":"sg-22222222222222222","Description":"RDP access from the ForensicsSG"}
    ]}
    ]' \
--profile &lt;your profile&gt;</pre>
</li>
<li><strong>Create Isolation Functionality</strong><br />
Create lambda-execution-forensics-trust-policy.json file with following content:</p>
<pre class="theme:eclipse toolbar-overlay:false nums:false nums-toggle:false lang:default decode:true">{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": "lambda.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}</pre>
<p>Create the Lambda Execution role, forensics-lambda-exec-role, using the policy file you just created:</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false wrap:true lang:sh decode:true">aws iam create-role \
--role-name forensics-lambda-exec-role  \
--assume-role-policy-document file://lambda-execution-forensics-trust-policy.json \
--profile &lt;your profile&gt;</pre>
<p>The output should look like this:</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:default decode:true ">{
    "Role": {
        "AssumeRolePolicyDocument": {
            "Version": "2012-10-17", 
            "Statement": [
                {
                    "Action": "sts:AssumeRole", 
                    "Effect": "Allow", 
                    "Principal": {
                        "Service": "lambda.amazonaws.com"
                    }
                }
            ]
        }, 
        "RoleId": "AROAILWIMFHDIIGTDST7I", 
        "CreateDate": "2018-11-20T20:42:44Z", 
        "RoleName": "forensics-lambda-exec-role", 
        "Path": "/", 
        "Arn": "arn:aws:iam::111111111111:role/forensics-lambda-exec-role"
    }
}</pre>
<p>Create lambda-forensics-policy.json with following content:</p>
<pre class="theme:eclipse toolbar-overlay:false nums:false expand-toggle:false whitespace-after:1 lang:default decode:true">{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "logs:CreateLogStream",
                "logs:PutLogEvents",
                "logs:CreateLogGroup"
            ],
            "Resource": "arn:aws:logs:*:*:*",
            "Effect": "Allow"
        },
        {
            "Action": [
                "ec2:Describe*",
                "ec2:ModifyNetworkInterfaceAttribute",
                "ec2:ModifyInstanceAttribute"
            ],
            "Resource": "*",
            "Effect": "Allow"
        }
    ]
}</pre>
<p>Create the policy:</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false wrap-toggle:false expand-toggle:false lang:sh decode:true">aws iam create-policy --policy-name lambda-execute-forensics-policy \
--policy-document file://lambda-forensics-policy.json 
--profile &lt;your profile&gt;</pre>
<p>This will output something like this:</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:default decode:true">{
    "Policy": {
        "PolicyName": "lambda-execute-forensics-policy", 
        "PermissionsBoundaryUsageCount": 0, 
        "CreateDate": "2018-11-20T20:56:04Z", 
        "AttachmentCount": 0, 
        "IsAttachable": true, 
        "PolicyId": "ANPAIG23L72JCRWAQQEFE", 
        "DefaultVersionId": "v1", 
        "Path": "/", 
        "Arn": "arn:aws:iam::111111111111:policy/lambda-execute-forensics-policy", 
        "UpdateDate": "2018-11-20T20:56:04Z"
    }
}</pre>
<p>Attach the policy to the forensics-lambda-exec-role, using the ARN found in the output from the previous comand</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true">aws iam attach-role-policy --role-name forensics-lambda-exec-role \
--policy-arn arn:aws:iam::111111111111:policy/lambda-execute-forensics-policy \
--profile &lt;your profile&gt;</pre>
<p>Create index.py with following content:</p>
<pre class="theme:eclipse nums:false nums-toggle:false wrap-toggle:false expand-toggle:false lang:python decode:true">import json
import boto3
import os

ec2 = boto3.resource('ec2')
quarantine_sg = os.environ['QUARANTINE_SG']

def set_SecurityGroup(instance):
  oldsecuritygroups = {}
  interfaces = instance.network_interfaces
  for interface in interfaces:
    oldsecuritygroups[interface.id] =  interface.groups
    interface.modify_attribute(Groups = [quarantine_sg])

  return oldsecuritygroups

def lambda_handler(event, context):
  instance = ec2.Instance(event['instance_id'])
  # Remove current Security Groups
  orig_groups = set_SecurityGroup(instance)
  return {
    'statusCode': 200,
    'body': "OK",
    'replaced_sgs': orig_groups
  }

</pre>
<p>This function will replace all Security Groups on all attached network interfaces of an instance with the Quarantine Security Group we created earlier. When you discover that an instance is compromised, you can invoke this function, and it will isolate the instance.  It fetches the Security Group from the environment, and takes the instance id of the compromised instance as input as json in the following format:</p>
<pre class="theme:eclipse toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:default decode:true ">{
    "instance_id": "i-xxxxxxxxxxxxxxxxx"
}</pre>
<p>The function will output the removed Security Groups so you have a reference for later on.</p>
<p>zip the file to index.zip</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true ">zip index.zip index.py</pre>
<p>Create the Lambda function, using the IAM Policy ARN from the output of the role creation (forensics-lambda-exec-role)</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false wrap-toggle:false expand-toggle:false lang:sh decode:true">aws lambda create-function --function-name forensics-isolate-instance \
--zip-file fileb://index.zip \
--role arn:aws:iam::111111111111:role/forensics-lambda-exec-role \
--handler index.lambda_handler --runtime python3.6 \
--environment Variables={QUARANTINE_SG=sg-11111111111111111} \
--profile &lt;your profile&gt;</pre>
<p>OK, Done, now let s move on and create a forensics workstation.</li>
</ol>
<h4>Build a Forensics Workstation</h4>
<ol>
<li><strong>Create EC2 Instance Role for the forensics Workstation<br />
</strong>Create ec2-forensics-trust-policy.json file with following content:</p>
<pre class="theme:eclipse toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:default decode:true ">{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "Service": "ec2.amazonaws.com"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}</pre>
<p>Create the EC2 Instance role, ec2-forensics-role, using the Policy file you just created:</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true">aws iam create-role --role-name ec2-forensics-role \
--assume-role-policy-document file://ec2-forensics-trust-policy.json \
--profile &lt;your profile&gt;</pre>
<p>Output:</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:default decode:true">{
    "Role": {
        "AssumeRolePolicyDocument": {
            "Version": "2012-10-17", 
            "Statement": [
                {
                    "Action": "sts:AssumeRole", 
                    "Effect": "Allow", 
                    "Principal": {
                        "Service": "ec2.amazonaws.com"
                    }
                }
            ]
        }, 
        "RoleId": "AROAIGXSH7RCMPCVPY4QA", 
        "CreateDate": "2018-11-21T10:34:07Z", 
        "RoleName": "ec2-forensics-role", 
        "Path": "/", 
        "Arn": "arn:aws:iam::111111111111:role/ec2-forensics-role"
    }
}
</pre>
<p>Create ec2-forensics-policy.json with following content:</p>
<pre class="theme:eclipse toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:default decode:true">{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "AllowEC2InstanceEC2Forensics",
            "Effect": "Allow",
            "Action": [
                "ec2:Describe*",
                "ec2:AuthorizeSecurityGroupIngress",
                "ec2:ModifyVolumeAttribute",
                "ec2:CreateKeyPair",
                "ec2:ReportInstanceStatus",
                "ec2:ModifySnapshotAttribute",
                "ec2:RevokeSecurityGroupEgress",
                "ec2:ImportKeyPair",
                "ec2:CreateTags",
                "ec2:StopInstances",
                "ec2:RevokeSecurityGroupIngress",
                "ec2:AttachVolume",
                "ec2:ImportVolume",
                "ec2:ModifySubnetAttribute",
                "ec2:CreateSnapshot",
                "ec2:RebootInstances",
                "ec2:ImportInstance",
                "ec2:ResetSnapshotAttribute",
                "ec2:ImportSnapshot",
                "ec2:CopySnapshot",
                "ec2:CreateImage",
                "ec2:CopyImage",
                "ec2:GetLaunchTemplateData",
                "ec2:ImportImage",
                "ec2:DetachVolume",
                "ec2:CreateFlowLogs",
                "ec2:GetConsoleOutput",
                "ec2:CreateSecurityGroup",
                "ec2:CreateNetworkAcl",
                "ec2:ModifyInstanceAttribute",
                "ec2:AuthorizeSecurityGroupEgress",
                "ec2:DetachNetworkInterface",
                "ec2:CreateNetworkAclEntry"
            ],
            "Resource": "*"
        },
        {
            "Sid": "AllowEC2InstanceInvokeLambda",
            "Effect": "Allow",
            "Action": "lambda:InvokeFunction",
            "Resource": "arn:aws:lambda:eu-west-1:111111111111:function:forensics-isolate-instance"
        }
    ]
}</pre>
<p>Create the ec2-forensics-policy IAM Policy:</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true">aws iam create-policy --policy-name ec2-forensics-policy \
--policy-document file://ec2-forensics-policy.json \
--profile &lt;your profile&gt;</pre>
<p>Attach the policy to the ec2-forensics-role, using the ARN found in the output from the previous command.<br />
The Forensics Workstation also needs access to S3 and AWS Systems Manager, so we also include some AWS Managed Policies</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true">aws iam attach-role-policy --role-name ec2-forensics-role \
--policy-arn arn:aws:iam::aws:policy/service-role/AmazonEC2RoleforSSM \
--profile &lt;your profile&gt;
aws iam attach-role-policy --role-name ec2-forensics-role \
--policy-arn arn:aws:iam::aws:policy/AmazonS3FullAccess \
--profile &lt;your profile&gt;
aws iam attach-role-policy --role-name ec2-forensics-role \
--policy-arn arn:aws:iam::111111111111:policy/ec2-forensics-policy \
--profile &lt;your profile&gt;</pre>
<p>Create an Instance Profile, called ec2-forensics-profile</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true">aws iam create-instance-profile \
--instance-profile-name ec2-forensics-profile \
--profile &lt;your profile&gt;</pre>
<p>Attach the ec2-forensics-role to the ec2-forensics-profile</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true ">aws iam add-role-to-instance-profile \
--instance-profile-name ec2-forensics-profile \
--role-name ec2-forensics-role \
--profile &lt;your profile&gt;</pre>
</li>
<li><strong>Provision the Forensics Workstation</strong><br />
Create user-data.txt script with following content:</p>
<pre class="theme:eclipse toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true ">#!/bin/bash

# Install prerequisites
sudo yum -y update
sudo yum install python-pip pcre-tools gcc autoconf automake libtool nc git kernel-devel libdwarf-tools
pip install distorm3 pycrypto pillow openpyxl ujson pytz IPython

# Install Volatility
cd /home/ec2-user
wget http://downloads.volatilityfoundation.org/releases/2.6/volatility-2.6.zip
unzip volatility-2.6.zip
mv volatility-master volatility
chown -R ec2-user.ec2-user volatility

# Install LiME
git clone https://github.com/504ensicsLabs/LiME.git
chown -R ec2-user.ec2-user LiME</pre>
<p>Create the EC2 Instance</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true">aws ec2 run-instances --image-id ami-09693313102a30b2c \
--count 1 --instance-type t3.micro --key-name MyKeyPair \
--security-group-ids sg-22222222222222222 \
--subnet-id subnet-33333333333333333 \
--user-data file://user-data.txt \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value="My Forensics WS"}]' \
--iam-instance-profile Name=ec2-forensics-profile \
--profile &lt;your profile&gt;</pre>
<p>Tip: You can now fetch the latest Amazon AMI by querying the SSM Parameter Store:</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true ">aws ssm get-parameters \
--names /aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2 \
--profile &lt;your profile&gt;
{
    "InvalidParameters": [], 
    "Parameters": [
        {
            "Name": "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2", 
            "LastModifiedDate": 1542668357.322, 
            "Value": "ami-09693313102a30b2c", 
            "Version": 11, 
            "Type": "String", 
            "ARN": "arn:aws:ssm:eu-west-1::parameter/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-gp2"
        }
    ]
}
</pre>
<p>We now have a basic workstation.</li>
<li><strong>Create a forensic volume</strong><br />
We will need a volume we can attach/detach from any instance to temporarily store memory dumps and provide tools to the compromised instance.<br />
Since we need to support both Windows and Linux, we create an exfat filesystem on it, as it is supported on all platforms.</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true">aws ec2 create-volume --availability-zone eu-west-1a \ 
--size 100 --volume-type gp2 --tag-specifications \
'ResourceType=volume,Tags=[{Key=Name,Value=exFat-Forensics-Volume}]' \
--profile &lt;your profile&gt;</pre>
<p>This creates a 100 GB volume. You can lower the size , but make sure that it is comfortably bigger then the largest ram size on any of your instances.</p>
<p>Connect to the Forensics Workstation and attach the new volume ( you probably need to run aws configure to set your default region first )</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true ">aws ec2 attach-volume --device /dev/sdX \
--volume-id &lt;volumeid&gt; \
--instance-id $(curl http://169.254.169.254/latest/meta-data/instance-id)</pre>
<p>Partition and format the disk</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true" title="Partitioning">sudo fdisk /dev/sdh

Welcome to fdisk (util-linux 2.30.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x601015b4.

Command (m for help): p
Disk /dev/sdh: 100 GiB, 107374182400 bytes, 209715200 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x601015b4

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 
First sector (2048-209715199, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-209715199, default 209715199): 

Created a new partition 1 of type 'Linux' and of size 100 GiB.

Command (m for help): t
Selected partition 1          
Hex code (type L to list all codes): 7
Changed type of partition 'Linux' to 'HPFS/NTFS/exFAT'.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

</pre>
<pre class="theme:dark-terminal nums:false nums-toggle:false expand-toggle:false lang:sh decode:true " title="Formatting">sudo mkfs.vfat /dev/sdh1</pre>
<p>Mounting the volume</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true">sudo mount /dev/sdhX /mnt</pre>
<p>Copy your local LiME and Volatility folders to the volume, to be able to compile a kernel module or create a Volatility profile on the fly, just in case.<br />
For Windows, we copy  RamCapturer or/and FTK Imager to the volume as well.</p>
<p>Once you have all tools on the volume, unmount it, detach it and make a snapshot.</p>
<p>Next step, we will gather LiME kernel modules and create Volatility Profiles for instances, running in our environment.<br />
The LiME kernel module needs to be loaded on the compromised instance</li>
</ol>
<h4>Create LiME kernel modules and Volatility Profiles</h4>
<p>Note that you need to compile the kernel module for the EXACT kernel version , running on your instances. If you don&#8217;t patch your systems and/or have a lot of different Linux flavors, you will have a hard time maintaining the lime kernel modules and volatility profiles.</p>
<p>You have 2 options in obtaining a lime kernel module matching your kernel:</p>
<ol>
<li><strong>threadresponse lime module repository<br />
</strong><a href="https://threatresponse-lime-modules.s3.amazonaws.com/" target="_blank" rel="noopener noreferrer">https://threatresponse-lime-modules.s3.amazonaws.com/</a><br />
This opens an xmlfile in which the available lime modules can be found<br />
Here is an excerpt of that xml file.</p>
<pre class="theme:eclipse toolbar-overlay:false nums-toggle:false expand-toggle:false lang:default decode:true">&lt;ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"&gt;
&lt;Name&gt;threatresponse-lime-modules&lt;/Name&gt;
&lt;Prefix/&gt;
&lt;Marker/&gt;
&lt;-- SNIP --&gt;
&lt;Contents&gt;
&lt;Key&gt;
modules/lime-2.6.32-131.0.15.el6.centos.plus.x86_64.ko
&lt;/Key&gt;
&lt;LastModified&gt;2018-09-06T18:40:37.000Z&lt;/LastModified&gt;
&lt;ETag&gt;"93efeac2519a4c6a573601d203416098"&lt;/ETag&gt;
&lt;Size&gt;1098692&lt;/Size&gt;
&lt;StorageClass&gt;STANDARD&lt;/StorageClass&gt;
&lt;/Contents&gt;
&lt;Contents&gt;
&lt;Key&gt;
modules/lime-2.6.32-131.0.15.el6.centos.plus.x86_64.ko.sig
&lt;/Key&gt;
&lt;LastModified&gt;2018-09-06T18:41:34.000Z&lt;/LastModified&gt;
&lt;ETag&gt;"c4d44af3b2265e55e8c23b8dc62d8828"&lt;/ETag&gt;
&lt;Size&gt;566&lt;/Size&gt;
&lt;StorageClass&gt;STANDARD&lt;/StorageClass&gt;
&lt;/Contents&gt;
..</pre>
<p>The reference to the kernel modules  ( in the above example on line 8 ) is  the s3 object key to the object.<br />
So if your kernel is 2.6.32-131.0.15.el6, you can download it from https://threatresponse-lime-modules.s3.amazonaws.com/modules/lime-2.6.32-131.0.15.el6.centos.plus.x86_64.ko</li>
<li><strong>build your own repository</strong><br />
If you cannot find the lime modules for kernels running in your environment, you can build your own.<br />
Install volatility and LiME on either an existing instance, or launch a new instance of  the Linux distribution for which you want to create a module and volatility profile.For Redhat/CentOS/ Amazon Linux, you can use the userdata from the Forensics Workstation (2 .Provision the Forensics Workstation)<br />
For Debian/Ubuntu you can use this user-data content:</p>
<pre class="theme:eclipse toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true">#!/bin/bash
sudo apt -y update
sudo apt -y install libelf-dev libdwarf-dev dwarfdump zip make gcc
cd /home/ubuntu
wget http://downloads.volatilityfoundation.org/releases/2.6/volatility-2.6.zip
unzip volatility.zip
mv volatility-master volatility
chown -R ubuntu.ubuntu volatility
# Install LiME
git clone https://github.com/504ensicsLabs/LiME.git
chown -R ubuntu.ubuntu LiME</pre>
<ol>
<li>Compile the LiME module<br />
First, Make sure you have kernel headers, source and images installed on this instance.</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true ">cd ~/LiME/src
make</pre>
<p>This should have created a file called lime-$(uname -r).ko<br />
If you need to create a module for a different kernel version ( for example for an older unpatched instance ),<br />
install the required version and change the above command to:</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true ">make KVER=&lt;kernel version&gt;</pre>
<p>Note that this does not require the targeted kernel version to be active</li>
<li>Create Volatility Profiles
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true">cd ~/volatility/tools/linux

# change os to reflect your distro
os="ubuntu"
# change kernel version to the kernel version you want to compile for
# do make sure this kernel is installed ( including headers, source and boot image
# however, the kernel version does not need to be actively running
kernel_version=$(uname -r)
make KVER=${kernel_version}
zip ~/${os}-${kernel_version}.zip module.dwarf /boot/System.map-${kernel_version}</pre>
</li>
<li>Copy the lime module (.ko file) and volatility profile  (.zip file) to an S3 Bucket that acts as a central repository.</li>
</ol>
</li>
</ol>
<h4>Incident Workflow</h4>
<ol>
<li>Logon onto the Forensics WorkStation<br />
ssh into your Forensics Workstation in 2 terminal windows. ( Use ssh-agent, ssh-add and ssh -A)</li>
<li>Isolate the compromised instance
<pre class="theme:dark-terminal toolbar-overlay:false expand-toggle:false lang:sh decode:true">aws lambda invoke --function-name forensics-isolate-instance \
--payload '{"instance_id": "&lt;compromised instance id&gt;"}' /tmp/output.txt
</pre>
</li>
<li>Create a snapshot of the compromised instance
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true ">aws ec2 create-snapshot \
--volume-id &lt;volume-id of compromised instances root volume&gt; \
--tag-specifications \
'ResourceType=snapshot,Tags=[{Key=Name,Value=compromised-instance-snap}]'</pre>
</li>
<li>Attach the Forensics Volume to the compromised EC2 Instance and mount it.<br />
On The Forensics Workstation:</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true">aws ec2 attach-volume --device /dev/sdX \
--volume-id &lt;forensics volume id&gt; \
--instance-id &lt;compromised instance id&gt;</pre>
<p>On the compromised EC2 Instance:</p>
<p><strong>Linux:</strong><br />
ssh into the compromised instance, fetch the kernel version and mount the volume.<br />
We need the kernel version for the next steps</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true">uname -r
sudo mount /dev/sdX1 /mnt</pre>
<p><strong>Windows:</strong><br />
RDP into the compromised instance ( you need to setup an SSH Tunnel via the Forensics Workstation )<br />
Mount the volume via Computer Management -&gt; Disk Management<br />
<img fetchpriority="high" decoding="async" class="wp-image-9760 alignnone" src="https://cloudar.be/wp-content/uploads/2018/11/WindowsDiskManagement.png" alt="" width="375" height="269" srcset="https://cloudar.be/wp-content/uploads/2018/11/WindowsDiskManagement.png 1976w, https://cloudar.be/wp-content/uploads/2018/11/WindowsDiskManagement-768x550.png 768w, https://cloudar.be/wp-content/uploads/2018/11/WindowsDiskManagement-1536x1101.png 1536w, https://cloudar.be/wp-content/uploads/2018/11/WindowsDiskManagement-1005x720.png 1005w" sizes="(max-width: 375px) 100vw, 375px" /><br />
The new Volume is attached and identified as Disk 1 , but it is in an offline state.<br />
Right-click on Disk 1 and select &#8216;Online&#8217;<br />
<img decoding="async" class="alignnone wp-image-9761" src="https://cloudar.be/wp-content/uploads/2018/11/WindowsDiskOnline.png" alt="" width="424" height="128" srcset="https://cloudar.be/wp-content/uploads/2018/11/WindowsDiskOnline.png 1152w, https://cloudar.be/wp-content/uploads/2018/11/WindowsDiskOnline-768x232.png 768w" sizes="(max-width: 424px) 100vw, 424px" /><br />
The Volume is now online and mapped to D:<br />
<img decoding="async" class="alignnone wp-image-9762" src="https://cloudar.be/wp-content/uploads/2018/11/WindowsDiskOnlineResult.png" alt="" width="405" height="314" srcset="https://cloudar.be/wp-content/uploads/2018/11/WindowsDiskOnlineResult.png 1820w, https://cloudar.be/wp-content/uploads/2018/11/WindowsDiskOnlineResult-768x597.png 768w, https://cloudar.be/wp-content/uploads/2018/11/WindowsDiskOnlineResult-1536x1193.png 1536w, https://cloudar.be/wp-content/uploads/2018/11/WindowsDiskOnlineResult-927x720.png 927w" sizes="(max-width: 405px) 100vw, 405px" /></p>
<p>On Windows, you can now skip to Step 7</li>
<li>In the other terminal ( Forensics WS ), fetch the lime kernel module from your S3 Bucket or the Threadresponse repository</li>
<li>scp the LiME module to the compromised instance</li>
<li>Run the memory dump on the compromised instance<br />
<strong>On Linux:</strong></p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true">sudo insmod /path/to/lime-$(uname -r).ko "path=/mnt/ram.lime format=lime digest=sha1"</pre>
<p>This will create the memory dump file ram.lime and the digest file ram.sha1 on the forensics volume.</p>
<p><strong>On Windows:</strong><br />
Open File Explorer, and go to D:\<br />
If  RamCapturer is not yet unzipped, unzip RamCapturer.zip first.<br />
Then run D:\RamCapturer\x64\RamCapturer.exe as Administrator<br />
<img loading="lazy" decoding="async" class="alignnone wp-image-9763" src="https://cloudar.be/wp-content/uploads/2018/11/runRamCapturerAsAdmin.png" alt="" width="353" height="340" srcset="https://cloudar.be/wp-content/uploads/2018/11/runRamCapturerAsAdmin.png 1250w, https://cloudar.be/wp-content/uploads/2018/11/runRamCapturerAsAdmin-768x740.png 768w, https://cloudar.be/wp-content/uploads/2018/11/runRamCapturerAsAdmin-748x720.png 748w" sizes="auto, (max-width: 353px) 100vw, 353px" /><br />
<img loading="lazy" decoding="async" class="alignnone wp-image-9764" src="https://cloudar.be/wp-content/uploads/2018/11/RamCapturerStart.png" alt="" width="360" height="187" srcset="https://cloudar.be/wp-content/uploads/2018/11/RamCapturerStart.png 1082w, https://cloudar.be/wp-content/uploads/2018/11/RamCapturerStart-768x399.png 768w" sizes="auto, (max-width: 360px) 100vw, 360px" /><br />
Save the dump to D:\ and run &#8216;Capture!&#8217;<br />
The dump will be saved as YYYYMMDD.mem where YYYYMMDD is the current date.</li>
<li>Fetch the memory dump onto the Forensics WorkStation<br />
unmount the Forensics Volume on Linux, or , on Windows, put it offline again using the Disk Management.<br />
Detach the volume from the compromised EC2 Instance and attach it back to the Forensics Workstation.</li>
<li>Stop the Compromised instance.</li>
</ol>
<h4>Sample Results from Memory Dumps</h4>
<p>Volatility requires a profile matching your kernel. For Windows this is already included , but for Linux , you might need the volatility profile to be imported into your volatility setup.<br />
let&#8217;s first test if the profile for your kernel is already configured:</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true ">cd volatility
python vol.py --info | grep Profile
Volatility Foundation Volatility Framework 2.6
Profiles
Linuxamzn-4_14_72-73_55_amzn2_x86_64x64 - A Profile for Linux amzn-4.14.72-73.55.amzn2.x86_64 x64
Linuxamzn-4_14_77-81_59_amzn2_x86_64x64 - A Profile for Linux amzn-4.14.77-81.59.amzn2.x86_64 x64
VistaSP0x64                             - A Profile for Windows Vista SP0 x64
VistaSP0x86                             - A Profile for Windows Vista SP0 x86
VistaSP1x64                             - A Profile for Windows Vista SP1 x64
VistaSP1x86                             - A Profile for Windows Vista SP1 x86
VistaSP2x64                             - A Profile for Windows Vista SP2 x64
VistaSP2x86                             - A Profile for Windows Vista SP2 x86
Win10x64                                - A Profile for Windows 10 x64
Win10x64_10240_17770                    - A Profile for Windows 10 x64 (10.0.10240.17770 / 2018-02-10)

...</pre>
<p>If your kernel is not listed, you can add it by copying the volatility profile ( created in section 2.2 Create Volatility Profile )<br />
to the <span class="s1">volatility/plugins/overlays/linux/ directory.<br />
Rerunning the above command should show your added profile.</span></p>
<p>OK, Pièce de résistance: some results:</p>
<p>Fetching lsof for the linux memory dump:</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true ">python vol.py -f /mnt/ram-20181122.lime \
--profile Linuxamzn-4_14_72-73_55_amzn2_x86_64x64 linux_lsof

Volatility Foundation Volatility Framework 2.6
Offset             Name                           Pid      FD       Path
------------------ ------------------------------ -------- -------- ----
0xffff88001c628000 systemd                               1        0 /dev/null
0xffff88001c628000 systemd                               1        1 /dev/null
0xffff88001c628000 systemd                               1        2 /dev/null
0xffff88001c628000 systemd                               1        3 anon_inode:[6744]
0xffff88001c628000 systemd                               1        4 anon_inode:[6744]
0xffff88001c628000 systemd                               1        5 anon_inode:[6744]
0xffff88001c628000 systemd                               1        6 /sys/fs/cgroup/systemd
0xffff88001c628000 systemd                               1        7 anon_inode:[6744]
0xffff88001c628000 systemd                               1        8 socket:[14109]
0xffff88001c628000 systemd                               1        9 /proc/1/mountinfo

-- SNIP --

0xffff8800182525c0 sudo                              23415        3 pipe:[1758814]
0xffff8800182525c0 sudo                              23415        4 pipe:[1758814]
0xffff8800182525c0 sudo                              23415        5 socket:[1758834]
0xffff8800182525c0 sudo                              23415        6 socket:[1758839]
0xffff880018254b80 insmod                            23416        0 /dev/pts/0
0xffff880018254b80 insmod                            23416        1 /dev/pts/0
0xffff880018254b80 insmod                            23416        2 /dev/pts/0
0xffff880018254b80 insmod                            23416        3 /mnt/lime-modules/amazon/lime-4.14.72-73.55.amzn2.x86_64.ko</pre>
<p>List all established connections on Linux</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true ">python vol.py -f /mnt/ram-20181122.lime --profile Linuxamzn-4_14_72-73_55_amzn2_x86_64x64 linux_netstat | grep EST
Volatility Foundation Volatility Framework 2.6
TCP      10.100.4.6      :   22 10.100.4.111    :44854 ESTABLISHED                  sshd/23161
TCP      10.100.4.6      :   22 10.100.4.111    :44854 ESTABLISHED                  sshd/23179
</pre>
<p>List all open ports on Linux</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true ">python vol.py -f /mnt/ram-20181122.lime --profile Linuxamzn-4_14_72-73_55_amzn2_x86_64x64 linux_netstat | grep LISTEN
Volatility Foundation Volatility Framework 2.6
TCP      0.0.0.0         :  111 0.0.0.0         :    0 LISTEN                    rpcbind/2662 
TCP      ::              :  111 ::              :    0 LISTEN                    rpcbind/2662 
TCP      127.0.0.1       :   25 0.0.0.0         :    0 LISTEN                     master/3143 
TCP      0.0.0.0         :   22 0.0.0.0         :    0 LISTEN                       sshd/3273 
TCP      ::              :   22 ::              :    0 LISTEN                       sshd/3273</pre>
<p>List all processes on Linux</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:default decode:true ">python vol.py -f /mnt/ram-20181122.lime --profile Linuxamzn-4_14_72-73_55_amzn2_x86_64x64 linux_pslist
Volatility Foundation Volatility Framework 2.6
Offset             Name                 Pid             PPid            Uid             Gid    DTB                Start Time
------------------ -------------------- --------------- --------------- --------------- ------ ------------------ ----------
0xffff88001c628000 systemd              1               0               0               0      0x000000001b014000 2018-11-15 16:22:54 UTC+0000
0xffff88001c62a5c0 kthreadd             2               0               0               0      ------------------ 2018-11-15 16:22:54 UTC+0000
0xffff88001c648000 kworker/0:0H         4               2               0               0      ------------------ 2018-11-15 16:22:54 UTC+0000
0xffff88001c64cb80 mm_percpu_wq         6               2               0               0      ------------------ 2018-11-15 16:22:54 UTC+0000
0xffff88001c690000 ksoftirqd/0          7               2               0               0      ------------------ 2018-11-15 16:22:54 UTC+0000
0xffff88001c6925c0 rcu_sched            8               2               0               0      ------------------ 2018-11-15 16:22:54 UTC+0000
0xffff88001c694b80 rcu_bh               9               2               0               0      ------------------ 2018-11-15 16:22:54 UTC+0000
0xffff88001c698000 migration/0          10              2               0               0      ------------------ 2018-11-15 16:22:54 UTC+0000
0xffff88001c69a5c0 watchdog/0           11              2               0               0      ------------------ 2018-11-15 16:22:54 UTC+0000

-- SNIP --

0xffff88000890cb80 sshd                 23161           3273            0               0      0x000000000a35c000 2018-11-22 12:56:43 UTC+0000
0xffff880019598000 sshd                 23179           23161           1000            1000   0x000000000a246000 2018-11-22 12:56:43 UTC+0000
0xffff88001679a5c0 bash                 23180           23179           1000            1000   0x0000000008990000 2018-11-22 12:56:43 UTC+0000
0xffff880017b30000 kworker/u30:0        23287           2               0               0      ------------------ 2018-11-22 12:57:16 UTC+0000
0xffff8800182525c0 sudo                 23415           23180           0               0      0x000000000a308000 2018-11-22 12:59:15 UTC+0000
0xffff880018254b80 insmod               23416           23415           0               0      0x00000000005a6000 2018-11-22 12:59:15 UTC+0000</pre>
<p>There are other interesting possibilities , to get an idea what you can query run volatility with the -h option</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true">python vol.py --info | grep linux_</pre>
<p>This will list all comands, available for linux memory dumps.<br />
Note that some commands might not work, because they are not supported for a specific profile.</p>
<p>Process list on Windows</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true">volatility]$ python vol.py -f /mnt/20181122.mem  --profile Win2016x64_14393 pslist
Volatility Foundation Volatility Framework 2.6
Offset(V)          Name                    PID   PPID   Thds     Hnds   Sess  Wow64 Start                          Exit                          
------------------ -------------------- ------ ------ ------ -------- ------ ------ ------------------------------ ------------------------------
0xffffbf0b9de5e500 System                    4      0    144        0 ------      0 2018-11-18 23:32:48 UTC+0000                                 
0xffffbf0b9e6ec040 smss.exe                388      4      2        0 ------      0 2018-11-18 23:32:49 UTC+0000                                 
0xffffbf0b9e6a2080 csrss.exe               524    516      9        0      0      0 2018-11-18 23:33:00 UTC+0000                                 
0xffffbf0b9e98f080 smss.exe                584    388      0 --------      1      0 2018-11-18 23:33:01 UTC+0000                                 
0xffffbf0b9e9a7080 csrss.exe               592    584      9        0      1      0 2018-11-18 23:33:01 UTC+0000                                 
0xffffbf0b9e9f3080 wininit.exe             608    516      1        0      0      0 2018-11-18 23:33:01 UTC+0000                                 
0xffffbf0b9e9c1080 winlogon.exe            644    584      2        0      1      0 2018-11-18 23:33:01 UTC+0000                                 
0xffffbf0b9ec7b080 services.exe            704    608      4        0      0      0 2018-11-18 23:33:01 UTC+0000                                 
0xffffbf0b9ec81080 lsass.exe               712    608      7        0      0      0 2018-11-18 23:33:02 UTC+0000                                 
0xffffbf0b9ecc4380 svchost.exe             784    704     16        0      0      0 2018-11-18 23:33:03 UTC+0000                                 
0xffffbf0b9eceb840 svchost.exe             836    704     11        0      0      0 2018-11-18 23:33:03 UTC+0000

-- SNIP --

0xffffbf0b9f44e840 userinit.exe           3120   2204      0 --------      2      0 2018-11-21 22:12:45 UTC+0000                                 
0xffffbf0b9f4d5840 explorer.exe           3136   3120     60        0      2      0 2018-11-21 22:12:45 UTC+0000                                 
0xffffbf0b9e252840 TabTip.exe             3148    996     12        0      2      0 2018-11-21 22:12:45 UTC+0000                                 
0xffffbf0b9f249840 TabTip32.exe           3212   3148      1        0      2      1 2018-11-21 22:12:46 UTC+0000                                 
0xffffbf0b9f5fd840 ShellExperienc         3988    784     20        0      2      0 2018-11-21 22:12:56 UTC+0000                                 
0xffffbf0b9f44c340 SearchUI.exe           4084    784     16        0      2      0 2018-11-21 22:12:59 UTC+0000                                 
0xffffbf0b9f7795c0 MpCmdRun.exe           4568   4528      5        0      0      0 2018-11-21 22:13:08 UTC+0000                                 
0xffffbf0b9f695080 WUDFHost.exe           2376    996      6        0      0      0 2018-11-22 12:05:39 UTC+0000                                 
0xffffbf0b9f8e4840 conhost.exe            2968   3668      0 --------      2      0 2018-11-22 12:25:08 UTC+0000                                 
0xffffbf0b9f29b840 RamCapture64.e         4004   3136      9        0      2      0 2018-11-22 12:25:46 UTC+0000                                 
0xffffbf0b9e90a840 conhost.exe            3828   4004      9        0      2      0 2018-11-22 12:25:46 UTC+0000</pre>
<p>Open ports on Windows</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true ">python vol.py -f /mnt/20181122.mem  --profile Win2016x64_14393 netscan | grep LISTEN
Volatility Foundation Volatility Framework 2.6
0xbf0b9ded6560     TCPv4    0.0.0.0:3389                   0.0.0.0:0            LISTENING        960      svchost.exe    2018-11-18 23:33:04 UTC+0000
0xbf0b9ded6970     TCPv4    0.0.0.0:3389                   0.0.0.0:0            LISTENING        960      svchost.exe    2018-11-18 23:33:04 UTC+0000
0xbf0b9ded6970     TCPv6    :::3389                        :::0                 LISTENING        960      svchost.exe    2018-11-18 23:33:04 UTC+0000
0xbf0b9e8e5320     TCPv4    0.0.0.0:49666                  0.0.0.0:0            LISTENING        968      svchost.exe    2018-11-18 23:33:05 UTC+0000
0xbf0b9e9bb710     TCPv4    0.0.0.0:49666                  0.0.0.0:0            LISTENING        968      svchost.exe    2018-11-18 23:33:05 UTC+0000
0xbf0b9e9bb710     TCPv6    :::49666                       :::0                 LISTENING        968      svchost.exe    2018-11-18 23:33:05 UTC+0000
0xbf0b9eb97a30     TCPv4    0.0.0.0:49667                  0.0.0.0:0            LISTENING        1580     spoolsv.exe    2018-11-18 23:33:05 UTC+0000
0xbf0b9eb97a30     TCPv6    :::49667                       :::0                 LISTENING        1580     spoolsv.exe    2018-11-18 23:33:05 UTC+0000
0xbf0b9eb988b0     TCPv4    0.0.0.0:49667                  0.0.0.0:0            LISTENING        1580     spoolsv.exe    2018-11-18 23:33:05 UTC+0000
0xbf0b9ebd9c80     TCPv4    0.0.0.0:445                    0.0.0.0:0            LISTENING        4        System         2018-11-18 23:33:05 UTC+0000
0xbf0b9ebd9c80     TCPv6    :::445                         :::0                 LISTENING        4        System         2018-11-18 23:33:05 UTC+0000
0xbf0b9ebf9010     TCPv4    0.0.0.0:5985                   0.0.0.0:0            LISTENING        4        System         2018-11-18 23:33:05 UTC+0000
0xbf0b9ebf9010     TCPv6    :::5985                        :::0                 LISTENING        4        System         2018-11-18 23:33:05 UTC+0000
0xbf0b9ec2dc00     TCPv4    0.0.0.0:47001                  0.0.0.0:0            LISTENING        4        System         2018-11-18 23:33:05 UTC+0000
0xbf0b9ec2dc00     TCPv6    :::47001                       :::0                 LISTENING        4        System         2018-11-18 23:33:05 UTC+0000
0xbf0b9ec33ec0     TCPv4    0.0.0.0:49669                  0.0.0.0:0            LISTENING        704      services.exe   2018-11-18 23:33:05 UTC+0000
0xbf0b9ec33ec0     TCPv6    :::49669                       :::0                 LISTENING        704      services.exe   2018-11-18 23:33:05 UTC+0000
0xbf0b9ec4a8c0     TCPv4    10.100.4.174:139               0.0.0.0:0            LISTENING        4        System         2018-11-18 23:33:04 UTC+0000
0xbf0b9ecf83e0     TCPv4    0.0.0.0:135                    0.0.0.0:0            LISTENING        836      svchost.exe    2018-11-18 23:33:03 UTC+0000
0xbf0b9ecfa8f0     TCPv4    0.0.0.0:135                    0.0.0.0:0            LISTENING        836      svchost.exe    2018-11-18 23:33:03 UTC+0000
0xbf0b9ecfa8f0     TCPv6    :::135                         :::0                 LISTENING        836      svchost.exe    2018-11-18 23:33:03 UTC+0000
0xbf0b9ed06ba0     TCPv4    0.0.0.0:49664                  0.0.0.0:0            LISTENING        608      wininit.exe    2018-11-18 23:33:03 UTC+0000
0xbf0b9ed07a30     TCPv4    0.0.0.0:49664                  0.0.0.0:0            LISTENING        608      wininit.exe    2018-11-18 23:33:03 UTC+0000
0xbf0b9ed07a30     TCPv6    :::49664                       :::0                 LISTENING        608      wininit.exe    2018-11-18 23:33:03 UTC+0000
0xbf0b9edd0c00     TCPv4    0.0.0.0:49665                  0.0.0.0:0            LISTENING        528      svchost.exe    2018-11-18 23:33:04 UTC+0000
0xbf0b9edd2a30     TCPv4    0.0.0.0:49665                  0.0.0.0:0            LISTENING        528      svchost.exe    2018-11-18 23:33:04 UTC+0000
0xbf0b9edd2a30     TCPv6    :::49665                       :::0                 LISTENING        528      svchost.exe    2018-11-18 23:33:04 UTC+0000
0xbf0b9ee908b0     TCPv4    0.0.0.0:49669                  0.0.0.0:0            LISTENING        704      services.exe   2018-11-18 23:33:05 UTC+0000
0xbf0b9f00ec40     TCPv4    0.0.0.0:49671                  0.0.0.0:0            LISTENING        712      lsass.exe      2018-11-18 23:33:13 UTC+0000
0xbf0b9f116c70     TCPv4    0.0.0.0:49671                  0.0.0.0:0            LISTENING        712      lsass.exe      2018-11-18 23:33:13 UTC+0000
0xbf0b9f116c70     TCPv6    :::49671                       :::0                 LISTENING        712      lsass.exe      2018-11-18 23:33:13 UTC+0000
0xd200000d6560     TCPv4    0.0.0.0:3389                   0.0.0.0:0            LISTENING        960      svchost.exe    2018-11-18 23:33:04 UTC+0000
0xd200000d6970     TCPv4    0.0.0.0:3389                   0.0.0.0:0            LISTENING        960      svchost.exe    2018-11-18 23:33:04 UTC+0000
0xd200000d6970     TCPv6    :::3389                        :::0                 LISTENING        960      svchost.exe    2018-11-18 23:33:04 UTC+0000</pre>
<p>Established connections on Windows</p>
<pre class="theme:dark-terminal toolbar-overlay:false nums:false nums-toggle:false expand-toggle:false lang:sh decode:true "> python vol.py -f /mnt/20181122.mem  --profile Win2016x64_14393 netscan | grep EST
Volatility Foundation Volatility Framework 2.6
0xbf0b9f385d00     TCPv4    10.100.4.174:3389              94.143.189.241:35347 ESTABLISHED      960      svchost.exe    2018-11-22 11:46:20 UTC+0000</pre>
<p>A whole range of other commands are supported, but remember, not all commands work under all circumstances, YMMV.</p>
<p>Now where is that coffee?</p>
<p>The post <a href="https://cloudar.be/awsblog/security-incident-be-prepared-memory-dumps/">Security Incident: Be Prepared &#8211; Memory Dumps</a> appeared first on <a href="https://cloudar.be">Cloudar</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cloudar.be/awsblog/security-incident-be-prepared-memory-dumps/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Protecting yourself in the AWS console: Adding a &#8216;sudo&#8217; role</title>
		<link>https://cloudar.be/awsblog/protecting-yourself-in-the-aws-console-adding-a-sudo-role/</link>
					<comments>https://cloudar.be/awsblog/protecting-yourself-in-the-aws-console-adding-a-sudo-role/#respond</comments>
		
		<dc:creator><![CDATA[Ben Bridts]]></dc:creator>
		<pubDate>Mon, 05 Oct 2015 16:25:00 +0000</pubDate>
				<category><![CDATA[AWS Blog]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sudo]]></category>
		<guid isPermaLink="false">https://cloudar.be/?p=3196</guid>

					<description><![CDATA[<p>&#160; In this blogpost we describe how to use cross account roles to create a kind of &#8216;sudo&#8217; protection. This method is easier to use than using different users/accounts and looks like this: Background When designing applications to be fault tolerant, it may be easy to forget that there are still humans operating and managing [&#8230;]</p>
<p>The post <a href="https://cloudar.be/awsblog/protecting-yourself-in-the-aws-console-adding-a-sudo-role/">Protecting yourself in the AWS console: Adding a &#8216;sudo&#8217; role</a> appeared first on <a href="https://cloudar.be">Cloudar</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>&nbsp;</p>
<p>In this blogpost we describe how to use cross account roles to create a kind of &#8216;sudo&#8217; protection. This method is easier to use than using different users/accounts and looks like this:</p>
<blockquote class="wp-embedded-content"><p><a href="https://cloudar.be/watch">result</a></p></blockquote>
<p><script type='text/javascript'><!--//--><![CDATA[//><!--		/*! This file is auto-generated */		!function(d,l){"use strict";var e=!1,o=!1;if(l.querySelector)if(d.addEventListener)e=!0;if(d.wp=d.wp||{},!d.wp.receiveEmbedMessage)if(d.wp.receiveEmbedMessage=function(e){var t=e.data;if(t)if(t.secret||t.message||t.value)if(!/[^a-zA-Z0-9]/.test(t.secret)){var r,a,i,s,n,o=l.querySelectorAll('iframe[data-secret="'+t.secret+'"]'),c=l.querySelectorAll('blockquote[data-secret="'+t.secret+'"]');for(r=0;r<c.length;r++)c[r].style.display="none";for(r=0;r<o.length;r++)if(a=o[r],e.source===a.contentWindow){if(a.removeAttribute("style"),"height"===t.message){if(1e3<(i=parseInt(t.value,10)))i=1e3;else if(~~i<200)i=200;a.height=i}if("link"===t.message)if(s=l.createElement("a"),n=l.createElement("a"),s.href=a.getAttribute("src"),n.href=t.value,n.host===s.host)if(l.activeElement===a)d.top.location.href=t.value}}},e)d.addEventListener("message",d.wp.receiveEmbedMessage,!1),l.addEventListener("DOMContentLoaded",t,!1),d.addEventListener("load",t,!1);function t(){if(!o){o=!0;var e,t,r,a,i=-1!==navigator.appVersion.indexOf("MSIE 10"),s=!!navigator.userAgent.match(/Trident.*rv:11./),n=l.querySelectorAll("iframe.wp-embedded-content");for(t=0;t<n.length;t++){if(!(r=n[t]).getAttribute("data-secret"))a=Math.random().toString(36).substr(2,10),r.src+="#?secret="+a,r.setAttribute("data-secret",a);if(i||s)(e=r.cloneNode(!0)).removeAttribute("security"),r.parentNode.replaceChild(e,r)}}}}(window,document);//--><!]]&gt;</script><iframe loading="lazy" title="&#8220;result&#8221; &#8212; Cloudar" sandbox="allow-scripts" security="restricted" src="https://cloudar.be/watch/embed/" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" class="wp-embedded-content"></iframe></p>
<h2>Background</h2>
<p>When designing applications to be fault tolerant, it may be easy to forget that there are still humans operating and managing the underlying environment. Even with automation and PaaS, (and sometimes even because of), there is still a risk of human error.</p>
<p>The elimination of single points of failure has a limit, and depending on your budget and environment it&#8217;s possible that you&#8217;re application will be offline if someone deletes the wrong resource. Consider what would happen if someone deletes one of these by accident:</p>
<ul>
<li>Your Route53 Zone</li>
<li>An Elastic Load Balancer</li>
<li>The S3 bucket with your static assets.</li>
<li>Your RDS database</li>
</ul>
<p>All these services can survive a complete Availability Zone going down, but if you run the wrong command (e.g. a script to cleanup your development environment) against your production instances, things are going to break.</p>
<p>That&#8217;s why &#8220;<a href="https://en.wikipedia.org/w/index.php?title=Human_error&amp;oldid=674733345" target="_blank" rel="noopener noreferrer">prevention of human error is generally seen as a major contributor to reliability and safety of (complex) systems</a>&#8220;.</p>
<h2>Solution</h2>
<p>The easiest way to gain extra protection is to put all your production resources in a separate account and use cross account roles to only gain access when needed. AWS wrote a great <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/walkthru_cross-account-with-roles.html" target="_blank" rel="noopener noreferrer">walkthrough about delegating acces in the IAM user guide</a>.</p>
<p>But not all environments are created equal, and sometimes you need extra protection for a subset of resources in one account. Maybe you need to do a lot of read only actions in the production account, or you only have one account, or you&#8217;re running a build server in the development account and you don&#8217;t want to impact all developers by shutting it down by accident.</p>
<p>So to add an extra layer of protection you can use cross account roles, in the same account. This will give you a kind of &#8216;sudo&#8217; access in the console.</p>
<h2>Example</h2>
<p>Let&#8217;s assume we have three groups of users:</p>
<ul>
<li>(Readonly) users: They have access to all resources, but cannot modify them</li>
<li>(Privileged) power users: They can modify resources but should never be allowed to delete important resources</li>
<li>Administrators: On a day to day basis they have the same access as the power users, but they can &#8216;sudo&#8217; (switch roles) to get full access to everything.</li>
</ul>
<h3>Step 1: Create the IAM policies</h3>
<p>In this example we&#8217;ll restrict every action that start with &#8216;delete&#8217; in EC2, ELB, Route53 and S3. We will also prevent stopping and terminating EC2 instances. You should create your own policy if you to make sure you protect the resources that are important to you. You can also make this more granular by using Conditions and matching on Tags, or if you have a consistent naming scheme, you could use more specific resource names.</p>
<p>Create the following (managed) policy and give it the name &#8216;ProtectAgainstDeletion&#8217;:</p>
<pre class="show-lang:2 lang:js decode:true" title="ProtectAgainstDeletion">{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Deny",
            "Action": [
                "ec2:Delete*",
                "ec2:Terminate*",
                "ec2:Stop*",
                "ec2:Reboot*",
                "elasticloadbalancing:Delete*",
                "route53:Delete*",
                "s3:Delete*"
            ],
            "Resource": [
                "*"
            ]
        }
    ]
}
</pre>
<p>Also create a new policy for power users, because we do not want them to assume the sudo role.<br />
You can use the following policy and call it &#8216;PowerUserAccessNoSts&#8217;</p>
<pre class="show-lang:2 lang:default decode:true" title="PowerUserAccessNoSts">{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "NotAction": [
                "iam:*",
                "sts:*"
            ],
            "Resource": "*"
        }
    ]
}</pre>
<h3>Step 2: Create users and groups</h3>
<p>Create the following groups and attach the managed policies. We use the managed policies that are created by AWS and the two policies we created in step 1.</p>
<ul>
<li>&#8216;Users&#8217; group:
<ul>
<li>&#8216;ReadOnlyAccess&#8217; policy</li>
<li>&#8216;ProtectAgainstDeletion&#8217; policy</li>
</ul>
</li>
<li>&#8216;PowerUsers&#8217; group
<ul>
<li>&#8216;PowerUserAccessNoSts&#8217; policy</li>
<li>&#8216;ProtectAgainstDeletion&#8217; policy. This is not needed if we put every power user also in the users group, but it keeps us save if we forget to do that.</li>
</ul>
</li>
<li>&#8216;Administrators&#8217; group
<ul>
<li>&#8216;AdministratorAccess&#8217; policy</li>
<li>&#8216;ProtectAgainstDeletion&#8217; policy. This is not strictly needed, if we put everyone in the Users group.</li>
</ul>
</li>
</ul>
<p>You can now add your users in the right groups.</p>
<h3>Step 3: Create the &#8216;sudo&#8217; role</h3>
<p>Use the console to create a new role, and specify the following policies:</p>
<ul>
<li>Role Name: &#8216;sudo&#8217;</li>
<li>Role Type: &#8216;Role for Cross-Account Access&#8217;,  &#8216;Provide access between AWS accounts you own&#8217;</li>
<li>Account ID: your current account ID</li>
<li>Require MFA: you should select this.</li>
<li>Policy: &#8216;AdministratorAccess&#8217;</li>
</ul>
<p>Make sure to copy the link you get in the review step, as you need to distribute this to everyone in the Administrators group.</p>
<h3>Step 4: Use the &#8216;sudo&#8217; role for the first time</h3>
<p>Surf to the link from the review step (https://signin.aws.amazon.com/switchrole?account=YOURACCOUNT&amp;roleName=sudo) to configure the role for the first time.</p>
<p>Here you can choose a display name and color to identify the role. I used &#8216;sudo&#8217; and red, so I can see at a glance I&#8217;m doing dangerous stuff.</p>
<h3>Step 5: Use the Role History to switch easily between roles</h3>
<p>If you need to switch roles you can use the dropdown menu in the top right corner to select another role.  Click on your username to get an overview of your recent roles. You can switch back to your regular account in the same place.</p>
<p>&nbsp;</p>
<hr />
<h4></h4>
<h4>Additional remarks:</h4>
<p>It&#8217;s a best practice to avoid an explicit deny in the IAM policies, as it&#8217;s impossible to override and can be difficult to troubleshoot. However, switching roles will reset policies. That mitigates that concern here.</p>
<p>But if we didn&#8217;t use a role, we couldn&#8217;t add Administrators to the user group (because there would be no way to allow them to delete resources if there is an explicit deny), making permission management more complex.</p>
<p>The post <a href="https://cloudar.be/awsblog/protecting-yourself-in-the-aws-console-adding-a-sudo-role/">Protecting yourself in the AWS console: Adding a &#8216;sudo&#8217; role</a> appeared first on <a href="https://cloudar.be">Cloudar</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cloudar.be/awsblog/protecting-yourself-in-the-aws-console-adding-a-sudo-role/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
