Security Hub Integration

The Guardrails Security Hub integration streams control findings to AWS Security Hub, providing centralized visibility into your security and compliance posture alongside native AWS security services.

Architecture

The integration uses the following AWS services:

ServicePurpose
SNSReceives control state change notifications from Guardrails.
SQSQueues findings for processing.
LambdaTransforms Guardrails notifications into Security Hub finding format and imports them.
ElastiCache (Memcached)Caches finding state to avoid duplicate imports.
CloudWatchMonitoring and alerting for the integration Lambda.
VPCNetwork connectivity for Lambda to reach Security Hub endpoints and Memcached.

Data Flow

  1. Guardrails generates a control_updated notification when a control changes state.
  2. The notification is published to the integration SNS topic.
  3. An SQS queue buffers the notification.
  4. A Lambda function processes the notification: a. Checks Memcached for duplicate/stale findings. b. Transforms the notification into AWS Security Hub finding format (ASFF). c. Calls the Security Hub BatchImportFindings API in the managed account.
  5. The finding appears in Security Hub in the managed account.

Limitations

Deployment

Prerequisites

Deployment Location

EnvironmentDeploy To
EnterpriseThe Guardrails Master account
SaaSA separate AWS account with network access to Security Hub endpoints

Installation

  1. Clone the Security Hub integration repository.
  2. Configure the Terraform variables for your environment.
  3. Run terraform init && terraform apply.
  4. Configure the Firehose watch to deliver control_updated notifications to the integration SNS topic.

IAM Role in Managed Accounts

Each managed account that should receive Security Hub findings needs an IAM role allowing the integration Lambda to call BatchImportFindings. The minimum permissions are:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "securityhub:BatchImportFindings"
      ],
      "Resource": "*"
    }
  ]
}

Lambda Code Updates

When updating the Lambda function code:

  1. Run package-lambda.sh to create the deployment package.
  2. Update the Lambda function using the AWS CLI:
aws lambda update-function-code \
  --function-name turbot-security-hub-integration \
  --zip-file fileb://lambda-package.zip

Monitoring

Decommission

To remove the integration:

terraform destroy

This removes all integration infrastructure (Lambda, SQS, SNS subscription, ElastiCache, VPC resources). It does not remove findings already imported into Security Hub.

Troubleshooting

IssueSolution
Findings not appearing in Security HubCheck CloudWatch Logs for the Lambda function. Verify the Firehose watch is configured and delivering events.
Access Denied when importing findingsVerify the IAM role in the managed account has securityhub:BatchImportFindings permission.
Findings not enabled errorEnable Security Hub in the target account and enable the Guardrails product integration.
Lambda timeoutCheck VPC configuration. The Lambda needs network access to Security Hub endpoints and the Memcached cluster.
Duplicate findingsThe Memcached cache should prevent duplicates. Verify the ElastiCache cluster is healthy.
Further assistanceOpen a Support Ticket