AuthN and AuthZ Essentials for Cloud Security Quiz

Test your understanding of authentication and authorization in cloud environments, including sessions vs. tokens, JWT, OAuth2, RBAC, and the principle of least privilege. Sharpen your cloud security knowledge with this focused, scenario-based quiz.

  1. Authentication vs Authorization

    In a cloud application, what is the main difference between authentication (AuthN) and authorization (AuthZ)?

    1. Authentication grants permissions, while authorization checks passwords.
    2. Authentication and authorization mean the same thing in cloud security.
    3. Authentication verifies identity, while authorization grants access to resources.
    4. Authentication encrypts data, while authorization decrypts data.

    Explanation: Authentication is about confirming who a user is, such as through passwords or biometrics. Authorization, by contrast, determines what actions or resources an authenticated user can access. The other options confuse the concepts or are simply incorrect; granting permissions is part of authorization, not authentication, and encryption or decryption are unrelated to these terms.

  2. Sessions in Authentication

    When a user logs into a cloud dashboard and remains signed in until they close the browser, which mechanism generally maintains their state?

    1. Sessions
    2. Compression
    3. Static IP addresses
    4. Public keys

    Explanation: Sessions keep users signed in and track their authentication state across multiple requests. Public keys are used in cryptography, not for session management. Static IP addresses and compression have no bearing on maintaining logged-in state in cloud interfaces.

  3. Tokens in Cloud Security

    Which of the following is commonly used as a stateless token to carry authentication and authorization information in cloud services?

    1. JWT
    2. HTML
    3. VM
    4. CSV

    Explanation: JWT, or JSON Web Token, enables secure transmission of authentication and authorization data without server-side storage. CSV refers to a file format, HTML is a markup language, and VM stands for virtual machine, none of which are used as security tokens.

  4. Role-Based Access Control (RBAC)

    What does Role-Based Access Control (RBAC) focus on when authorizing cloud users?

    1. Granting access based on device IP address
    2. Assigning permissions based on user roles
    3. Allowing access based only on encryption keys
    4. Limiting resource usage by network speed

    Explanation: RBAC assigns access and permissions according to the roles users have in the organization. It does not work by evaluating IP addresses, encryption keys, or network speed, which are unrelated to how RBAC operates.

  5. Principle of Least Privilege

    Which statement best describes the principle of least privilege in cloud environments?

    1. All users are given administrator rights for flexibility.
    2. Permissions are granted on a first-come, first-served basis.
    3. Users share a single set of credentials for simplicity.
    4. Users are given only the minimum permissions necessary to perform their tasks.

    Explanation: The principle of least privilege helps reduce risk by restricting users to only the permissions they absolutely need. Broad administrator rights, shared credentials, or arbitrary assignment of permissions undermine security and violate this principle.

  6. Session Expiry Risks

    What is a potential risk if a session never expires in a cloud application?

    1. Immediate data loss
    2. Unauthorized access if the session is stolen
    3. Slower network speeds
    4. Higher image resolution

    Explanation: If sessions never expire, a stolen session could be used indefinitely for unauthorized access. Immediate data loss, network speeds, and image quality are unrelated and not consequences of session expiration policies.

  7. JSON Web Token (JWT) Characteristics

    Which feature makes JSON Web Tokens (JWT) suitable for stateless authentication in cloud services?

    1. JWTs contain all required claims and can be validated without server storage.
    2. JWTs must be stored in the server's memory for each user.
    3. JWTs are only usable for internal databases.
    4. JWTs cannot be digitally signed.

    Explanation: JWTs include claims that can be validated using a public key or secret, enabling stateless authentication. They don’t need server-side storage, which makes them scalable. They are not restricted to internal databases and can be signed for integrity.

  8. OAuth2 Scope Concept

    In OAuth2, what is a 'scope' most commonly used for?

    1. Setting password complexity requirements
    2. Measuring session lifetime in milliseconds
    3. Defining what actions or resources a token holder can access
    4. Specifying the geographic region of a cloud service

    Explanation: OAuth2 scopes indicate which resources or actions a token grants permission for. Scopes do not stipulate region, password rules, or session duration; they are central to defining authorization boundaries.

  9. Authorization Failure Scenario

    If a user is authenticated but denied access to a specific resource, what is the likely issue?

    1. The cloud service is down
    2. Their device's clock is incorrect
    3. They entered the wrong username
    4. The user lacks proper authorization

    Explanation: Being authenticated means the user's identity has been confirmed. If they're denied access, it's due to a lack of authorization rather than a time sync issue, service outage, or incorrect username, which would prevent authentication.

  10. Token Expiration Best Practices

    Why is it recommended to set an expiration time on authentication tokens in cloud environments?

    1. To limit the impact if a token is compromised
    2. To remove users automatically after login
    3. To enhance image loading speed
    4. To simplify user passwords

    Explanation: Token expiration ensures any compromised token becomes invalid after a period, reducing risk. It has no effect on images, password policies, or user removal; these options are distractions from token lifecycle management.

  11. Comparing Sessions and Tokens

    How does session-based authentication differ from token-based authentication in cloud architectures?

    1. Sessions and tokens both store state only client-side
    2. Tokens can't be used across different platforms
    3. Sessions store authentication state server-side, while tokens carry state client-side
    4. Sessions require more encryption than tokens

    Explanation: Session-based authentication keeps state on the server, often using cookies, while tokens like JWTs allow state to be managed client-side. The other statements are incorrect; both can use encryption and tokens are known for their cross-platform compatibility.

  12. RBAC User Access Example

    If a cloud user is assigned the role 'viewer' and cannot edit resources, which access model is being applied?

    1. Authenticated Session Handling (ASH)
    2. Open Network Access (ONA)
    3. Role-Based Access Control (RBAC)
    4. Mandatory Access Listing (MAL)

    Explanation: RBAC works by assigning roles, with each role defined by specific permissions. Other options are fabricated or do not refer to any known access control models relevant to this scenario.

  13. OAuth2 Authorization Grant Types

    Which OAuth2 grant type is typically used by user-facing web applications to obtain tokens on the user's behalf?

    1. Implicit Cookie
    2. Device Authorization
    3. Authorization Code
    4. Resource Owner Password

    Explanation: The Authorization Code grant is the most secure and common method for user-facing web applications seeking access tokens on a user’s behalf. Resource owner password is discouraged for security, device authorization fits devices with limited input, and 'Implicit Cookie' is not an OAuth2 grant type.

  14. Resource Access and Least Privilege

    Why is assigning broad access rights to all cloud users not recommended?

    1. It increases the risk of unintended or malicious actions
    2. It lowers the cost of cloud hosting
    3. It simplifies backup strategies
    4. It speeds up application performance

    Explanation: Broad access goes against the principle of least privilege, exposing systems to higher risk if users make mistakes or act maliciously. The other options are unrelated and do not justify excessive permissions.

  15. Access Control for APIs

    Which is a common method for authorizing API requests in stateless cloud environments?

    1. Sending bearer tokens in request headers
    2. Allowing any device with a matching IP address
    3. Requiring browser cookies with every call
    4. Updating user credentials after each use

    Explanation: Bearer tokens in headers are widely used for stateless API authorization, supporting scalability. Relying solely on IP addresses or cookies is less secure or does not align with statelessness, and updating credentials after every request is impractical.

  16. Revoking Cloud Access

    What should be done when a user's role changes or they leave a cloud project to follow best practices?

    1. Increase their privileges as a courtesy
    2. Ignore access controls until the next audit
    3. Update or revoke their access immediately
    4. Notify them but keep their access unchanged

    Explanation: Promptly updating or revoking access is vital to maintain least privilege and prevent misuse. The other options delay or ignore proper access management, creating vulnerabilities or unnecessary risk.