Search code examples
aws-security-groupaws-sdk-java-2.0

How to check if AWS Security Hub integration is enabled for particular AWS_ACCOUNT_ID and Region by SDK?


I want to check if AWS Security Hub integration is enabled for particular aws account ID and particular region using AWS Security Hub SDK?


Solution

  • For checking this, follow the below steps:

    • Your AWS account needs to have connector permissions (AWS-SD-Connector-Role) to target aws account
    • Assume role using the target account ARN (Amazon Resource Name) and get the temporary session credentials of a target account.
    • Now using the temporary session credentials get the security-hub object of a target account and check which all product subscriptions are enabled in it.