S3 Presigned URLs u0026 Secure File Sharing Quiz Quiz

Explore key concepts of S3 presigned URLs and secure file sharing practices. This quiz helps reinforce essential knowledge for safe file uploads, controlled access, and proper use of temporary links in cloud environments.

  1. Purpose of Presigned URLs

    What is the primary purpose of using a presigned URL in secure file sharing?

    1. To compress large files for faster download
    2. To make files public to all users
    3. To encrypt files during upload
    4. To temporarily grant access to a file without sharing permanent credentials

    Explanation: Presigned URLs are used to provide temporary, secure access to specific files without exposing long-term security credentials. They do not compress files or make them universally public. While they aid in secure file transfer, encryption is a separate process and is not handled solely by presigned URLs.

  2. Presigned URL Expiry

    Which aspect determines how long a presigned URL remains valid for accessing a file?

    1. File size
    2. User's password strength
    3. Number of downloads allowed
    4. Its expiration time set during creation

    Explanation: The validity of a presigned URL is governed by the expiration time specified when it is generated. File size and password strength do not impact the URL's duration. The number of downloads is not automatically limited unless additional logic is implemented.

  3. Public vs Presigned Access

    In a scenario where you want to share a file with one person securely, why are presigned URLs preferred over setting the file as public?

    1. They restrict access to a limited time and do not expose the file to everyone
    2. They prevent uploads
    3. They allow unlimited downloads
    4. They reduce file size

    Explanation: Presigned URLs enable controlled, time-limited access to a specific user, preserving the file's privacy. Setting a file as public exposes it to all, which is less secure. Presigned URLs do not alter file size or inherently control download limits. They also do not specifically prevent uploads unless so configured.

  4. File Upload via Presigned URL

    If you wish to let a user securely upload a file to a storage bucket without revealing credentials, what type of presigned URL would you generate?

    1. One that allows COPY requests
    2. One that allows GET requests
    3. One that allows PUT requests
    4. One that allows DELETE requests

    Explanation: A PUT request enables a user to upload or overwrite a file using a presigned URL. A GET request is intended for downloading files. DELETE and COPY requests are used for deleting or copying files, not for uploading. Allowing PUT ensures users can upload securely.

  5. Presigned URL Reuse

    What happens when a presigned URL is shared with multiple users before it expires?

    1. Each user must generate their own presigned URL
    2. All recipients can access the file until the URL expires
    3. The link is disabled after first use
    4. Only the first user to click the link gets access

    Explanation: A presigned URL can be used by anyone who has the link until its expiration. It is not restricted to a single user or a one-time use unless additional measures are implemented. Recipients do not have to generate their own URLs, and the link does not automatically deactivate after one click.

  6. URL Expiration and Security

    Why is it important to set a short expiration time for presigned URLs used in secure file sharing?

    1. To minimize the window of potential unauthorized access
    2. To save storage space
    3. To enable file encryption
    4. To increase download speed

    Explanation: Short expiration times reduce the risk that someone could misuse the link if it is leaked. Expiration time does not affect storage usage, download speed, or automatically provide encryption. The main security benefit comes from limiting the duration the link is valid.

  7. Tampering and URL Signing

    How does a presigned URL prevent users from altering resources or access permissions directly in the link?

    1. It disables the use of HTTPS
    2. It includes a signature that becomes invalid if the URL parameters are changed
    3. It uses a random file name
    4. It is hidden from users in all cases

    Explanation: The signature ensures the URL cannot be manipulated; any change to parameters invalidates the link. Hiding URLs is not always possible, and disabling HTTPS would decrease security. Using a random file name does not prevent unauthorized parameter changes.

  8. Operation Restriction

    You share a presigned URL with 'GET' permission for a file. What can the recipient do with this link?

    1. Only download the file
    2. Upload a new file
    3. Edit the file
    4. Delete the file

    Explanation: A 'GET' operation is for downloading or retrieving the file. It does not permit uploads, deletions, or edits. Other operations such as 'PUT' or 'DELETE' would be required for these actions and would need separate presigned URLs.

  9. Revoking Presigned URL Access

    What is one way to revoke access to a presigned URL that is still active?

    1. Extend the expiration time
    2. Change the font of the file name
    3. Delete or move the targeted file so the link becomes invalid
    4. Clear browser cookies

    Explanation: Moving or deleting the file ensures the presigned URL points to a non-existent resource, effectively revoking access. Changing the file name's font or clearing browser cookies does not impact the link. Extending expiration time would keep the link valid longer, not revoke it.

  10. Safe Distribution Practice

    What is a recommended best practice when distributing presigned URLs for secure file access?

    1. Send presigned URLs only over secure, private communication channels
    2. Share the URL in plain text on public websites
    3. Use long expiration times for convenience
    4. Post the URL publicly for wide access

    Explanation: Distributing presigned URLs privately ensures only authorized users have access, maintaining security. Posting the URL publicly or on websites exposes it to everyone, making the resource vulnerable. Using long expiration times also increases risk by leaving the access window open longer.