Alexa Skill secret storage needs review

Keep Alexa authentication secrets out of template text and manage them in an access-controlled secret store.

Description

Use the ClientSecret and RefreshToken from the same Login with Amazon security profile created in the Amazon Developer Console for Alexa Skills Kit. Put their Secrets Manager references in the skill template.

Potential impact

Credentials left in source history or deployment copies can be combined with the other required values to perform permitted skill-management operations.

Remediation

Limit the deployment role to reading the required secret and keep its values out of logs and outputs. Replace or revoke exposed credentials at the issuer. After updating the secret, update the skill resource and verify it uses the new values.

Examples

Store clientSecret and refreshToken in AlexaCredentials. Supply the actual ClientId, VendorId and the omitted SkillPackage.

Before

yaml
Resources:
  MySkill:
    Type: Alexa::ASK::Skill
    Properties:
      AuthenticationConfiguration:
        ClientId: "amzn1.application-oa2-client.1234"
        ClientSecret: "1234"
        RefreshToken: "Atzr|1234"
      VendorId: "1234"

After

yaml
Resources:
  MySkill:
    Type: Alexa::ASK::Skill
    Properties:
      AuthenticationConfiguration:
        ClientId: "amzn1.application-oa2-client.1234"
        ClientSecret: "{{resolve:secretsmanager:AlexaCredentials:SecretString:clientSecret}}"
        RefreshToken: "{{resolve:secretsmanager:AlexaCredentials:SecretString:refreshToken}}"
      VendorId: "1234"

References