<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Armando Flores</title>
    <description>The latest articles on DEV Community by Armando Flores (@armandoinfosec).</description>
    <link>https://dev.to/armandoinfosec</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F444013%2Fe95c781a-157d-4c37-9e5c-51364c584912.jpg</url>
      <title>DEV Community: Armando Flores</title>
      <link>https://dev.to/armandoinfosec</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/armandoinfosec"/>
    <language>en</language>
    <item>
      <title>Splunk: AWS CloudWatch Log Ingestion - Part 2 - Splunk Add-On for AWS</title>
      <dc:creator>Armando Flores</dc:creator>
      <pubDate>Tue, 04 Aug 2020 03:34:18 +0000</pubDate>
      <link>https://dev.to/armandoinfosec/splunk-aws-cloudwatch-log-ingestion-part-2-splunk-add-on-for-aws-290a</link>
      <guid>https://dev.to/armandoinfosec/splunk-aws-cloudwatch-log-ingestion-part-2-splunk-add-on-for-aws-290a</guid>
      <description>&lt;h1&gt;
  
  
  Opening Remarks
&lt;/h1&gt;

&lt;p&gt;There were a couple of items I forgot to mention in &lt;a href="https://dev.to/armandoinfosec/splunk-aws-cloudwatch-log-ingestion-part-1-introduction-setup-1kml"&gt;Part 1&lt;/a&gt;: First, the scope of my research was limited to CloudWatch logs from Windows-based EC2 instances. Second, some deviations from existing documentation were made with the intent of leveraging other Splunk technical add-ons (TAs) in order to achieve a degree of &lt;a href="https://docs.splunk.com/Documentation/CIM/4.16.0/User/Overview"&gt;data normalization&lt;/a&gt;. We will discuss these items in a bit more detail later.&lt;/p&gt;

&lt;h2&gt;
  
  
  Considerations
&lt;/h2&gt;

&lt;p&gt;The &lt;a href="https://docs.splunk.com/Documentation/AddOns/released/AWS/Description"&gt;Splunk Add-On for AWS&lt;/a&gt; allows Splunk to retrieve metrics and other data from an AWS account using API calls. Although we will be focusing on retrieving AWS CloudWatch logs, you may want to explore the other available options provided by the add-on. These other options may be of interest to your or your organization’s needs. Before we begin our journey, we’ll take a quick look at the strengths and weaknesses of the Splunk Add-On for AWS.&lt;/p&gt;

&lt;h3&gt;
  
  
  Strengths
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The Splunk Add-On for AWS is developed and supported by &lt;a href="https://dev.splunk.com/enterprise/docs/releaseapps/splunkbase/appsupporttypes/"&gt;Splunk&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;As mentioned before, the Splunk Add-On for AWS provides the option of collecting other types of &lt;a href="https://splunkbase.splunk.com/app/1876/"&gt;AWS resources like Billing, CloudTrail, S3, among others&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Most of the configuration can be performed via the Splunk Web interface and the AWS management console.&lt;/li&gt;
&lt;li&gt;Since the Splunk Add-On for AWS uses API calls to retrieve logs, you likely will not require any additional firewall policies to allow inbound connections.&lt;/li&gt;
&lt;li&gt;Being a pull mechanism, the Splunk Add-On for AWS minimizes the risk of in-transit data loss.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  (Potential) Weaknesses
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.splunk.com/Documentation/AddOns/released/Overview/SplunkCloudinstall"&gt;Splunk Cloud users may require Splunk support to install apps and add-ons or to apply certain configuration changes on their behalf&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.splunk.com/Documentation/AddOns/released/AWS/Troubleshooting"&gt;AWS has thresholds on API requests which could result in throttling when exceeded&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;The data inputs of the Splunk Add-On for AWS run on a scheduler. This means that the logs are not retrieved in real-time. Decreasing the wait time on the scheduler could result in API call throttling. Additional considerations may be required if the data being retrieved from AWS is also being used in time sensitive contexts such as Splunk Enterprise Security correlation searches.&lt;/li&gt;
&lt;li&gt;Splunk is said to be deprecating the option to pull AWS CloudWatch logs (and VPC flow logs) using the Splunk Add-On for AWS. &lt;a href="https://docs.splunk.com/Documentation/AddOns/released/AWS/CloudWatchLogs"&gt;Splunk recommends the use of Kinesis Firehose for these input types&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Let’s Get to Down to Business!
&lt;/h2&gt;

&lt;h3&gt;
  
  
  AWS Bill of Materials
&lt;/h3&gt;

&lt;p&gt;I won’t be very descriptive here since AWS’s own documentation is quite detailed and easy to follow. I may come back and write my own guide on this later, but for now I will be outlining what you’ll need to have in AWS before we move onto Splunk:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An AWS &lt;a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-getting-started.html"&gt;VPC&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;One or more &lt;a href="https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/EC2_GetStarted.html"&gt;Windows EC2 instances&lt;/a&gt; in your VPC.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/create-iam-roles-for-cloudwatch-agent.html"&gt;IAM Roles for use with the CloudWatch Agent and deploy the CloudWatch agent using Systems Manager&lt;/a&gt;. I’ve included the CloudWatch Agent configuration template from my AWS System Manager Parameter Store. Note that I’ve specified separate log groups for each main type of Windows Event log: System, Security, and Application. This will give us a degree of granularity when it comes time to make our Windows events compliant with the Splunk CIM. I’ve also chosen to render Windows event logs using XML. This is just my preference, but XML logs appear to be smaller and therefore should result in a slight reduction in Splunk license utilization. Once the CloudWatch agent has been installed and configured, you should be able to see your log streams in &lt;strong&gt;CloudWatch &amp;gt; Logs &amp;gt; Log groups&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.splunk.com/Documentation/AddOns/released/AWS/ConfigureAWSpermissions"&gt;An AWS user account with the appropriate permissions&lt;/a&gt;. To keeps thing simple, I used the policy template containing all permissions. Please make sure you save your user’s secret access key because you won’t be able to get it later. You can always delete and create a new pair of access keys if you missed the chance to save the initial set.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    "logs": {
        "logs_collected": {
            "windows_events": {
                "collect_list": [
                    {
                        "event_format": "xml",
                        "event_levels": [
                            "VERBOSE",
                            "INFORMATION",
                            "WARNING",
                            "ERROR",
                            "CRITICAL"
                        ],
                        "event_name": "System",
                        "log_group_name": "WindowsEventLogSystem",
                        "log_stream_name": "{instance_id}"
                    },
                    {
                        "event_format": "xml",
                        "event_levels": [
                            "VERBOSE",
                            "INFORMATION",
                            "WARNING",
                            "ERROR",
                            "CRITICAL"
                        ],
                        "event_name": "Security",
                        "log_group_name": "WindowsEventLogSecurity",
                        "log_stream_name": "{instance_id}"
                    },
                    {
                        "event_format": "xml",
                        "event_levels": [
                            "VERBOSE",
                            "INFORMATION",
                            "WARNING",
                            "ERROR",
                            "CRITICAL"
                        ],
                        "event_name": "Application",
                        "log_group_name": "WindowsEventLogApplication",
                        "log_stream_name": "{instance_id}"
                    }
                ]
            }
        }
    },
    "metrics": {
        "append_dimensions": {
            "AutoScalingGroupName": "${aws:AutoScalingGroupName}",
            "ImageId": "${aws:ImageId}",
            "InstanceId": "${aws:InstanceId}",
            "InstanceType": "${aws:InstanceType}"
        },
        "metrics_collected": {
            "LogicalDisk": {
                "measurement": [
                    "% Free Space"
                ],
                "metrics_collection_interval": 60,
                "resources": [
                    "*"
                ]
            },
            "Memory": {
                "measurement": [
                    "% Committed Bytes In Use"
                ],
                "metrics_collection_interval": 60
            },
            "Paging File": {
                "measurement": [
                    "% Usage"
                ],
                "metrics_collection_interval": 60,
                "resources": [
                    "*"
                ]
            },
            "PhysicalDisk": {
                "measurement": [
                    "% Disk Time"
                ],
                "metrics_collection_interval": 60,
                "resources": [
                    "*"
                ]
            },
            "Processor": {
                "measurement": [
                    "% User Time",
                    "% Idle Time",
                    "% Interrupt Time"
                ],
                "metrics_collection_interval": 60,
                "resources": [
                    "_Total"
                ]
            }
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h3&gt;
  
  
  Splunk Configuration
&lt;/h3&gt;

&lt;p&gt;I hope you did your homework and ended up with a working &lt;a href="https://docs.splunk.com/Documentation/Splunk/8.0.5/SearchTutorial/InstallSplunk"&gt;Splunk Enterprise instance&lt;/a&gt;. If you haven’t had a chance to do that yet, please make sure you do so before continuing. You’ll also need to be able to access the &lt;a href="https://docs.splunk.com/Documentation/Splunk/8.0.5/SearchTutorial/StartSplunk"&gt;Splunk Web&lt;/a&gt; interface.&lt;br&gt;
We’ll begin by installing the Splunk add-ons needed for our project. You can do this by logging into Splunk Web and clicking on &lt;strong&gt;“+ Find More Apps”&lt;/strong&gt; from your application launcher/home dashboard. You may opt to install apps and add-ons using the CLI or by manually &lt;a href="https://docs.splunk.com/Documentation/AddOns/released/Overview/Singleserverinstall"&gt;downloading packages from Splunk base and uploading them to your Splunk instance&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--w7fzjoE4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/0gwot4v5chyq8wzr3gz3.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--w7fzjoE4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/0gwot4v5chyq8wzr3gz3.JPG" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For this project we’ll need the &lt;a href="https://splunkbase.splunk.com/app/1876/"&gt;Splunk Add-on for Amazon Web Services&lt;/a&gt;, the &lt;a href="https://splunkbase.splunk.com/app/1621/"&gt;Splunk Common Information Model (CIM)&lt;/a&gt;, and the &lt;a href="https://splunkbase.splunk.com/app/742/#/details"&gt;Splunk Add-on for Microsoft Windows&lt;/a&gt;. You can look for these add-ons using the search box in the &lt;strong&gt;“Browse More Apps”&lt;/strong&gt; page in Splunk Web. Click on &lt;strong&gt;“Install”&lt;/strong&gt; once you’ve found them.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ccS9U_H_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/eymlwcdga0jtcwxm017g.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ccS9U_H_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/eymlwcdga0jtcwxm017g.JPG" alt=""&gt;&lt;/a&gt;&lt;br&gt;
You’ll likely be prompted to reboot Splunk once you’ve installed these add-ons. Go ahead and restart even if you were not prompted to do so. You can restart Splunk from the web interface by going to &lt;strong&gt;Settings &amp;gt; Server Controls&lt;/strong&gt; and selecting &lt;strong&gt;“Restart Splunk”.&lt;/strong&gt;&lt;br&gt;
Now, we’ll need to create some &lt;a href="https://docs.splunk.com/Documentation/Splunk/8.0.5/Indexer/Aboutmanagingindexes"&gt;indexes&lt;/a&gt; for our AWS CloudWatch log data. I like to have an &lt;em&gt;onboarding&lt;/em&gt; or &lt;em&gt;sandbox&lt;/em&gt; index to fine tune my data before putting it into a &lt;em&gt;production&lt;/em&gt; index. With that in mind, I named my indexes “onboarding_index” and “aws_windows” respectively. You can create indexes in Splunk Web by going to &lt;strong&gt;Settings &amp;gt; Indexes (under “Data”)&lt;/strong&gt; and selecting &lt;strong&gt;“New Index”.&lt;/strong&gt; We’ll use the default values for all the other settings. &lt;/p&gt;

&lt;p&gt;Once your indexes have been created, you’ll have to &lt;a href="https://docs.splunk.com/Documentation/AddOns/released/AWS/Setuptheadd-on"&gt;configure the Splunk Add-On for AWS&lt;/a&gt;. You can do this in Splunk Web by clicking on the appropriate add-on from your home dashboard/app launcher. Now we’ll need to set up the the add-on starting with the &lt;strong&gt;Configuration&lt;/strong&gt; portion. Click on &lt;em&gt;Add&lt;/em&gt;* and enter the corresponding details for the AWS account you created. After adding your account, go to the &lt;strong&gt;Inputs&lt;/strong&gt; section and select &lt;strong&gt;Create New Input&lt;/strong&gt;. Pick the &lt;strong&gt;CloudWatch Logs&lt;/strong&gt; Input Type from the &lt;strong&gt;Custom Data Type&lt;/strong&gt; entry. Here you’ll need to provide a name for your input. I recommend something descriptive like &lt;em&gt;aws_inputs_cw_logs_WinEventLogSystem&lt;/em&gt;. Enter the rest of the details for your AWS Account, AWS Region, Log Group, etc. and pick the “onboarding_index” that we created earlier. We’ll also be overriding the &lt;a href="https://docs.splunk.com/Documentation/SplunkCloud/8.0.2004/Data/Whysourcetypesmatter"&gt;sourcetype&lt;/a&gt; field by replacing the default value of “aws:cloudwatchlogs” with “XmlWinEventLog” if you chose to format your EC2 Windows event logs using XML or “WinEventLog” if you’re using the classic event log format. Review your input's settings and hit &lt;strong&gt;Save&lt;/strong&gt; when ready. I ended up creating an input for each one of my CloudWatch log groups. I would recommend you doing the same for now. Keep in mind that the AWS add-on inputs run on a scheduler (every 10 minutes by default) so you likely won’t see your EC2 logs for a little while. Go get yourself some coffee or a sandwich while you wait and don’t forget to pat yourself on the back for making it this far.&lt;/p&gt;

&lt;p&gt;Remember installing the Splunk Add-On for Microsoft Windows earlier? The “WinEventLog” and “XmlWinEventLog” sourcetypes are used by this add-on for several things. The add-on is full of useful configurations including field extractions that will do 99% of the heavy lifting for us – which means we won’t have to write our own regular expressions and lots of other configurations ourselves.&lt;/p&gt;

&lt;p&gt;Once the input has had a chance to retrieve logs from your CloudWatch log groups, you should be able to search for data using something like &lt;code&gt;index="onboarding_index" sourcetype="XmlWinEventLog"&lt;/code&gt;. You can view the extracted field names by clicking on the drop-down arrow to the left of an event. You'll also see the field names in the &lt;strong&gt;Interesting Fields&lt;/strong&gt; column.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZG3xPXy5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/et326exk2lgn3f3ycpvn.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZG3xPXy5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/et326exk2lgn3f3ycpvn.JPG" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Things are looking good now. We have a wealth of fields that can serve multiple use cases. We could use some of these fields to create alerts or reports for things such as failed logins, unplanned system reboots, etc. Unfortunately, the Windows add-on also looks at the &lt;a href="https://docs.splunk.com/Splexicon:Source"&gt;source&lt;/a&gt; field values when performing some of the CIM compliant field extractions. One could go through the tedious process of manually updating dozens, perhaps hundreds, of field extractions, field aliases, tags, and other configurations to include our current &lt;em&gt;source&lt;/em&gt; names. However, that’s a ton of unsustainable work. I believe one of the AWS add-on’s Python scripts is where the &lt;em&gt;source&lt;/em&gt; names are coming from. The pattern appears to be &lt;em&gt;your-aws-region&lt;/em&gt; + &lt;em&gt;your-log-group-name&lt;/em&gt; + &lt;em&gt;your-log-stream-name&lt;/em&gt;. I suppose it would be possible to edit the Python script itself to rename the &lt;em&gt;source&lt;/em&gt; whatever you prefer. However, I have not looked that deep and I’m not sure if there’s any dependencies that may break if you tinker with the add-on’s underlying scripts. Additionally, there’s a couple of trains of thoughts that discourage changing the &lt;em&gt;source&lt;/em&gt; field. Some argue that this type of manipulation may compromise the integrity of your logging data in legal proceedings, audits, etc. I’m not quite sure how relevant that is, but you’ve been informed. &lt;a href="https://docs.splunk.com/Documentation/Splunk/8.0.5/Admin/Inputsconf"&gt;Splunk themselves have this to say about the matter&lt;/a&gt;: &lt;code&gt;“Avoid overriding the source key. The input layer provides a more accurate string to aid in problem analysis and investigation, recording the file from which the data was retrieved. Consider using source types, tagging, and search wildcards before overriding this value.”&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;But… I really want those CIM compliant fields in order to leverage the &lt;a href="https://docs.splunk.com/Splexicon:Datamodel"&gt;data models&lt;/a&gt; (&lt;a href="https://docs.splunk.com/Documentation/Splunk/8.0.5/Knowledge/Acceleratedatamodels"&gt;and summary acceleration&lt;/a&gt;) from the CIM add-on. Again, Splunk gives you an enormous amount of flexibility (sometimes to a fault lol), so it’s entirely possible to create your own data models using whatever fields you want. The thing is, Splunk and their partners have already spent tons of time and effort into creating these resources. Realistically speaking, I don’t think I would be able to replicate all that work on my own and still be able to do my actual job.&lt;/p&gt;

&lt;p&gt;Going back to overriding our &lt;em&gt;source&lt;/em&gt; field values. I ended up doing so by adding a few entries to the  &lt;a href="https://docs.splunk.com/Documentation/Splunk/8.0.5/Admin/Propsconf"&gt;props.conf&lt;/a&gt; and &lt;a href="https://docs.splunk.com/Documentation/Splunk/8.0.5/Admin/Transformsconf"&gt;tranforms.conf&lt;/a&gt; files in &lt;code&gt;$SPLUNK_HOME/etc/system/local&lt;/code&gt;. You can create these files using a text editor in case they aren’t in that directory. While going through these configurations, I decided that I’d like to extract the &lt;em&gt;host&lt;/em&gt; values, as well. Please see below for details.&lt;/p&gt;

&lt;p&gt;Here are the stanzas in my &lt;em&gt;props.conf&lt;/em&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# This stanza tells Splunk to look at the source “us-east-2:WindowsEventLogSystem” (“…” is a wildcard).
[source::us-east-2:WindowsEventLogSystem...]
TRANSFORMS-HostAndSourceOverrideforAWSXMLWinEventLogs = WinEventXmlHostOverrideForAWS, WinEventXmlSourceOverrideForAWS

# This stanza tells Splunk to look at the source “us-east-2:WindowsEventLogSecurity” (“…” is a wildcard).
[source::us-east-2:WindowsEventLogSecurity...]
TRANSFORMS-HostAndSourceOverrideforAWSXMLWinEventLogs = WinEventXmlHostOverrideForAWS, WinEventXmlSourceOverrideForAWS

# This stanza tells Splunk to look at the source “us-east-2:WindowsEventLogApplication” (“…” is a wildcard).
[source::us-east-2:WindowsEventLogApplication...]
TRANSFORMS-HostAndSourceOverrideforAWSXMLWinEventLogs = WinEventXmlHostOverrideForAWS, WinEventXmlSourceOverrideForAWS
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And here are the stanzas in my &lt;em&gt;transforms.conf&lt;/em&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# This stanza is referred to by the it’s corresponding entry in props.conf.
# Please look at the transforms.conf documentation for an explanation of what each line is doing.
[WinEventXmlHostOverrideForAWS]
DEST_KEY = MetaData:Host
REGEX = &amp;lt;Computer&amp;gt;([^.&amp;lt;]+).*?&amp;lt;\/Computer&amp;gt;
FORMAT = host::$1
DEFAULT_VALUE = source::HOST:OVERRIDE:FAILED

[WinEventXmlSourceOverrideForAWS]
SOURCE_KEY = MetaData:Source
DEST_KEY = MetaData:Source
REGEX = ^.*:WindowsEventLog(Security|System|Application):.*$
FORMAT = source::XmlWinEventLog:$1
DEFAULT_VALUE = source::SOURCE:OVERRIDE:FAILED
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Stanza “names” in &lt;em&gt;props.conf&lt;/em&gt; (like [source::us-east-2:WindowsEventLogSystem...]) support PCRE expressions, with a few additions like “…”. Please review the relevant documentation page for additional information. Also, please note that the regex in &lt;em&gt;transforms.conf&lt;/em&gt; are capturing the Security, System, and Application portion of my CloudWatch log group names. You’ll need to make sure the regex’s you use are consistent with your naming schemes. You’ll also have to account for your AWS region in the regular expression. I tried, and failed, to use a regular expression like &lt;code&gt;[source::\w{2}(-gov)?-\w+-\d::WindowsEventLog...]&lt;/code&gt; to account for any AWS region. Let me know if you’re able to get it working. I’m curious as to why it didn’t work even when the regex successfully matches entries during testing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You’ll need to reboot Splunk after making all the changes to your .conf files.&lt;/strong&gt; I’d recommend rebooting from Splunk Web to avoid issues like accidentally starting Splunk as a different user and running into permissions issues (that’s a story for another time).&lt;/p&gt;

&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;Barring any errors on my side when writing this guide, your AWS CloudWatch logs should now have the &lt;em&gt;source&lt;/em&gt;, &lt;em&gt;sourcetype&lt;/em&gt;, and &lt;em&gt;host&lt;/em&gt; fields needed for full CIM compliant field extraction by the Windows add-on. It’s getting a bit late now, but I’ll be updating this post within the next few days in order to polish a couple sections and to expand a bit more on the significance of using CIM for data normalization – although, if you’re in security you likely already now my thoughts on that matter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--6l5tXYzF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wsm1rwbe80z59kd3fjnu.JPG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--6l5tXYzF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wsm1rwbe80z59kd3fjnu.JPG" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And… that’s about it! I hope this guide can save people some time, effort, and headaches. Please feel free to drop a comment if you spot any glaring issues or if you have any recommendations. Thanks for reading and see you in Part 3!&lt;/p&gt;

&lt;p&gt;PS. Here's a couple of things you may want to consider eventually:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Changing the index in your AWS add-on inputs to your poduction index.&lt;/li&gt;
&lt;li&gt;Scaling back the permissions of your IAM role used by the AWS add-on user.&lt;/li&gt;
&lt;li&gt;Using a single instance Splunk deployment allows for more straight forward configurations. Please make sure you do your research when you're ready to use these configurations in a distributed Splunk environment or if you're a Splunk Cloud user.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>security</category>
      <category>splunk</category>
    </item>
    <item>
      <title>Splunk: AWS CloudWatch Log Ingestion - Part 1 -  Introduction &amp; Setup</title>
      <dc:creator>Armando Flores</dc:creator>
      <pubDate>Sun, 02 Aug 2020 18:38:29 +0000</pubDate>
      <link>https://dev.to/armandoinfosec/splunk-aws-cloudwatch-log-ingestion-part-1-introduction-setup-1kml</link>
      <guid>https://dev.to/armandoinfosec/splunk-aws-cloudwatch-log-ingestion-part-1-introduction-setup-1kml</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;The advent of the cloud has transformed centralized log management into an essential component of an organization's security program. While it is true that cloud service providers often offer native logging mechanisms with their solutions, said features may not be robust enough to satisfy the needs of certain organizations – particularly those with both on-premises and cloud environments. Similarly, entities with mature security programs may already possess a fine-tuned centralized logging platform such as Splunk or Elastic Stack.&lt;/p&gt;

&lt;p&gt;The aim of this series is to provide meaningful insights for feeding AWS CloudWatch logs to Splunk. These articles will cover the following ingest mechanisms: the &lt;a href="https://docs.splunk.com/Documentation/AddOns/released/AWS/Description"&gt;Splunk Add-On for AWS&lt;/a&gt;, &lt;a href="https://dev.splunk.com/enterprise/docs/devtools/httpeventcollector/useawshttpcollector/"&gt;AWS Lambda&lt;/a&gt; functions using the &lt;a href="https://console.aws.amazon.com/lambda/home?#/create/configure-triggers?bp=splunk-cloudwatch-logs-processor"&gt;“splunk-cloudwatch-logs-processor”&lt;/a&gt; blueprint, and &lt;a href="https://docs.aws.amazon.com/firehose/latest/dev/vpc-splunk-tutorial.html"&gt;Kinesis Data Firehose&lt;/a&gt;. I will attempt to be as clear and detailed as practically possible. However, please note that this is neither a comprehensive nor exhaustive guide for Splunk or AWS. A degree or familiarity with each of these platforms is assumed and links to relevant resources will be included for further reading.&lt;/p&gt;

&lt;h2&gt;
  
  
  Initial Considerations &amp;amp; Testing Environment
&lt;/h2&gt;

&lt;p&gt;First and foremost, I strongly advise against using a production environment for testing purposes. The entirety of my research was conducted using a VM for my Splunk single instance deployment and a “non-prod” AWS VPC. The daily indexing capacity (1GB) provided by Splunk Enterprise trial license is more than sufficient for the scope of this exercise.&lt;/p&gt;

&lt;h3&gt;
  
  
  Considerations
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Respect all applicable EULAs.&lt;/li&gt;
&lt;li&gt;Exercise caution when creating and/or updating firewall policies. Keep in mind that certain firewalls and ACLs may not be stateful and use the defense in depth principle whenever possible.&lt;/li&gt;
&lt;li&gt;Be mindful when creating new users, roles, and/or access policies. Use the least privilege principle whenever possible.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Testing Environment
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;An AWS account dedicated for testing our configurations. Please note that you will need root or near root-level privileges to the AWS account in order to crate: new IAM users, roles, and policies, EC2 instances, Lambda functions, Kinesis Firehose delivery streams, CloudWatch log groups, CloudWatch log group subscriptions, VPCs, and any other necessary components.&lt;/li&gt;
&lt;li&gt;A VM for our single instance Splunk deployment using a &lt;a href="https://www.splunk.com/view/SP-CAAAAEQ"&gt;Splunk Enterprise free trial license&lt;/a&gt;. Two CPU cores, 4 GB of memory, and 30 GB of storage should provide an adequate performance baseline. You may want to consider allocating more system resources to your Splunk VM if you intend to use it in future projects. In a nutshell, additional CPU cores allow for greater search concurrency, more system memory improves the performance of large and complex searches, and extra storage provides for longer retention periods.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Homework
&lt;/h2&gt;

&lt;p&gt;Part 2 of this guide should be coming out soon. In the meantime, please ensure that you have completed the tasks below so that you will be able to follow along.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.splunk.com/Documentation/Splunk/8.0.5/SearchTutorial/InstallSplunk"&gt;Install Splunk Enterprise in your testing environment.&lt;/a&gt; I opted for an on-prem Splunk instance to mimic the use case of an organization which already has an existing Splunk deployment. You can choose to setup your Splunk instance in a cloud environment, but I will not be providing any considerations for that type of setup at this time. &lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/"&gt;Create an AWS account to use throughout our project.&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>security</category>
      <category>splunk</category>
    </item>
  </channel>
</rss>
