<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Thomas Pepper on Medium]]></title>
        <description><![CDATA[Stories by Thomas Pepper on Medium]]></description>
        <link>https://medium.com/@nacho-woof-revoke?source=rss-8933164fbc64------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*eZbyvpYJNw8T3F2PHvnXqg.png</url>
            <title>Stories by Thomas Pepper on Medium</title>
            <link>https://medium.com/@nacho-woof-revoke?source=rss-8933164fbc64------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 19:43:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nacho-woof-revoke/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AWS Security Hub: The Chronicles of Central Configuration]]></title>
            <link>https://medium.com/@nacho-woof-revoke/aws-security-hub-the-chronicles-of-central-configuration-42e2a0a03705?source=rss-8933164fbc64------2</link>
            <guid isPermaLink="false">https://medium.com/p/42e2a0a03705</guid>
            <category><![CDATA[cloud-security]]></category>
            <category><![CDATA[security-engineering]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[aws-security-hub]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Thomas Pepper]]></dc:creator>
            <pubDate>Thu, 09 Oct 2025 21:00:06 GMT</pubDate>
            <atom:updated>2025-10-09T21:00:06.111Z</atom:updated>
            <content:encoded><![CDATA[<p>Security Hub Central Configuration (SHCC) is one of AWS’s recently released features in the AWS Security Hub Cloud Security Posture Management (CSPM) stack (well it was recent when I initially started this blog but life and priority work curtailed that and SecurityHub CSPM has since been released). Sticking with SHCC for now its purpose is to allow you to manage controls, standards and policies across multiple AWS accounts and AWS Regions, whilst simplifying configuration and preventing configuration drift in child or member accounts.</p><blockquote>Sounds great, right?</blockquote><p>On the face of it, this is a great idea and something that, if implemented properly, would be extremely useful to those responsible for managing the compliance statuses of workloads across an enterprise and ensuring that their regulatory requirements are met. Like many things, there are some pros and then there are some cons, and I wanted to call them out and explain why depending on your organisation it may or may not be the panacea one hopes it is.</p><h3>What’s great?</h3><ul><li>Centrally controlling the configuration of the Security Hub service and its underlying features for members accounts reduces the likelihood of drift.</li><li>Having the ability to apply a single policy that includes the disabled controls, enabled standards to a scoped set of accounts in a single management plane improves administrative user experience with Security Hub.</li><li>The policies provide good flexibility in how they can be pulled together, whether you need something broad or whether you need something specific.</li><li>The introduction of linked regions is extremely useful meaning that in what is a regional service the configuration and deployment across those regions is managed for you by the underlying apis, there is no need to iterate the terraform module over multiple regional aws providers.</li></ul><h3>Things to be considered…</h3><ul><li>The hierarchal nature of how the application and inheritance model works doesn’t scale well for larger enterprises.</li><li>There is a limit on the number of custom policies that are available to every organisation, this is a hard number.</li><li>Policy status is limited in the API responses that are available (SUCCESS, PENDING &amp; FAILURE) this poses an issue because for a policy to succeed all scopes must be applied successfully, there is no PARTIAL status.</li><li>As Security Hub is heavily reliant on AWS Config if your deployment is enforcing AWS config enabled regions via IaC then policy applications with fail. This does not bode well for those organisations deploying SHCC into brownfield environments.</li><li>The biggest peeve I have with this solution is the complete disregard it has for managing suspended accounts, if you were wondering, it doesn’t. There is no capability to exclude a specific OU and this directly means if you follow best practice and regularly suspend accounts, your root policy status will never be success! Almost 11 months and we’re still waiting for this as a feature — <a href="https://github.com/hashicorp/terraform-provider-aws/issues/40510">https://github.com/hashicorp/terraform-provider-aws/issues/40510</a></li><li>The terraform is pretty well documented however it is worth noting that there is a requirement to deploy specific resources in a particular order to have the deploy successfully, at the time of testing and deployment this hadn’t been addressed.</li></ul><h3>Conclusion</h3><p>AWS Security Hub Central Configuration shows promise as a centralised security management solution, but in its current guise there are gaps between design intent and enterprise operational realities.</p><p>While it successfully addresses service configuration drift and provides useful regional automation out of the box, its architectural limitations and lack of suspended account handling make it poorly suited for large-scale enterprise deployments and in order to achieve 100% coverage require you to deviate away from AWS best practice.</p><p>The next step is to write up a how-to-guide on deploying SHCC and provide further insight into how you build custom policies to be applied to varying scopes and different environments and what an alternative architecture looks like.</p><h4>References</h4><ol><li><a href="https://docs.aws.amazon.com/securityhub/latest/userguide/central-configuration-intro.html">https://docs.aws.amazon.com/securityhub/latest/userguide/central-configuration-intro.html</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42e2a0a03705" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to deploy Amazon Inspector2 at scale using Terraform.]]></title>
            <link>https://medium.com/@nacho-woof-revoke/how-to-deploy-amazon-inspector2-at-scale-using-terraform-829243c327a8?source=rss-8933164fbc64------2</link>
            <guid isPermaLink="false">https://medium.com/p/829243c327a8</guid>
            <category><![CDATA[amazon-inspector]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Thomas Pepper]]></dc:creator>
            <pubDate>Fri, 06 Jun 2025 10:46:15 GMT</pubDate>
            <atom:updated>2025-06-06T10:46:15.207Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Background</strong></h3><p>For the last few days, I have spent my time assessing the deployment of Amazon Inspector 2 across a customer’s estate, as it was apparent that some oddities were occurring in the vended accounts, such as <a href="https://docs.aws.amazon.com/securityhub/latest/userguide/inspector-controls.html#inspector-1">[Inspector].1] Amazon Inspector EC2 scanning should be enabled</a> for a given region. The TL;DR was that Amazon Inspector was not enabled in all of the expected regions and was thus causing Security Hub findings to be triggered; upon review, these were true positives, a result of how the service was configured previously.</p><p>My intention with this blog is to help other Security Engineers avoid the problems that I’ve encountered, to help others deploy Amazon Inspector 2 with ease in the future across an enterprise that utilises AWS Organisations.</p><p>Another reason for this blog is that I was not overly enamoured by the Terraform documentation or the Amazon Inspector documentation on how to deploy this service, and browsing the web didn’t yield much either. For context, Amazon has provided a sample repository with supporting scripts to deploy this service using the CLI across multiple regions — <a href="https://github.com/aws-samples/inspector2-enablement-with-cli/tree/main">https://github.com/aws-samples/inspector2-enablement-with-cli/tree/main</a>.</p><p>It’s also referenced in the management console for Inspector too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IPZzELl877f2QxeUYQjbUA.png" /></figure><h3>Amazon Inspector</h3><p>For those who are unfamiliar, Amazon Inspector is the native AWS vulnerability management service that automatically discovers workloads and continuously scans them for software vulnerabilities and unintended network exposure. Since its release, there have been 2 variants: Amazon Inspector (Classic) and Amazon Inspector 2. For this blog, we’re focusing on the latter.</p><p>There are a few key points to note:</p><ul><li>Managing multiple accounts in Amazon Inspector with AWS Organisations requires a Delegated Administrator (DA).</li><li>The DA can only perform a specific set of <a href="https://docs.aws.amazon.com/inspector/latest/user/admin-member-relationship.html#DA-actions">tasks</a>.</li><li>Only the Organisation Administrator can assign a DA.</li><li>Amazon Inspector is a regional service, and therefore, the DA is regional for this service.</li><li>An organisation can have only one DA.</li><li>Changing a DA does not deactivate Amazon Inspector for member accounts.</li></ul><p><strong>Amazon Inspector Terraform Provider</strong></p><p>At present, there are 5 available Terraform resources for this service, the 4 we’re interested in are:</p><p><a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/inspector2_delegated_admin_account"><strong>inspector2_delegated_admin_account</strong></a></p><p>This is used to set the delegated administrator for the service.</p><p><a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/inspector2_enabler"><strong>inspector2_enabler</strong></a></p><p>This is used to enable Inspector in the account provided as the argument.</p><p><a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/inspector2_member_association"><strong>aws_inspector2_member_association</strong></a></p><p>This is used to associate an AWS Account with the DA for management.</p><p><a href="https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/inspector2_organization_configuration"><strong>aws_inspector2_organization_configuration</strong></a></p><p>This resource enables the automatic scanning of associated accounts.</p><h3>What outcome was I trying to achieve?</h3><p>To redeploy Amazon Inspector across the entire organisation across multiple regions through Terraform using a <a href="https://docs.aws.amazon.com/inspector/latest/user/admin-member-relationship.html#DA-actions">delegated administrator</a> to manage Amazon Inspector so that findings can be aggregated in the Security account and that we meet our compliance requirements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*jGWbw1yG5va8k5A0o14PEA.png" /></figure><h3>The Nitty Gritty — Deploying the service</h3><p>The following elements outline the Terraform resources required in the appropriate order to deploy this service at scale.</p><h4><strong>Prerequisites</strong></h4><p><strong>This example assumes that you have the following things configured:</strong></p><ol><li>CI/CD Pipelines are configured with the appropriate <a href="https://docs.github.com/en/actions/security-for-github-actions/security-hardening-your-deployments/configuring-openid-connect-in-amazon-web-services">OIDC</a> configuration, principal and role to deploy resources into the environment with sufficient permission sets attached.</li><li>You can reference specific permissions here for granular control — <a href="https://docs.aws.amazon.com/inspector/latest/user/designating-admin.html">https://docs.aws.amazon.com/inspector/latest/user/designating-admin.html</a> and <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazoninspector2.html">https://docs.aws.amazon.com/service-authorization/latest/reference/list_amazoninspector2.html</a>.</li></ol><p><strong>This example will do the following things:</strong></p><ol><li>Enable and configure a DA</li><li>Create Terraform AWS Providers for multi-region usage</li><li>Enable Amazon Inspector in the DA</li><li>Enable Inspector in an AWS Organisations managed child account</li><li>Associate all listed organisation accounts with the DA</li></ol><h4>Module Preparation</h4><p>We’re going to need to create the following files for usage later on:</p><p><strong>data.tf</strong></p><p>This will call the organisation APIs and return the DA account and ID, and the list of accounts in the organisation.</p><pre>#Gets the current account ID<br>data &quot;aws_caller_identity&quot; &quot;current&quot; {}<br><br>#Lists all accounts in the Org<br>data &quot;aws_organizations_organization&quot; &quot;organisation&quot; {}</pre><p><strong>locals.tf</strong></p><p>This provides some local variables for single modular use. It provides us with some filtering capability on the data call to only show active accounts, as suspended accounts fail the pipeline application.</p><pre>locals {<br>  member_account_ids = [<br>    for account in data.aws_organizations_organization.organisation.accounts : account.id if account.status == &quot;ACTIVE&quot; &amp;&amp; account.id != data.aws_caller_identity.current.account_id<br>  ]<br>}</pre><p><strong>outputs.tf</strong></p><p>This isn’t a mandatory file, but it is useful for running your Terraform commands to determine the plan and scope of accounts to be applied to.</p><pre>output &quot;account_ids&quot; {<br>  value = toset(data.aws_organizations_organization.organisation.accounts[*].id)<br>}<br></pre><p><strong>providers.tf</strong></p><p>We need these as they allow us to iterate over, as this is a regional service. For this example, we’ll focus on deploying to the eu-west-1 and eu-west-2 regions only. If you need more, just add your required regions below.</p><pre>provider &quot;aws&quot; {<br>  alias = &quot;eu-west-1&quot;<br>  region = &quot;eu-west-1&quot;<br>}<br><br>provider &quot;aws&quot; {<br>  alias = &quot;eu-west-2&quot;<br>  region = &quot;eu-west-2&quot;<br>}</pre><h4>Deployment</h4><p>You need to deploy the aws_inspector2_delegated_admin_account resource in the pipeline that controls the organisation administration account and references your DA account ID. This is the only resource we’ll create for this account.</p><pre><br>resource &quot;aws_inspector2_delegated_admin_account&quot; &quot;this&quot; {<br>  account_id = local.inspector_delegated_admin_id<br>}</pre><p>In the pipeline that controls the now chosen DA, you will need to create some additional aws providers to iterate over, as this is a regional service. For this example, we’ll focus on deploying to the eu-west-1 and eu-west-2 regions only. If you need more, just add your required regions below.</p><pre>provider &quot;aws&quot; {<br>  alias = &quot;eu-west-1&quot;<br>  region = &quot;eu-west-1&quot;<br>}<br><br>provider &quot;aws&quot; {<br>  alias = &quot;eu-west-2&quot;<br>  region = &quot;eu-west-2&quot;<br>}</pre><p>Next, you need to enable inspector for the <strong>DA account</strong>, as this is a regional service, we need a resource for each region, ensuring we call the required provider. Note the inclusion of the data call to get the current account ID.</p><pre>data &quot;aws_caller_identity&quot; &quot;current&quot; {}<br><br>#####################<br><br>resource &quot;aws_inspector2_enabler&quot; &quot;da_inspector_euw1&quot; {<br>  provider       = aws.eu-west-1<br>  account_ids    = [data.aws_caller_identity.current.account_id]<br>  resource_types = [&quot;ECR&quot;, &quot;EC2&quot;, &quot;LAMBDA&quot;, &quot;LAMBDA_CODE&quot;]<br><br>  timeouts {<br>    create = &quot;15m&quot;<br>    update = &quot;15m&quot;<br>    delete = &quot;15m&quot;<br>  }<br>}<br><br>resource &quot;aws_inspector2_enabler&quot; &quot;da_inspector_euw2&quot; {<br>  provider       = aws.eu-west-2<br>  account_ids    = [data.aws_caller_identity.current.account_id]<br>  resource_types = [&quot;ECR&quot;, &quot;EC2&quot;, &quot;LAMBDA&quot;, &quot;LAMBDA_CODE&quot;]<br><br>  timeouts {<br>    create = &quot;15m&quot;<br>    update = &quot;15m&quot;<br>    delete = &quot;15m&quot;<br>  }<br>}</pre><p>Once Inspector is enabled in the DA, you can then create the resources to associate the required child account with the DA. This must be run before the inspector2_enabler resource.</p><p>We need the depends_on argument to ensure we wait for resources to complete before starting their respective api calls.</p><pre>resource &quot;aws_inspector2_member_association&quot; &quot;member_inspector_euw1&quot; {<br>  provider   = aws.eu-west-1<br>  for_each   = toset(local.member_account_ids)<br>  account_id = each.key<br><br>  depends_on = [<br>  aws_inspector2_enabler.da_inspector_euw1,<br>  aws_inspector2_enabler.da_inspector_euw2<br>  ]<br>}<br><br>resource &quot;aws_inspector2_member_association&quot; &quot;member_inspector_euw2&quot; {<br>  provider   = aws.eu-west-2<br>  for_each   = toset(local.member_account_ids)<br>  account_id = each.key<br><br>  depends_on = [<br>  aws_inspector2_enabler.da_inspector_euw1,<br>  aws_inspector2_enabler.da_inspector_euw2<br>  ]<br>}</pre><p>Association can take some time, so I incorporated a time_sleep resource to ensure that everything was in situ, which will halt the pipeline for 3 minutes.</p><pre>resource &quot;time_sleep&quot; &quot;inspector2_sleeper&quot; {<br>  create_duration = &quot;3m&quot;<br>  depends_on = [<br>    aws_inspector2_member_association.member_inspector_euw1,<br>    aws_inspector2_member_association.member_inspector_euw2<br>  ]<br>}</pre><p>After you have completed this, we need to create the inspector2_enabler resource to iterate over all of the active accounts, identical to the member association. Note that the [depends on] maps directly to the sleeper and prior resource for each region, not each other.</p><pre><br>resource &quot;aws_inspector2_enabler&quot; &quot;member_inspector_euw1&quot; {<br>  provider       = aws.eu-west-1<br>  for_each       = toset(local.member_account_ids)<br>  account_ids    = [each.key]<br>  resource_types = [&quot;ECR&quot;, &quot;EC2&quot;, &quot;LAMBDA&quot;, &quot;LAMBDA_CODE&quot;]<br><br>  timeouts {<br>    create = &quot;15m&quot;<br>    update = &quot;15m&quot;<br>    delete = &quot;15m&quot;<br>  }<br><br>  depends_on = [<br>    aws_inspector2_member_association.member_inspector_euw1,<br>    time_sleep.inspector2_sleeper<br>  ]<br>}<br><br><br>resource &quot;aws_inspector2_enabler&quot; &quot;member_inspector_euw2&quot; {<br>  provider       = aws.eu-west-2<br>  for_each       = toset(local.member_account_ids)<br>  account_ids    = [each.key]<br>  resource_types = [&quot;ECR&quot;, &quot;EC2&quot;, &quot;LAMBDA&quot;, &quot;LAMBDA_CODE&quot;]<br><br>  timeouts {<br>    create = &quot;15m&quot;<br>    update = &quot;15m&quot;<br>    delete = &quot;15m&quot;<br>  }<br><br>  depends_on = [<br>    aws_inspector2_member_association.member_inspector_euw2,<br>    time_sleep.inspector2_sleeper<br>  ]<br>}</pre><p>The final step is to create the organisation configuration to enable new member accounts to inherit your DA settings for Inspector.</p><pre>resource &quot;aws_inspector2_organization_configuration&quot; &quot;org_inspector_euw1&quot; {<br>  provider = aws.eu-west-1<br>  auto_enable {<br>    ec2         = true<br>    ecr         = true<br>    lambda      = true<br>    lambda_code = true<br>  }<br><br>  depends_on = [<br>    aws_inspector2_enabler.member_inspector_euw1,<br>    time_sleep.inspector2_sleeper<br>  ]<br>}<br><br>resource &quot;aws_inspector2_organization_configuration&quot; &quot;org_inspector_euw2&quot; {<br>  provider = aws.eu-west-2<br>  auto_enable {<br>    ec2         = true<br>    ecr         = true<br>    lambda      = true<br>    lambda_code = true<br>  }<br><br>  depends_on = [<br>    aws_inspector2_enabler.member_inspector_euw2,<br>    time_sleep.inspector2_sleeper<br>  ]<br>}</pre><p>For code cleanliness, re-usability and interpretation, I suggest that you break the files out based on the functions that they are completing, for example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*nnUXk2FCf3QYF7-ePKh7rw.png" /></figure><p>Finally, we need to make sure we call that in a module created at the root level</p><pre>module &quot;org_inspector&quot; {<br>  source = &quot;./modules/inspector-configuration&quot;<br>}</pre><h3>Summary</h3><p>Provided you have all the prerequisites in place, this should enable Inspector2 in eu-west-1 and eu-west-2 for your organisation and then any additionally vended accounts would inherit the same configuration through the DA. Hopefully, this is of use to some of you in the future!</p><p>Happy engineering folks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=829243c327a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>