Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
    • Security
Labs

Applying Signed URLs to Cloud Storage Objects

By default, the contents of Cloud Storage buckets are not publicly available. You can, however, make an object or an entire bucket viewable by all. But sometimes neither of these approaches – totally blocking or totally allowing access – is the right one. Google Cloud offers a method for providing limited access to one or more individuals for a specified time: the signed URL. Anyone using the signed URL can access a secure bucket object for the predetermined period, regardless of whether they are in your organization or even have a Google account. In this hands-on lab, we’ll set up a bucket with an object that is not publicly available and then create the necessary structure – a service account with a private key – required to generate the signed URL.

Lab platform
Lab Info
Level
Beginner
Last updated
Sep 02, 2025
Duration
30m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Create a Cloud Storage Bucket and Copy the File to It
    1. Activate the Cloud Shell.
    2. When it spins up, create the necessary bucket. gsutil mb -c regional -l us-east1 gs://[BUCKET_NAME]

      (Note: The bucket name must be unique.)

    3. Clone the GitHub repository: git clone https://github.com/linuxacademy/content-gcpro-security-engineer
    4. Change directory to the content-gcpro-security-engineer/signed-url-lab folder: cd content-gcpro-security-engineer/signed-url-lab
    5. Copy the file to the bucket: gsutil cp restricted-logo.png gs://[BUCKET_NAME]
  2. Challenge

    Create a Service Account and Key
    1. In the Cloud Shell, run the following code to establish a variable: export PROJECT_ID=[YOUR_PROJECT_ID]
    2. Create a service account with the proper permissions: gcloud iam service-accounts create la-service-account --display-name "LA Service Account" gcloud projects add-iam-policy-binding ${PROJECT_ID} --member serviceAccount:la-service-account@${PROJECT_ID}.iam.gserviceaccount.com --role roles/viewer
    3. Create a JSON key for authentication: gcloud iam service-accounts keys create key.json --iam-account la-service-account@${PROJECT_ID}.iam.gserviceaccount.com
  3. Challenge

    Generate a Signed URL
    1. In the Cloud Shell, install the openssl headers for Debian GNU/Linux
    sudo apt-get install build-essential libssl-dev libffi-dev 
      python3-dev cargo
    
    
    1. In the Cloud Shell, install the required library:
      sudo -H pip3 install --upgrade pip        
      sudo pip3 install pyopenssl
    
    1. Generate the signed URL: gsutil signurl -d 10m key.json gs://[BUCKET_NAME]/restricted-logo.png
    2. Test the URL by clicking the generated link.
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight