Skip to content

Security Hub reporting Config improperly setup.

0

I really do not understand this. I a few years ago I setup Security Hub using the AWS pre-designed Stacked Sets and in the process it setup Config (or so I thought) in my AWS org with the Root account being the Aggregated account for both Security Hub and Config. After setting this up I spent months cleaning up things. Now after a couple of years of running this setup with no changes to it I am getting the control Config.1 as failed in some of our accounts and some regions not all.

Specifically its reporting:

    "RelatedRequirements": [
      "CIS AWS Foundations Benchmark v1.2.0/2.5",
      "CIS AWS Foundations Benchmark v1.4.0/3.5"
"Description": "The AWS Config recorder is using a custom IAM role instead of the AWS Config service-linked role.",
"ReasonCode": "CONFIG_RECORDER_CUSTOM_ROLE"

At the time I set all this up I was told very clearly by people here on re:Post and by support NOT to try to set this up manually but to use the Stacked Sets given by AWS.

So how is it suddenly now complaining that I am using a custom role? I have checked on a few of the accounts its saying failed and the Aggregated account and all are using the role: AWSServiceRoleForConfig which uses the AWS Managed AWSConfigServiceRolePolicy policy.

What am I missing or is this possibly a bad benchmark?

asked 2 years ago3K views

4 Answers
1

You're not going crazy, and you didn't break anything. Let me explain what's happening. The error CONFIG_RECORDER_CUSTOM_ROLE means that in the failing accounts/regions, your Config recorder is using a role that is not the service-linked role AWSServiceRoleForConfig. The Config.1 control now explicitly checks for this.

Why it's failing now when nothing changed on your end: The includeConfigServiceLinkedRoleCheck parameter (default: true) was added to Config.1 as part of Security Hub's alignment with the updated CIS benchmarks (v1.4.0/3.5). Your configuration didn't change — the control's evaluation criteria got stricter. Previously it didn't check which role the recorder was using; now it does.

Why only some accounts/regions: When you deployed via StackSets years ago, the template likely created a custom IAM role for the recorder in some accounts (e.g., something like ConfigRecorderRole or a StackSet-generated role name). Even though it has the same permissions, it's not the actual service-linked role. You mentioned checking a few accounts that show AWSServiceRoleForConfig — the failing ones are likely using a different role. To confirm, run this in one of the failing accounts/regions: bash aws configservice describe-configuration-recorders --region <failing-region>

If the roleARN shows anything other than arn:aws:iam::<account-id>:role/aws-service-role/config.amazonaws.com/AWSServiceRoleForConfig, that's your root cause. To fix it, you have three options:

  1. Update the recorder role to the SLR (recommended) — You can push this via StackSets:

bash aws configservice put-configuration-recorder
--configuration-recorder name=default,roleARN=arn:aws:iam::<ACCOUNT_ID>:role/aws-service-role/config.amazonaws.com/AWSServiceRoleForConfig
--region <region>

  1. Disable the role check — Set the Config.1 parameter includeConfigServiceLinkedRoleCheck to false in Security Hub. The control will still verify Config is enabled and recording resources, it just won't care which role is assigned.
  2. Enable Security Hub CSPM — Per the documentation, when CSPM is enabled, Config.1 always passes because it uses its own internal service-linked configuration recorder.

Bottom line: This isn't a bad benchmark — it's a legitimate best practice because the SLR is automatically kept up to date by AWS with the correct permissions.

Hope this helps clarify things.

AWS

answered 5 months ago

0

The situation you're experiencing with Security Hub reporting Config.1 control failures in some accounts and regions is indeed confusing, especially given that you followed AWS recommendations and used Stack Sets to set up your configuration. However, there are a few points to consider that might explain what's happening:

  1. Config.1 control is critical and checks if AWS Config is enabled, uses the service-linked role for resource recording, and records all required resources in the current region. The failure you're seeing suggests that in some accounts or regions, this isn't the case.

  2. The error message indicates that a custom IAM role is being used instead of the AWS Config service-linked role. This is surprising since you mention that you're using the AWSServiceRoleForConfig role, which is the correct service-linked role.

  3. It's possible that over time, some changes or drift might have occurred in certain accounts or regions, leading to this discrepancy. Even if you haven't made manual changes, automated processes, other team members, or AWS updates could potentially affect the configuration.

  4. The Config.1 control evaluates the current region, and its requirements can vary depending on whether it's the home region, a linked region, or part of an aggregator.

To address this issue:

  1. Double-check the AWS Config setup in the accounts and regions where you're seeing the failure. Ensure that AWS Config is enabled and using the correct service-linked role (AWSServiceRoleForConfig).

  2. Verify that all required resources for your enabled controls are being recorded by AWS Config in each region. This includes IAM global resources in the home region and regions that aren't part of an aggregator.

  3. Review the StatusReasons field in the Compliance object of your finding for more detailed information about why the control is failing.

  4. If you're using cross-region aggregation, ensure that AWS Config recording is correctly configured in the home region and all linked regions.

  5. Consider reaching out to AWS Support with the specific details of your setup and the failures you're seeing. They may be able to provide more targeted assistance or identify if there's an issue with the control itself.

Remember, Security Hub controls can be sensitive to small configuration differences, and what worked in the past might need adjustments as AWS services evolve. Regular review and maintenance of your security posture is important, even when using AWS-provided setups.
Sources
Security Hub controls for AWS Config - AWS Security Hub
Enabling and configuring AWS Config for Security Hub - AWS Security Hub
Required AWS Config resources for Security Hub control findings - AWS Security Hub

answered 2 years ago

0

I suggest you open the role in the IAM console and check if its ARN exactly matches this format:

arn:aws:iam::000000000000:role/aws-service-role/config.amazonaws.com/AWSServiceRoleForConfig

It's possible to create a custom role with a name similar to a service-linked role (SLR), but it won't make it an SLR. An SLR must be created with the iam:CreateServiceLinkedRole API (https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateServiceLinkedRole.html), which is what a CloudFormation stack uses to provision a resource of the type AWS::IAM::ServiceLinkedRole (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-servicelinkedrole.html). That's what should've been included and configured to be used by all the configuration recorders in the stack set that you used.

If the role matches the format above, then I suggest you check the settings of AWS Config in one of the regions Security Hub reports as misconfigured. Open the AWS Config console in one of those regions and click Settings on the left. The page should show a customer-managed recorder, and under "Recording method," it should show the name of the SLR for "IAM role for AWS Config." If a different role is shown, it'd mean that even though the SLR has been created properly, one or more of the configuration recorders for AWS Config are using a different, custom role.

EXPERT

answered 2 years ago

0

Hello,

Thank you for reaching out to us with your concern.

I am writing to let you know that I have confirmed the answer provided by our Expert - Leo K by reaching out to our internal Service team. Based on the update from our internal team, the below answer provided by our Expert - Leo K to your query is correct :

I suggest you open the role in the IAM console and check if its ARN exactly matches this format:

arn:aws:iam::000000000000:role/aws-service-role/config.amazonaws.com/AWSServiceRoleForConfig

It's possible to create a custom role with a name similar to a service-linked role (SLR), but it won't make it an SLR. An SLR must be created with the iam:CreateServiceLinkedRole API (https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateServiceLinkedRole.html), which is what a CloudFormation stack uses to provision a resource of the type AWS::IAM::ServiceLinkedRole (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-servicelinkedrole.html). That's what should've been included and configured to be used by all the configuration recorders in the stack set that you used.

If the role matches the format above, then I suggest you check the settings of AWS Config in one of the regions Security Hub reports as misconfigured. Open the AWS Config console in one of those regions and click Settings on the left. The page should show a customer-managed recorder, and under "Recording method," it should show the name of the SLR for "IAM role for AWS Config." If a different role is shown, it'd mean that even though the SLR has been created properly, one or more of the configuration recorders for AWS Config are using a different, custom role.

Upon saying all of that, if you are already using Service Linked role, then in order to answer your question, we require details that are non-public information. Please open a support case with AWS using the following link: https://console.aws.amazon.com/support/home#/case/create

Feel free to reach back out if you need additional clarification.

Have a great day.

AWS

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.