fbpx

How to use Amazon Macie to lower the price of finding private information

Amazon Macie is a fully managed data security service that uses machine learning and pattern matching to discover and help protect your sensitive data, such as personally identifiable information (PII), payment card data, and Amazon Web Services (AWS) credentials. Analyzing large volumes of data for the presence of sensitive information can be expensive, due to the nature of compute-intensive operations involved in the process.

 <p>Macie offers several capabilities to help customers reduce the cost of discovering sensitive data, including <a href="https://aws.amazon.com/blogs/aws/automated-data-discovery-for-amazon-macie/" target="_blank" rel="noopener">automated data discovery</a>, which can reduce your spend with new data sampling techniques that are custom-built for <a href="https://aws.amazon.com/s3/" target="_blank" rel="noopener">Amazon Simple Storage Service (Amazon S3)</a>. In this post, we will walk through such Macie capabilities and best practices so that you can cost-efficiently discover sensitive data with Macie.</p> <h2>Overview of the Macie pricing plan</h2> <p>Let’s do a quick recap of how customers pay for the Macie service. With Macie, you are charged based on three dimensions: the number of S3 buckets evaluated for bucket inventory and monitoring, the number of S3 objects monitored for automated data discovery, and the quantity of data inspected for sensitive data discovery. You can read more about these dimensions on the <a href="https://aws.amazon.com/macie/pricing/" target="_blank" rel="noopener">Macie pricing page</a>.</p> <p>The majority of the cost incurred by customers is driven by the quantity of data inspected for sensitive data discovery. For this reason, we will limit the scope of this post to techniques that you can use to optimize the quantity of data that you scan with Macie.</p> <h2>Not all security use cases require the same quantity of data for scanning</h2> <p>Broadly speaking, you can choose to scan your data in two ways—run full scans on your data or sample a portion of it. When to use which method depends on your use cases and business objectives. Full scans are useful when customers <em>have identified what they want to scan</em>. A few examples of such use cases are: scanning buckets that are open to the internet, monitoring a bucket for unintentionally added sensitive data by scanning every new object, or performing analysis on a bucket after a security incident.</p> <p>The other option is to use sampling techniques for sensitive data discovery. This method is useful when security teams want <em>to reduce data security risks</em>. For example, just knowing that an S3 bucket contains credit card numbers is enough information to prioritize it for remediation activities.</p> <p>Macie offers both options, and you can discover sensitive data either by creating and running <a href="https://docs.aws.amazon.com/macie/latest/user/discovery-jobs.html" target="_blank" rel="noopener">sensitive data discovery jobs</a> that perform full scans on targeted locations, or by configuring Macie to perform <a href="https://docs.aws.amazon.com/macie/latest/user/discovery-asdd.html" target="_blank" rel="noopener">automated sensitive data discovery</a> for your account or organization. You can also use both options simultaneously in Macie.</p> <h2>Use automated data discovery as a best practice</h2> <p>Automated data discovery in Macie minimizes the quantity of data scanning that is needed to a fraction of your S3 estate.</p> <p>When you enable Macie for the first time, automated data discovery is enabled by default. When you already use Macie in your organization, you can enable automatic data discovery in the management console of the Amazon Macie administrator account. This Macie capability <a href="https://docs.aws.amazon.com/macie/latest/user/discovery-asdd.html" target="_blank" rel="noopener">automatically starts discovering</a> sensitive data in your S3 buckets and builds a sensitive data profile for each bucket. The profiles are organized in a visual, interactive data map, and you can use the data map to identify data security risks that need immediate attention.</p> <p>Automated data discovery in Macie starts to evaluate the level of sensitivity of each of your buckets by using intelligent and fully managed data sampling techniques to minimize the quantity of data scanning needed. During evaluation, objects are organized with similar S3 metadata, such as bucket names, object-key prefixes, file-type extensions, and storage class, into groups that are likely to have similar content. Macie then selects small, but representative, samples from each identified group of objects and scans them to detect the presence of sensitive data. Macie has a feedback loop that uses the results of previously scanned samples to prioritize the next set of samples to inspect.</p> <p>The automated sensitive data discovery feature is designed to detect sensitive data at scale across hundreds of buckets and accounts, which makes it easier to identify the S3 buckets that need to be prioritized for more focused scanning. Because the amount of data that needs to be scanned is reduced, this task can be done at fraction of the cost of running a full data inspection across all your S3 buckets. The Macie console displays the scanning results as a heat map (Figure 1), which shows the consolidated information grouped by account, and whether a bucket is sensitive, not sensitive, or not analyzed yet.</p> <div id="attachment_28853" class="wp-caption aligncenter"> <img aria-describedby="caption-attachment-28853" src="https://www.infracom.com.sg/wp-content/uploads/2023/03/img1-3-1024x536-1.png" alt="Figure 1: A heat map showing the results of automated sensitive data discovery" width="760" class="size-large wp-image-28853"> <p id="caption-attachment-28853" class="wp-caption-text">Figure 1: A heat map showing the results of automated sensitive data discovery</p> </div> <p>There is a 30-day free trial period when you enable automatic data discovery on your AWS account. During the trial period, in the Macie console, you can see the estimated cost of running automated sensitive data discovery after the trial period ends. After the evaluation period, we charge based on the total quantity of S3 objects in your account, as well as the bytes that are scanned for sensitive content. Charges are prorated per day. You can disable this capability at any time.</p> <h3>Tune your monthly spend on automated sensitive data discovery</h3> <p>To further reduce your monthly spend on automated sensitive data, Macie allows you to <a href="https://docs.aws.amazon.com/macie/latest/user/discovery-asdd-s3bucket-manage.html" target="_blank" rel="noopener">exclude buckets</a> from automated discovery. For example, you might consider excluding buckets that are used for storing operational logs, if you’re sure they don’t contain any sensitive information. Your monthly spend is reduced roughly by the percentage of data in those excluded buckets compared to your total S3 estate.</p> <p>Figure 2 shows the setting in the heatmap area of the Macie console that you can use to exclude a bucket from automated discovery.</p> <div id="attachment_28854" class="wp-caption aligncenter"> <img aria-describedby="caption-attachment-28854" src="https://www.infracom.com.sg/wp-content/uploads/2023/03/img2-4-1024x608-1.png" alt="Figure 2: Excluding buckets from automated sensitive data discovery from the heatmap" width="760" class="size-large wp-image-28854"> <p id="caption-attachment-28854" class="wp-caption-text">Figure 2: Excluding buckets from automated sensitive data discovery from the heatmap</p> </div> <p>You can also use the automated data discovery settings page to specify multiple buckets to be excluded, as shown in Figure 3.</p> <div id="attachment_28855" class="wp-caption aligncenter"> <img aria-describedby="caption-attachment-28855" src="https://www.infracom.com.sg/wp-content/uploads/2023/03/img3-2-1024x608-1.png" alt="Figure 3: Excluding buckets from the automated sensitive data discovery settings page" width="760" class="size-large wp-image-28855"> <p id="caption-attachment-28855" class="wp-caption-text">Figure 3: Excluding buckets from the automated sensitive data discovery settings page</p> </div> <h2>How to run targeted, cost-efficient sensitive data discovery jobs</h2> <p>Making your sensitive data discovery jobs more targeted make them more cost-efficient, because it reduces the quantity of data scanned. Consider using the following strategies:</p> <ol> <li>Make your sensitive data discovery jobs as targeted and specific as possible in their scope by using the <strong>Object criteria</strong> settings on the <strong>Refine the scope</strong> page, shown in Figure 4. <div id="attachment_28856" class="wp-caption aligncenter"> <img aria-describedby="caption-attachment-28856" src="https://www.infracom.com.sg/wp-content/uploads/2023/03/img4-2-1024x599-1.png" alt="Figure 4: Adjusting the scope of a sensitive data discovery job" width="720" class="size-large wp-image-28856"> <p id="caption-attachment-28856" class="wp-caption-text">Figure 4: Adjusting the scope of a sensitive data discovery job</p> </div> <p>Options to make discovery jobs more targeted include:</p> <ul> <li><strong>Include objects by using the “last modified” criterion</strong> — If you are aware of the frequency at which your classifiable S3-hosted objects get modified, and you want to scan the resources that changed at a particular point in time, include in your scope the objects that were modified at a certain date or time by using the “last modified” criterion.</li> <li><strong>Don’t scan CloudTrail logs</strong> — Identify the <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-prefixes.html" target="_blank" rel="noopener">S3 bucket prefixes</a> that contain <a href="https://aws.amazon.com/cloudtrail/" target="_blank" rel="noopener">AWS CloudTrail</a> logs and exclude them from scanning.</li> <li><strong>Consider using random object sampling</strong> — With this option, you specify the percentage of eligible S3 objects that you want Macie to analyze when a sensitive data discovery job runs. If this value is less than 100%, Macie selects eligible objects to analyze at random, up to the specified percentage, and analyzes the data in those objects. If your data is highly consistent and you want to determine whether a specific S3 bucket, rather than each object, contains sensitive information, adjust the <a href="https://docs.aws.amazon.com/macie/latest/user/discovery-jobs-scope.html#discovery-jobs-scope-sampling" target="_blank" rel="noopener">sampling depth</a> accordingly.</li> <li><strong>Include objects with specific extensions, tags, or storage size</strong> — To fine tune the scope of a sensitive data discovery job, you can also define custom criteria that determine which S3 objects Macie includes or excludes from a job’s analysis. These criteria consist of one or more conditions that derive from properties of S3 objects. You can exclude objects with specific file name extensions, exclude objects by using tags as the criterion, and exclude objects on the basis of their storage size. For example, you can use a criteria-based job to scan the buckets associated with specific tag key/value pairs such as <span>Environment: Production</span>.</li> </ul> </li> <li><strong>Specify S3 bucket criteria in your job</strong> — Use a <a href="https://docs.aws.amazon.com/macie/latest/user/discovery-jobs-scope.html#discovery-jobs-scope-buckets" target="_blank" rel="noopener">criteria-based</a> job to scan only buckets that have public read/write access. For example, if you have 100 buckets with 10 TB of data, but only two of those buckets containing 100 GB are public, you could reduce your overall Macie cost by 99% by using a criteria-based job to classify only the public buckets.</li> <li>Consider <a href="https://docs.aws.amazon.com/macie/latest/user/discovery-jobs-create.html#discovery-jobs-create-step3" target="_blank" rel="noopener">scheduling jobs</a> based on how long objects live in your S3 buckets. Running jobs at a higher frequency than needed can result in unnecessary costs in cases where objects are added and deleted frequently. For example, if you’ve determined that the S3 objects involved contain high velocity data that is expected to reside in your S3 bucket for a few days, and you’re concerned that sensitive data might remain, scheduling your jobs to run at a lower frequency will help in driving down costs. In addition, you can deselect the <strong>Include existing objects</strong> checkbox to scan only new objects. <div id="attachment_28857" class="wp-caption aligncenter"> <img aria-describedby="caption-attachment-28857" src="https://www.infracom.com.sg/wp-content/uploads/2023/03/img5-2-1024x490-1.png" alt="Figure 5: Specifying the frequency of a sensitive data discovery job" width="720" class="size-large wp-image-28857"> <p id="caption-attachment-28857" class="wp-caption-text">Figure 5: Specifying the frequency of a sensitive data discovery job</p> </div> </li> <li>As a best practice, review your scheduled jobs periodically to verify that they are still meaningful to your organization. If you aren’t sure whether one of your periodic jobs continues to be fit for purpose, you can pause it so that you can investigate whether it is still needed, without incurring potentially unnecessary costs in the meantime. If you determine that a periodic job is no longer required, you can cancel it completely. <div id="attachment_28858" class="wp-caption aligncenter"> <img aria-describedby="caption-attachment-28858" src="https://www.infracom.com.sg/wp-content/uploads/2023/03/img6-2-1024x211-1.png" alt="Figure 6: Pausing a scheduled sensitive data discovery job" width="720" class="size-large wp-image-28858"> <p id="caption-attachment-28858" class="wp-caption-text">Figure 6: Pausing a scheduled sensitive data discovery job</p> </div> </li> <li>If you don’t know where to start to make your jobs more targeted, use the results of Macie automated data discovery to plan your scanning strategy. Start with small buckets and the ones that have <a href="https://docs.aws.amazon.com/macie/latest/user/findings-types.html#findings-policy-types" target="_blank" rel="noopener">policy findings</a> associated with them.</li> <li>In multi-account environments, you can monitor Macie’s usage across your organization in <a href="https://aws.amazon.com/organizations/" target="_blank" rel="noopener">AWS Organizations</a> through the usage page of the <a href="https://docs.aws.amazon.com/macie/latest/user/accounts-mgmt-ao-admin-change.html" target="_blank" rel="noopener">delegated administrator</a> account. This will enable you to identify member accounts that are incurring higher costs than expected, and you can then investigate and take appropriate actions to keep expenditure low.</li> <li>Take advantage of the <a href="https://calculator.aws/#/createCalculator/Macie" target="_blank" rel="noopener">Macie pricing calculator</a> so that you get an estimate of your Macie fees in advance.</li> </ol> <h2>Conclusion</h2> <p>In this post, we highlighted the best practices to keep in mind and configuration options to use when you discover sensitive data with Amazon Macie. We hope that you will walk away with a better understanding of when to use the automated data discovery capability and when to run targeted sensitive data discovery jobs. You can use the pointers in this post to tune the quantity of data you want to scan with Macie, so that you can continuously optimize your Macie spend.</p> <p>If you have feedback about this post, submit comments in the Comments section below. If you have questions about this post, start a new thread on <a href="https://repost.aws/tags/TA_J7v39UoTdiBWCAlEs2svA/amazon-macie" target="_blank" rel="noopener">Amazon Macie re:Post</a>.</p> <p><strong>Want more AWS Security news? Follow us on <a title="Twitter" href="https://twitter.com/AWSsecurityinfo" target="_blank" rel="noopener noreferrer">Twitter</a>.</strong></p> <!-- '"` -->