Securing data using context-based restrictions
In this tutorial, you will establish context-based restrictions that prevent any access to object storage data unless the request originates from a trusted network zone.
Before you begin
Before you plan on using context-based restrictions with Cloud Object Storage buckets, you need:
- An IBM Cloud™ Platform account
- An instance of IBM Cloud Object Storage
- A role of
Administrator
for context-based restrictions - A bucket
Navigate to the context-based restrictions console
From the Manage menu, select Context-based restrictions.
Create a new rule
- Click on Rules.
- Choose a name for the rule. This will help keep things organized if you end up with a lot of different rules across all of your cloud services.
- Click Continue.
Scope the rule
Now you can choose the specific object storage resources to which you would like to apply the context-based restrictions. This can become as specific or generic as you wish - you could apply the rule to all object storage instances and buckets, a specific service instance, or even a specific bucket. Additionally, you can choose which networks (public, private, or direct) you wish to be included.
In this example, we will choose a service instance.
- Select IAM services.
- Choose Cloud Object Storage from the drop down menu.
- Select the Resources based on specific attributes radio button.
- Check the Service instance box.
- Select the service instance you want the rule to affect.
If you want to instead only limit access to a specific bucket, you can select the Resource ID checkbox instead. Provide the name of the bucket in the field - nothing else is necessary.
Create a network zone
Now that we know what the rule will affect, we need to decide what the rule will allow. To do this, we'll create a new network zone and apply it to the new rule.
- Click on Create +.
- Give the network zone a helpful name and description.
- Add some IP ranges to the Allowed IP addresses text box.
- Click Next.
Finish the rule and verify that it works
Finally, all you need to do is click Create and your new rule will be active.
An easy way to check that it works is to [send a simple CLI command] from outside of the allowed network zone, such as a bucket listing (ic cos buckets
). It will fail with a 403
error code.
Next steps
Learn more about context-based restrictions and how they relate to legacy bucket firewalls.