Skip to content

Cross-account sharing of a sender ID, but the SMS is still sent as UNVERIFIED.

0

Issue Summary

We have two AWS accounts under the same AWS Organization:

  • Account A (A-ID): Holds a registered Australia Sender ID (MYBRAND) and can successfully send SMS messages with the correct Sender ID.
  • Account B (B-ID): Runs Amazon Cognito for MFA SMS authentication.

Objective

Ensure that Amazon Cognito in Account B correctly uses the Sender ID registered in Account A when sending MFA SMS messages.


Current Configuration

Account A (Sender ID Owner)

  1. Sender ID Registered

    • Account A has registered Australia Sender ID (MYBRAND).
    • When sending SMS directly from Account A, the Sender ID is displayed correctly.
  2. Shared Sender ID with Account B following this AWS tutorial: https://docs.aws.amazon.com/sms-voice/latest/userguide/shared-resources.html#sharing-policy-example-sender-id

    • Using AWS Resource Access Manager (RAM) to share the Sender ID with Account B.
    • A policy was attached to the Sender ID:
    {
        "Effect": "Allow",
        "Principal": {
            "AWS": "arn:aws:iam::B-ID:root"
        },
        "Action": ["sms-voice:SendTextMessage", "sms-voice:SendVoiceMessage", "sms-voice:SendMediaMessage", "sms-voice:DescribeSenderIds"],
        "Resource": "arn:aws:sms-voice:Region:A-ID:sender-id/SenderID/ISO"
    }

Account B

  1. Without the shared Sender ID:

    • SMS delivers successfully, but the Sender ID is UNVERIFIED.
  2. After accepting the shared Sender ID and set it as the default Sender ID in SNS:

    • Still UNVERIFIED.
  3. Publishing SMS directly from SNS Console in Account B with the shared Sender ID:

    • The SMS still shows UNVERIFIED.

Alternative Approaches Tried (Failed)

1. Modifying the Sender ID Policy in Account A

Attempted to allow SNS service access directly using a policy:

{
    "Effect": "Allow",
    "Principal": {
        "Service": "sns.amazonaws.com"
    },
    "Action": "sms-voice:SendTextMessage",
    "Resource": "arn:aws:sms-voice:Region:A-ID:sender-id/SenderID/ISO",
    "Condition": {
        "StringEquals": {
            "aws:SourceAccount": "B-ID"
        }
    }
}

Issue:

  • This policy is invalid, as AWS does not allow aws:SourceAccount to reference a non-owner account.

2. Adding IAM Policy in Cognito's IAM Role (Account B)

Added the following permissions to the Cognito SMS IAM Role in Account B:

{
    "Effect": "Allow",
    "Action": ["sms-voice:SendTextMessage", "sms-voice:SendVoiceMessage", "sms-voice:SendMediaMessage", "sms-voice:DescribeSenderIds"],
    "Resource": "arn:aws:sms-voice:ap-southeast-2:B-ID:sender-id/SenderID/ISO"
}

Issue:

  • Cognito still sends SMS messages with an UNVERIFIED Sender ID.

3. Creating an IAM Role in Account A for Cognito to Assume

  • Created an IAM Role in Account A, allowing Account B's Cognito to assume it and send SMS messages.
  • Attempted to configure Cognito in Account B to assume this role before sending SMS.

Issue:

  • Cognito does not assume IAM roles when sending SMS.
2 Answers
1

The issue you're experiencing with cross-account sharing of a Sender ID for Amazon Cognito SMS messages is complex and involves several AWS services. Here's an analysis of the situation and some potential solutions:

  1. Sender ID Support: First, ensure that the recipient's country (Australia in this case) supports Sender IDs. Australia does support Sender IDs, so this shouldn't be the issue.

  2. Resource Sharing: Your approach of using AWS Resource Access Manager (RAM) to share the Sender ID between accounts is correct. However, the problem may lie in how Cognito is attempting to use this shared resource.

  3. Cognito SMS Configuration: Amazon Cognito uses Amazon SNS for sending SMS messages. When configuring Cognito for SMS, you need to ensure that it's set up to use the shared Sender ID. This configuration isn't automatically inherited from the shared resource.

  4. IAM Permissions: While you've added permissions to the Cognito SMS IAM Role in Account B, Cognito might not be using these permissions directly when sending SMS. Instead, it relies on its integration with SNS.

  5. SNS Configuration: Since Cognito uses SNS, you may need to configure SNS in Account B to use the shared Sender ID. This could involve setting up an SNS topic or adjusting SNS settings to recognize and use the shared Sender ID.

  6. Cross-Account Resource Use: Using resources across accounts can be tricky, especially with services like Cognito that integrate with other AWS services (in this case, SNS).

To resolve this issue, try the following steps:

  1. In Account B, configure SNS to use the shared Sender ID as the default Sender ID for SMS messages.

  2. Update the Cognito user pool in Account B to explicitly specify the Sender ID in its SMS configuration.

  3. Ensure that the IAM role used by Cognito in Account B has permissions not just for the Sender ID, but also for SNS operations.

  4. Double-check that the resource policy on the Sender ID in Account A allows both Cognito and SNS from Account B to use it.

  5. If possible, test sending an SMS directly through SNS in Account B using the shared Sender ID to isolate whether the issue is with Cognito or with the cross-account sharing setup.

If these steps don't resolve the issue, you may need to contact AWS Support for further assistance, as there could be account-specific configurations or limitations that are not publicly documented.
Sources
Issue with Approved Sender ID Not Appearing in SMS Messages via Amazon SNS | AWS re:Post
SMS message settings for Amazon Cognito user pools - Amazon Cognito
Sender IDs in AWS End User Messaging SMS - AWS End User Messaging SMS

answered 2 years ago

EXPERT

reviewed 2 years ago

0
  1. In Account B, configure SNS to use the shared Sender ID as the default Sender ID for SMS messages. It is the default Sender ID in Account B
  2. Update the Cognito user pool in Account B to explicitly specify the Sender ID in its SMS configuration. I can't find that option.
  3. Ensure that the IAM role used by Cognito in Account B has permissions not just for the Sender ID, but also for SNS operations. It has and it can send SMS, but not using my Sender ID
  4. Double-check that the resource policy on the Sender ID in Account A allows both Cognito and SNS from Account B to use it. I send SMS from Cognito's console and it still UNVERIFIED.
  5. If possible, test sending an SMS directly through SNS in Account B using the shared Sender ID to isolate whether the issue is with Cognito or with the cross-account sharing setup. I did. still UNVERIFIED.

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.