Courseiva
Security and ComplianceeasyMultiple ChoiceObjective-mapped

SOA-C02 Security and Compliance Practice Question

A company wants to provide temporary credentials to an application running on an on-premises server so it can access AWS resources. The credentials must be rotated automatically. Which IAM feature should be used?

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use IAM Roles Anywhere with a certificate authority to issue temporary credentials.

IAM Roles Anywhere allows workloads running outside of AWS, such as on-premises servers, to assume IAM roles and obtain temporary credentials using X.509 certificates. The credentials are automatically rotated by the service. Option A is wrong because an EC2 instance profile can only be used for EC2 instances, not on-premises servers. Option B is wrong: SAML 2.0 federation is typically used for federating user identities (e.g., SSO), not for application or machine identities. Option C is wrong because IAM users with programmatic access have long-term access keys that do not rotate automatically.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Use an EC2 instance profile and attach it to the on-premises server.

    Why it's wrong here

    An instance profile is an IAM container that is only resolvable through the EC2 instance metadata service (IMDS), which is available exclusively inside EC2. Since an on-premises server has no access to the IMDS endpoint, it cannot retrieve the temporary credentials associated with the instance role. Even if you attempted to copy the role's credentials off an EC2 instance, that would violate the design intent and create a security risk. Thus, instance profiles cannot be used to provide temporary AWS credentials to workloads running outside AWS.

  • Configure a SAML 2.0 identity provider and federate the application.

    Why it's wrong here

    SAML 2.0 federation is designed for human-centric single sign-on, not for automated application or workload access. The SAML authentication flow requires an interactive browser and an identity provider that validates a user's credentials, after which it issues a SAML assertion that can be exchanged for temporary AWS credentials. An application running on a server cannot simply 'log in' via SAML without a user identity and an IdP session, making this approach inappropriate for non-human entities. Additionally, setting up a SAML IdP for an application introduces unnecessary complexity and does not directly grant temporary credentials for machine-to-machine access.

  • Create an IAM user with programmatic access and share the access key.

    Why it's wrong here

    Creating an IAM user with programmatic access yields long-term static access keys that do not expire, directly contradicting the requirement to provide temporary credentials. These keys remain valid indefinitely until manually rotated, creating a significant security burden and exposure risk if leaked. Sharing the access key among multiple systems or developers further amplifies the risk and violates best practices for least privilege and credential hygiene. IAM Roles Anywhere exists precisely to avoid long-lived keys by issuing short-lived, automatically expiring credentials for on-premises workloads.

  • Use IAM Roles Anywhere with a certificate authority to issue temporary credentials.

    Why this is correct

    IAM Roles Anywhere enables on-premises applications to safely obtain temporary AWS credentials by presenting an X.509 certificate issued by a trusted certificate authority (CA). The service uses the certificate's subject and issuer information to match the workload to an IAM role, then calls AWS STS to return temporary credentials that automatically expire after a configurable duration. This approach eliminates the need for long-term access keys and is the recommended pattern for non-AWS servers or hybrid workloads. It is the only option listed that directly satisfies the company's need for temporary credentials for an on-premises application.

About these practice questions

This SOA-C02 question is part of Courseiva's 247-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This SOA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SOA-C02 exam.