<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>InfluxData Blog - Darin Fisher</title>
    <description>Posts by Darin Fisher on the InfluxData Blog</description>
    <link>https://www.influxdata.com/blog/author/darin-fisher/</link>
    <language>en-us</language>
    <lastBuildDate>Mon, 18 Apr 2022 04:00:32 -0700</lastBuildDate>
    <pubDate>Mon, 18 Apr 2022 04:00:32 -0700</pubDate>
    <ttl>1800</ttl>
    <item>
      <title>Using Google Workspace Data for Security Observability</title>
      <description>&lt;p&gt;&lt;em&gt;This article was originally published in &lt;a href="https://thenewstack.io/using-google-workspace-data-for-security-observability/"&gt;The New Stack&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;img class="aligncenter wp-image-266998 size-full" src="/images/legacy-uploads/security-observability.jpg" alt="Security observability" width="3188" height="2125" /&gt;&lt;/p&gt;

&lt;p&gt;Keeping your systems secure is a never-ending challenge. Not only is it necessary to monitor and secure your own tech stack, but each new service a company uses creates another potential avenue for bad actors to try to exploit for their own ends.&lt;/p&gt;
&lt;h2&gt;Time series data is security data&lt;/h2&gt;
&lt;p&gt;Fortunately, there is one type of data that provides critical data about the way that people interact with any system or service: time series data.&lt;/p&gt;

&lt;p&gt;Every event occurs in the context of time. For example, a login attempt happens at a specific time. The data for that event gets timestamped. This timestamped data tells you who attempted that login, where the attempt occurred geographically and more. When you think about the fact that all this critical data has a timestamp, it becomes clear that time series data is security data.&lt;/p&gt;

&lt;p&gt;Maintaining time as a constant context for security provides a deeper understanding of your security situation by expanding the scope of what security means.&lt;/p&gt;

&lt;p&gt;System monitoring can reveal security threats in real time. However, unlike a courtroom drama, there’s rarely an “a-ha!” moment when it comes to security threats. That’s why security flaws can go undetected for long periods of time. Yes, a single event can be important. That’s why anomaly detection exists. But those events tend to happen rapidly, which makes them easier to miss. Placing events in the context of other events and patterns creates more thorough security profiles.&lt;/p&gt;
&lt;h2&gt;Building security solutions with time series data&lt;/h2&gt;
&lt;p&gt;Using time and history allows you to identify activity patterns. You can then use these patterns to test against anomalies when they occur. At InfluxData, our security team is developing a solution that uses InfluxDB to collect and process time series data to build security profiles.&lt;/p&gt;

&lt;p&gt;Compromised credentials is &lt;a href="https://owasp.org/www-project-top-ten/"&gt;a leading attack vector&lt;/a&gt;, so it made sense to start with authentication data. This was also convenient because authentication data covers every member of our team, and everyone generates a lot of it. As a result, you can start to see patterns quickly with authentication data as people tend to have consistent habits. InfluxDB enables us to track these patterns for everyone in detail. For example, if someone usually works from home but goes to a coffee shop to work one afternoon, that new location creates a new series of data and changes the cardinality of that person’s authentication activity.&lt;/p&gt;

&lt;p&gt;Sometimes the lack of a pattern can also be a pattern. People who travel a lot for work may have a lot of geographically diverse authentication activity. But knowing that those individuals travel frequently mitigates the urgency of anomalies when it comes to IP address location, for example.&lt;/p&gt;

&lt;p&gt;Tracking authentication activity can also help us eliminate false positives. If the same team member has two or three failed login attempts on Monday mornings, we can flag it as a potential problem, and then once we’ve identified it as a unique pattern, set that anomaly aside. (Of course, having coffee before trying to log in may help!)&lt;/p&gt;
&lt;h2&gt;Strength in numbers&lt;/h2&gt;
&lt;p&gt;As a company that uses dozens of SaaS providers, each one provides us with an opportunity to add context and granularity to employee security profiles and patterns.&lt;/p&gt;

&lt;p&gt;Gaining access to authentication data for an individual SaaS provider can be challenging. A critical solution we found was to track Google Workspace (GW) authentications. When a team member logs into any of the services that we use with their Gmail-linked email address, we can use the data generated by that interaction to track usage and authentication that would otherwise be unavailable.&lt;/p&gt;

&lt;p&gt;Google authentications are useful, especially when thinking in terms of time series data, because each transaction generates several data points, such as request, response and the actual authorization, among others. Some transactions can generate hundreds of data points, depending on what the user is trying to accomplish.&lt;/p&gt;

&lt;p&gt;The basic information we want to capture includes:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;Authentication timestamp&lt;/li&gt;
 	&lt;li&gt;Company account ID&lt;/li&gt;
 	&lt;li&gt;Username&lt;/li&gt;
 	&lt;li&gt;User ID&lt;/li&gt;
 	&lt;li&gt;User domain&lt;/li&gt;
 	&lt;li&gt;Authentication type&lt;/li&gt;
 	&lt;li&gt;Authentication result&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For our purposes, we map keys to static events or Google Workspace event fields.&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;time: GWs.id.time&lt;/li&gt;
 	&lt;li&gt;service_source: "G Suite"&lt;/li&gt;
 	&lt;li&gt;service_domain: "influxdata.com"&lt;/li&gt;
 	&lt;li&gt;source_address: GWs.ipAddress&lt;/li&gt;
 	&lt;li&gt;email_address: GWs.actor.email&lt;/li&gt;
 	&lt;li&gt;saas_account_id: GWs.actor.profileId&lt;/li&gt;
 	&lt;li&gt;customer_id: GWs.id.customerId&lt;/li&gt;
 	&lt;li&gt;application: GWs.id.applicationName&lt;/li&gt;
 	&lt;li&gt;auth_results: GWs.events[X].name&lt;/li&gt;
 	&lt;li&gt;login_type: GWs.events[X].parameters[Y].value&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Capturing this data has always been possible, but using it for security profiling didn’t scale well. Using InfluxDB allows us to easily ingest and process all the data produced by these transactions because it’s designed to handle this kind of timestamped data.&lt;/p&gt;

&lt;p&gt;As we bring new team members on board, we start to identify their patterns and build their security profile right away. This helps to determine a baseline usage profile that we then compare to usage patterns for established employees and other new hires as they join the company.&lt;/p&gt;

&lt;p&gt;We visualize this data right in InfluxDB and use &lt;a href="https://www.influxdata.com/products/flux/"&gt;Flux&lt;/a&gt; to generate the values for each individual element.&lt;/p&gt;
&lt;h2&gt;Continued development&lt;/h2&gt;
&lt;p&gt;At present, we’re exploring how to use Bollinger bands with this data. This involves using the standard deviation around a simple moving average to establish a normal range. These thresholds also provide a more granular understanding of this data as we track what normal means week over week, day over day, hour over hour, etc.&lt;/p&gt;

&lt;p&gt;The potential for this type of security monitoring is vast. As we continue to develop and build out this solution, we will be able to monitor our entire supply chain across the company. For example, including transaction data from GitHub means we will be able to track activities like GitHub repo cloning. If someone initiates a clone request from a suspicious location, that quickly becomes visible, and we can take appropriate countermeasures.&lt;/p&gt;

&lt;p&gt;Longitudinal tracking and alerting remain in development, as their functionality depends on the tolerance levels established by the Bollinger bands. But InfluxDB’s native alerting capabilities can handle these types of events.&lt;/p&gt;

&lt;p&gt;Ultimately, the goal here is to develop a holistic and scalable system for monitoring security threats. Because everything happens through the course of time, all security data is time series data. We’re leveraging time series data and InfluxDB to maintain that context.&lt;/p&gt;
</description>
      <pubDate>Mon, 18 Apr 2022 04:00:32 -0700</pubDate>
      <link>https://www.influxdata.com/blog/using-google-workspace-data-for-security-observability/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/using-google-workspace-data-for-security-observability/</guid>
      <category>Use Cases</category>
      <category>Developer</category>
      <author>Darin Fisher (InfluxData)</author>
    </item>
    <item>
      <title>How We Use InfluxDB for Security Monitoring</title>
      <description>&lt;p&gt;At InfluxData, we believe it makes sense to use a time series database for security monitoring. In summary, it’s because security investigations are inevitably time-oriented – you want to monitor and alert on who accessed what, from where, at which time – and time series databases like &lt;a href="https://www.influxdata.com/products/influxdb/"&gt;InfluxDB&lt;/a&gt; are very efficient at querying the data necessary to do this.&lt;/p&gt;

&lt;p&gt;In this post, we’d like to show you the beginnings of how we’re using InfluxDB for security monitoring so that you can apply these patterns to your own organization.&lt;/p&gt;
&lt;h2&gt;Our inventory of security events at InfluxData&lt;/h2&gt;
&lt;p&gt;The first question: where to begin our security event monitoring? Since most security breaches are related to compromised accounts, we decided to focus there.&lt;/p&gt;

&lt;p&gt;In order to verify geographically appropriate access to our services, we need to collect data for over 100 cloud services. But one of the first hurdles we hit was the availability of access data (who’s logged in) and activity data (what they did once logged in). Of those 100+ services, a few dozen use single-sign on (SSO) using &lt;a href="https://workspace.google.com/"&gt;Google Workspace&lt;/a&gt; (formerly called G Suite). Since we were able to acquire access data for those services, we decided to start there.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;&lt;img class="wp-image-254072 aligncenter" src="/images/legacy-uploads/influxdata-google-workspace.png" alt="influxdata google workspace - SSO" width="735" height="340" /&gt;&lt;/p&gt;
&lt;h2&gt;Patterns we're looking for&lt;/h2&gt;
&lt;p&gt;Security monitoring is all about anomaly detection – what the deviations from normal are. We decided to look at the following:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;Total number of unique accounts&lt;/li&gt;
 	&lt;li&gt;Total number of authentication attempts&lt;/li&gt;
 	&lt;li&gt;Total number of successful authentication attempts&lt;/li&gt;
 	&lt;li&gt;Total number of unsuccessful auth attempts&lt;/li&gt;
 	&lt;li&gt;Average number of IP addresses per account&lt;/li&gt;
 	&lt;li&gt;Average number of accounts per IP address&lt;/li&gt;
 	&lt;li&gt;List of authentication events, with time, username, app, IP address, and whether successful or not&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With the event data stored in InfluxDB, it’s easy to view the above information across any time period we like, such as the past hour, day, week, month, etc.; a particular set of hours or days; certain hours of the day (business hours vs. non working hours); or certain days of the week (weekdays versus weekends).&lt;/p&gt;

&lt;p&gt;We want to keep the data points required simple. After all, we have many services to track. Our list of cloud services used – and thus &lt;a href="https://www.avast.com/en-us/business/resources/what-is-attack-surface"&gt;attack surface&lt;/a&gt; – is continually changing. And usage patterns change over time, whether it’s the holiday slowdown, or the return to a post-pandemic world with more travel.&lt;/p&gt;
&lt;h2&gt;Authentication events&lt;/h2&gt;
&lt;p&gt;We are collecting authentication events from the Google Workspace (GWs) audit logging services,&lt;a href="https://support.google.com/a/answer/4580120?hl=en"&gt; Login audit log&lt;/a&gt;. The&lt;a href="https://cloud.google.com/logging"&gt; GCP Cloud Logging documentation&lt;/a&gt; describes methods for automated collections. Later, we’ll shift to collecting these events using the &lt;a href="https://github.com/influxdata/telegraf/blob/master/plugins/inputs/cloud_pubsub/pubsub.go"&gt;Telegraf PubSub plugin&lt;/a&gt;, since it’s an easier, cleaner integration. (Please learn from my mistakes!)&lt;/p&gt;
&lt;h3&gt;Data collection&lt;/h3&gt;
&lt;p&gt;Each service can require a separate collection process. The methods and data models can be similar though each will be unique. This will be accomplished in many ways and with a variety of tools. (Details are beyond our scope today.) The collection service for Google Workspace currently runs a NodeJS polling program every 5 minutes. Again, this is migrating to a simpler &lt;a href="https://docs.influxdata.com/telegraf/v1.17/plugins/#cloud_pubsub"&gt;PubSub Telegraf&lt;/a&gt; listener.&lt;/p&gt;
&lt;h3&gt;Data storage&lt;/h3&gt;
&lt;p&gt;The metrics storage is the &lt;a href="https://cloud2.influxdata.com/signup"&gt;InfluxDB Cloud service&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Data model&lt;/h3&gt;
&lt;p&gt;Each service will deliver the data in a different pattern than other services, and we will need to normalize each for our uses.&lt;/p&gt;

&lt;p&gt;The basic information we will require:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;Authentication timestamp&lt;/li&gt;
 	&lt;li&gt;Company account ID&lt;/li&gt;
 	&lt;li&gt;Username&lt;/li&gt;
 	&lt;li&gt;User ID&lt;/li&gt;
 	&lt;li&gt;User domain&lt;/li&gt;
 	&lt;li&gt;Authentication type&lt;/li&gt;
 	&lt;li&gt;Authentication result&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The company ID is used to manage separate corporate accounts. The username is usually the email address but could match the user ID.&lt;/p&gt;

&lt;p&gt;Our keys are mapped to static values or GWs event fields.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;GWs == Google Workspace Event Record&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;time: &lt;em&gt;GWs.id.time&lt;/em&gt;&lt;/li&gt;
 	&lt;li&gt;service_source: "G Suite"&lt;/li&gt;
 	&lt;li&gt;service_domain: "influxdata.com"&lt;/li&gt;
 	&lt;li&gt;source_address: &lt;em&gt;GWs.ipAddress&lt;/em&gt;&lt;/li&gt;
 	&lt;li&gt;email_address: &lt;em&gt;GWs.actor.email&lt;/em&gt;&lt;/li&gt;
 	&lt;li&gt;saas_account_id: &lt;em&gt;GWs.actor.profileId&lt;/em&gt;&lt;/li&gt;
 	&lt;li&gt;customer_id: &lt;em&gt;GWs.id.customerId&lt;/em&gt;&lt;/li&gt;
 	&lt;li&gt;application: &lt;em&gt;GWs.id.applicationName&lt;/em&gt;&lt;/li&gt;
 	&lt;li&gt;auth_results: &lt;em&gt;GWs.events[X].name&lt;/em&gt;&lt;/li&gt;
 	&lt;li&gt;login_type: &lt;em&gt;GWs.events[X].parameters[Y].value&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Visualization&lt;/h3&gt;
&lt;p&gt;This initial &lt;a href="https://docs.influxdata.com/influxdb/cloud/visualize-data/"&gt;dashboard visualization&lt;/a&gt; consists of general usage metrics, success vs. failure counts, account and address cardinality, results over time chart, and a list of authentication event details. Creating &lt;a href="https://docs.influxdata.com/influxdb/cloud/visualize-data/dashboards/"&gt;visualizations and dashboards&lt;/a&gt; is covered very well in the &lt;a href="https://docs.influxdata.com/influxdb/cloud/"&gt;InfluxDB documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;img class="alignnone size-full wp-image-254073" src="/images/legacy-uploads/google-workspace-authentication.png" alt="Google Workspace authentication" width="1571" height="944" /&gt;&lt;/p&gt;
&lt;h3&gt;Dashboard elements&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://docs.influxdata.com/influxdb/cloud/query-data/get-started/"&gt;Flux queries&lt;/a&gt; used for each cell of the above dashboard are as follows:&lt;/p&gt;
&lt;h5&gt;Unique accounts&lt;/h5&gt;
&lt;p&gt;This builds the list of unique accounts attempting authentication for the given period of time.&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-javascript"&gt;from(bucket: v.bucket)
  |&amp;gt; range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |&amp;gt; filter(fn: (r) =&amp;gt;
    r._measurement == "auth_activity"
    and r._field == "auth_result"
  )
  |&amp;gt; keep(columns:["email_address"])
  |&amp;gt; group()
  |&amp;gt; unique(column: "email_address")
  |&amp;gt; count(column: "email_address")&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;Authentication attempts&lt;/h5&gt;
&lt;p&gt;How many total authentications were attempted during our request period.&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-javascript"&gt;from(bucket: v.bucket)
  |&amp;gt; range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |&amp;gt; filter(fn: (r) =&amp;gt;
    r._measurement == "auth_activity"
    and r._field == "auth_result"
    and (r._value == "login_success" or r._value == "login_failure")
  )
  |&amp;gt; keep(columns:["_time","email_address"])
  |&amp;gt; group()
  |&amp;gt; count(column: "email_address")&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;Success&lt;/h5&gt;
&lt;p&gt;For this time period, how many authentication attempts were successful.&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-javascript"&gt;from(bucket: v.bucket)
  |&amp;gt; range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |&amp;gt; filter(fn: (r) =&amp;gt;
    r._measurement == "auth_activity"
    and r._value == "login_success"
  )
  |&amp;gt; group()
  |&amp;gt; count()&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;Failures&lt;/h5&gt;
&lt;p&gt;Demonstrates how many authentication attempts failed during this time.&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-javascript"&gt;from(bucket: v.bucket)
  |&amp;gt; range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |&amp;gt; filter(fn: (r) =&amp;gt;
    r._measurement == "auth_activity"
    and r._value == "login_failure"
  )
  |&amp;gt; group()
  |&amp;gt; count()&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;Average address cardinality per account&lt;/h5&gt;
&lt;p&gt;For the given time period, what is the average number of internet addresses used for each user id.&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-javascript"&gt;from(bucket: v.bucket)
  |&amp;gt; range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |&amp;gt; filter(fn: (r) =&amp;gt;
    r._measurement == "auth_activity"
    and r._field == "auth_result"
  )
  |&amp;gt; keep(columns:["email_address","source_address"])
  |&amp;gt; group(columns: ["email_address"])
  |&amp;gt; unique(column: "source_address")
  |&amp;gt; count(column: "source_address")
  |&amp;gt; group()
  |&amp;gt; mean(column: "source_address")&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;Total account cardinality per address&lt;/h5&gt;
&lt;p&gt;How many accounts were used per internet address during the same time period.&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-javascript"&gt;addresses = from(bucket: v.bucket)
  |&amp;gt; range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |&amp;gt; filter(fn: (r) =&amp;gt;
    r._measurement == "auth_activity"
    and r._field == "auth_result"
  )
  |&amp;gt; keep(columns:["source_address"])
  |&amp;gt; map(fn: (r) =&amp;gt; ({ r with field: "x1" }))
  |&amp;gt; group(columns:["field"])
  |&amp;gt; rename(columns: {source_address: "_value"})
  |&amp;gt; unique()
  |&amp;gt; count()

accounts = from(bucket: v.bucket)
  |&amp;gt; range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |&amp;gt; filter(fn: (r) =&amp;gt;
    r._measurement == "auth_activity"
    and r._field == "auth_result"
  )
  |&amp;gt; keep(columns:["email_address"])
  |&amp;gt; map(fn: (r) =&amp;gt; ({ r with field: "x1" }))
  |&amp;gt; group(columns:["field"])
  |&amp;gt; rename(columns: {email_address: "_value"})
  |&amp;gt; unique()
  |&amp;gt; count()

join(tables: { d1: addresses, d2: accounts }, on: ["field"])
  |&amp;gt; map(fn: (r) =&amp;gt; ({
    r with _value: float(v: r._value_d1) / float(v: r._value_d2)
  }))
  |&amp;gt; keep(columns:["_value"])&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;Authentication results&lt;/h5&gt;
&lt;p&gt;Summary of authentication attempt successes and failures that occurred during the entire time period.&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-javascript"&gt;from(bucket: v.bucket)
  |&amp;gt; range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |&amp;gt; filter(fn: (r) =&amp;gt;
    r._measurement == "auth_activity"
    and (r._field == "auth_result")
  )
  |&amp;gt; keep(columns: ["_start","_stop","_time","_value"])
  |&amp;gt; map(fn: (r) =&amp;gt; ({ r with res: r._value }))
  |&amp;gt; group(columns: ["res"])
  |&amp;gt; aggregateWindow(every: v.windowPeriod, fn: count )&lt;/code&gt;&lt;/pre&gt;
&lt;h5&gt;Latest authentication events&lt;/h5&gt;
&lt;p&gt;A full list of the authentication events and details for the time period.&lt;/p&gt;
&lt;pre class="line-numbers"&gt;&lt;code class="language-javascript"&gt;from(bucket: v.bucket)
  |&amp;gt; range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |&amp;gt; filter( fn: (r) =&amp;gt;
    r._measurement == "auth_activity"
    and r._field == "auth_result"
  )
  |&amp;gt; duplicate(column: "_value", as: "auth_result")
  |&amp;gt; drop(columns:[
    "_start","_stop","_field","_measurement","application",
    "customer_id", "service_source","saas_account_id","_value",
    "service_domain"
  ])
  |&amp;gt; group()
  |&amp;gt; sort(columns:["_time"], desc: true)&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;A request to our fellow cloud software vendors&lt;/h2&gt;
&lt;p&gt;Let me step onto my soapbox for a moment.&lt;/p&gt;

&lt;p&gt;One thing we’ve noticed is that many cloud services and SaaS applications don’t provide access to security events such as logins. And for those that do, many charge extra for them. For example, here’s the &lt;a href="https://aws.amazon.com/cloudtrail/pricing/"&gt;pricing of AWS CloudTrail&lt;/a&gt;, which lets you log and monitor your AWS account activity.&lt;/p&gt;

&lt;p&gt;As an industry, us cloud and SaaS vendors are doing ourselves a disservice, because these practices reduce the likelihood of our customers finding security breaches. The more we can make security events widely available via APIs – and make those APIs free – the more we can build trust in the products we all offer.&lt;/p&gt;

&lt;p&gt;&lt;img class="wp-image-254075" src="/images/legacy-uploads/security-events-api-trust-photo.jpg" alt="security events API trust" width="395" height="592" /&gt;&lt;/p&gt;
&lt;figcaption&gt; Credit: &lt;a href="https://unsplash.com/@sammiechaffin"&gt;@sammiechaffin&lt;/a&gt; via &lt;a href="https://unsplash.com/photos/Zdf3zn5XXtU"&gt;Unsplash&lt;/a&gt;&lt;/figcaption&gt;

&lt;p&gt;Think of the car industry – they don’t charge extra for fancier seatbelts, anti-lock brakes, or airbags. These come standard, because car vendors know that the safer they make cars, the more people will trust them as a mode of transportation. We need to start thinking like that.&lt;/p&gt;

&lt;p&gt;So if you’re a cloud software developer, please make your security events, especially authentication events, available via a free API. Specifically, provide programmatic access, either via pull (REST API calls) or push (web sockets, MQTT, AMQP, etc.) of the following information:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;strong&gt;Access:&lt;/strong&gt; Who (attempted) log in, at what time, and from where, in the form of IP address or &lt;a href="https://en.wikipedia.org/wiki/Fully_qualified_domain_name"&gt;fully-qualified domain name&lt;/a&gt; (FQDN). Even better: determine the latitude and longitude of a login. This way a customer can compute the distance between login sessions to see if they indicate an account compromise.&lt;/li&gt;
 	&lt;li&gt;&lt;strong&gt;Usage:&lt;/strong&gt; How long someone's session lasted.&lt;/li&gt;
 	&lt;li&gt;&lt;strong&gt;Activity:&lt;/strong&gt; This is domain-specific and should allow tracking of at least add, change, and delete operations in an application or cloud service.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="https://portal.influxdata.com/downloads/"&gt;InfluxDB OSS&lt;/a&gt; and &lt;a href="https://www.influxdata.com/products/influxdb-enterprise/"&gt;Enterprise&lt;/a&gt; products produce detailed authorization and activity logs. This is available through &lt;a href="https://aws.amazon.com/marketplace/pp/InfluxData-Inc-InfluxDB-Enterprise/prodview-m6excs2fnnq5c"&gt;AWS&lt;/a&gt;, &lt;a href="https://azuremarketplace.microsoft.com/en-us/marketplace/apps/influxdata.influxdb-enterprise-cluster?tab=overview"&gt;Azure&lt;/a&gt;, and &lt;a href="https://console.cloud.google.com/marketplace/details/google/influxdb?pli=1"&gt;Google Cloud&lt;/a&gt; marketplaces to streamline the installation and purchasing.&lt;/p&gt;

&lt;p&gt;Now, to be completely transparent, the information is only available for InfluxDB Cloud services with a request to the support team. The capabilities are on our product roadmap, and we are working to rectify this.&lt;/p&gt;
&lt;h2&gt;More on InfluxData and security&lt;/h2&gt;
&lt;p&gt;InfluxDB content on security:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;a href="https://www.influxdata.com/blog/monitoring-endpoint-security-states-with-influxdb/"&gt;Monitoring Endpoint Security States with InfluxDB&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://www.influxdata.com/blog/fail2ban-monitoring-with-influxdb-and-telegraf"&gt;Fail2ban Monitoring with InfluxDB and Telegraf&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://www.influxdata.com/blog/automating-ssl-certificate-expiration-monitoring/"&gt;Automating SSL Certificate Expiration Monitoring&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://docs.influxdata.com/influxdb/v2.0/security/"&gt;InfluxDB OSS 2.0 Security and Authorization&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://docs.influxdata.com/influxdb/v1.8/administration/security/"&gt;Manage InfluxDB security | InfluxDB OSS 1.8 Documentation&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://www.influxdata.com/security/"&gt;Security at InfluxData&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://www.influxdata.com/blog/network-security-monitoring-with-suricata-and-telegraf/"&gt;Network Security Monitoring with Suricata and Telegraf | Blog&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://docs.influxdata.com/influxdb/v1.8/administration/authentication_and_authorization/"&gt;Authentication and authorization in InfluxDB | InfluxDB OSS 1.8 Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We have the following security monitoring templates:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;a href="https://www.influxdata.com/blog/influxdb-endpoint-security-state-template/"&gt;Endpoint Security State Template&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://www.influxdata.com/influxdb-templates/fail2ban/"&gt;Fail2Ban Template&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://www.influxdata.com/influxdb-templates/x509-ssl-certificates/"&gt;X509 SSL Certificate Expiration Template&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Sending log data to InfluxDB:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;a href="https://docs.fluentd.org/how-to-guides/syslog-influxdb"&gt;Send Syslog Data to InfluxDB&lt;/a&gt; and &lt;a href="https://github.com/influxdata/telegraf/blob/release-1.17/plugins/inputs/syslog/README.md"&gt;Telegraf Syslog input plugin&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://github.com/influxdata/telegraf/blob/release-1.17/plugins/inputs/docker_log/README.md"&gt;Telegraf Docker Log plugin&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://docs.influxdata.com/telegraf/v1.17/plugins/#graylog"&gt;Telegraf Graylog input plugin&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://www.influxdata.com/blog/telegraf-correlate-log-metrics-data-performance-bottlenecks/"&gt;Telegraf Logparser plugin&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://github.com/influxdata/telegraf/blob/release-1.17/plugins/inputs/logstash/README.md"&gt;Telegraf Logstash plugin&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://github.com/influxdata/telegraf/blob/release-1.17/plugins/inputs/tail/README.md"&gt;Telegraf Tail plugin&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://github.com/fangli/fluent-plugin-influxdb"&gt;A buffered output plugin for fluentd and InfluxDB&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Sending log data from InfluxDB:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;&lt;a href="https://github.com/influxdata/telegraf/blob/release-1.17/plugins/outputs/graylog/README.md"&gt;Telegraf Graylog output plugin&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://github.com/influxdata/telegraf/blob/release-1.17/plugins/outputs/sumologic/README.md"&gt;Telegraf Sumo Logic output plugin&lt;/a&gt;&lt;/li&gt;
 	&lt;li&gt;&lt;a href="https://github.com/influxdata/telegraf/blob/release-1.17/plugins/outputs/syslog/README.md"&gt;Telegraf Syslog output plugin&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;As we migrate our operations and services from self-hosted to cloud, the security-related events are more difficult to collect and correlate yet become even more important to watch. Our tools and methods must evolve in order to keep up with a continually changing attack surface, and the InfluxData platform can be utilized well for this.&lt;/p&gt;

&lt;p&gt;We will continue to build and demonstrate various methods for improving our security posture, so stay tuned for more!&lt;/p&gt;

&lt;p&gt;If you’re using a time series database for security monitoring, we’d love to hear from you. Let us know on &lt;a href="https://www.influxdata.com/slack"&gt;our Slack&lt;/a&gt; or on &lt;a href="https://community.influxdata.com/"&gt;our community website&lt;/a&gt;. And if you want to try InfluxDB for yourself, &lt;a href="https://www.influxdata.com/products/influxdb-cloud/"&gt;get it here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thank you, Al Sargent and Peter Albert, for your assistance and contributions to this article.&lt;/p&gt;
</description>
      <pubDate>Fri, 29 Jan 2021 04:00:13 -0700</pubDate>
      <link>https://www.influxdata.com/blog/how-we-use-influxdb-for-security-monitoring/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/how-we-use-influxdb-for-security-monitoring/</guid>
      <category>Product</category>
      <category>Use Cases</category>
      <category>Developer</category>
      <author>Darin Fisher (InfluxData)</author>
    </item>
    <item>
      <title>InfluxDB Endpoint Security State Template</title>
      <description>&lt;p&gt;&lt;em&gt;Our team recently discovered an exposed endpoint without authentication enabled, though we know it had previously been required. The root cause was a missing configuration as a result of a recent upgrade a few weeks earlier, and was easy to fix by simply enabling the configuration parameter correctly.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;We needed a way to catch this type of issue quickly going forward, for this and for other public endpoints, which should be secure by default. Here is how we solved it.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A &lt;a href="https://w2.influxdata.com/products/influxdb-templates/"&gt;complete monitoring system&lt;/a&gt; should continuously verify that the security controls are functioning as expected and have not changed. Here we see how to track the state of our web service authentication and SSL certificates with the &lt;a href="https://w2.influxdata.com/influxdb-templates/endpoint-security/"&gt;InfluxDB Endpoint Security State Template&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This will tell us:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;Is the service available?&lt;/li&gt;
 	&lt;li&gt;Is the SSL certificate still valid?&lt;/li&gt;
 	&lt;li&gt;If authentication is required, is it turned on and functioning?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Service availability is one of the many metrics used for both security and operations. One example where availability is a security concern is a DoS (or DDoS) attack. The purpose of such an attack is to render a service unavailable.&lt;/p&gt;

&lt;p&gt;The SSL certificate validation can also be used by operators to assist in certificate renewal automation. For security purposes, we need to regularly validate that our identity and service security precautions are functioning properly.&lt;/p&gt;

&lt;p&gt;When authentication is required, we should continually verify that it is active and functioning properly. A bug, misconfiguration, or hack attempt are a few of the possible causes for authentication to be failing, and possibly letting everyone have access.&lt;/p&gt;

&lt;p&gt;We recommend utilizing a dedicated service account for authentication validation. The account should have read-only access to the minimum level of services required to function.&lt;/p&gt;

&lt;p&gt;Set up the &lt;a href="https://v2.docs.influxdata.com/v2.0/reference/cli/influx/config/"&gt;InfluxDB CLI environment&lt;/a&gt;; from the command line run:&lt;/p&gt;
&lt;pre&gt;&lt;code class="language-bash"&gt;influx apply --template-url https://raw.githubusercontent.com/influxdata/community-templates/master/endpoint-security-state/endpoint-security-state.yml&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;a href="https://w2.influxdata.com/time-series-platform/telegraf/"&gt;Telegraf&lt;/a&gt; configuration will need to be updated with the URLs and credentials for the endpoint(s) you wish to monitor.&lt;/p&gt;

&lt;p&gt;&lt;img class="alignnone size-full wp-image-248432 aligncenter" src="/images/legacy-uploads/telegraf-config-influxdb-endpoint-security-state-template.png" alt="Telegraf config InfluxDB Endpoint Security State Template" width="938" height="450" /&gt;&lt;/p&gt;

&lt;p&gt;Download the Telegraf template, from the navigation window in the InfluxDB UI, select &lt;strong&gt;Data?Telegraf&lt;/strong&gt;.  From here, select the configuration, “Endpoint Security State” and download the file to your system.&lt;/p&gt;

&lt;p&gt;&lt;img class="alignnone size-full wp-image-248433 aligncenter" src="/images/legacy-uploads/telegraf-configuration-endpoint-security-state-template.png" alt="Telegraf configuration endpoint security state template" width="941" height="639" /&gt;&lt;/p&gt;

&lt;p&gt;Let’s take a deeper look at the &lt;a href="https://docs.influxdata.com/telegraf/v1.14/"&gt;Telegraf config&lt;/a&gt; (shown above). It uses multiple input plugins and the &lt;a href="https://docs.influxdata.com/telegraf/v1.14/plugins/plugin-list/#regex"&gt;Regex processor&lt;/a&gt; to normalize the data a bit.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://docs.influxdata.com/telegraf/v1.14/plugins/plugin-list/#x509_cert"&gt;x509 Cert plugin&lt;/a&gt; collects various metrics from the site’s certificate. This only supports the HTTPS schema.&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://docs.influxdata.com/telegraf/v1.14/plugins/plugin-list/#http_response"&gt;HTTP Response plugin&lt;/a&gt; is utilized for connection and authorization attempts.&lt;/p&gt;

&lt;p&gt;For authorization testing, make sure to configure each endpoint with and without credentials.  We need one to fail for validation.&lt;/p&gt;

&lt;p&gt;Verify the URL is not redirected to another site for authentication if it is enabled.&lt;/p&gt;

&lt;p&gt;&lt;img class="size-full wp-image-248434 aligncenter" src="/images/legacy-uploads/flux-endpoint-security-state-template.png" alt="Flux endpoint security state template" width="939" height="615" /&gt;&lt;/p&gt;

&lt;p&gt;The &lt;a href="https://w2.influxdata.com/products/flux/"&gt;Flux&lt;/a&gt; query uses the response status code to determine the various states. Any successful status or authentication failure response indicates the service is available. An authentication failure response indicates authentication services are available. Successful responses indicate authentication is functioning properly.&lt;/p&gt;

&lt;p&gt;&lt;img class="alignnone size-full wp-image-248435 aligncenter" src="/images/legacy-uploads/influxdb-endpoint-security-state-template-results.png" alt="InfluxDB Endpoint Security State Template results" width="936" height="272" /&gt;&lt;/p&gt;

&lt;p&gt;The resulting table will display each endpoint and an icon to indicate the state for each metric:&lt;/p&gt;
&lt;ul&gt;
 	&lt;li&gt;?  The service or function is as expected.&lt;/li&gt;
 	&lt;li&gt;????  The site's certificate will expire in less than 30 days.&lt;/li&gt;
 	&lt;li&gt;????  The service or function is in a failed or unexpected state.&lt;/li&gt;
 	&lt;li&gt;?  We were not able to derive the state.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This could be extended with &lt;a href="https://v2.docs.influxdata.com/v2.0/monitor-alert/"&gt;alerts&lt;/a&gt; for failed authentication services or expired certificates.&lt;/p&gt;

&lt;p&gt;We could collect the &lt;a href="https://docs.influxdata.com/telegraf/v1.14/plugins/plugin-list/#apache"&gt;Apache&lt;/a&gt; or &lt;a href="https://docs.influxdata.com/telegraf/v1.14/plugins/plugin-list/#nginx"&gt;NGINX&lt;/a&gt; performance metrics, add an endpoint &lt;a href="https://v2.docs.influxdata.com/v2.0/visualize-data/variables/"&gt;variable&lt;/a&gt; along with a couple of &lt;a href="https://v2.docs.influxdata.com/v2.0/visualize-data/visualization-types/"&gt;histograms&lt;/a&gt; to give the user a more complete picture of the services.&lt;/p&gt;

&lt;p&gt;As for me, I really enjoy the ability to quickly build solutions on the InfluxDB platform. Not so long ago, I would cobble together a solution, start evaluating 3rd party solutions or move the problem to the “get this done when I have extra time” queue.&lt;/p&gt;

&lt;p&gt;So go ahead and play with the InfluxDB Endpoint Security State Template, and let us know if you have any questions, on our &lt;a href="https://community.influxdata.com/"&gt;InfluxDB community site&lt;/a&gt; or &lt;a href="https://w2.influxdata.com/slack"&gt;Slack&lt;/a&gt;.&lt;/p&gt;
</description>
      <pubDate>Tue, 21 Jul 2020 07:00:08 -0700</pubDate>
      <link>https://www.influxdata.com/blog/influxdb-endpoint-security-state-template/</link>
      <guid isPermaLink="true">https://www.influxdata.com/blog/influxdb-endpoint-security-state-template/</guid>
      <category>Product</category>
      <category>Use Cases</category>
      <category>Developer</category>
      <author>Darin Fisher (InfluxData)</author>
    </item>
  </channel>
</rss>
