Skip to content

Commit 7b8a657

Browse files
niklubnik
and
nik
authored
docs: DIA-1814: Add bucket IP filtering (#6938)
Co-authored-by: nik <[email protected]>
1 parent 4d88872 commit 7b8a657

File tree

1 file changed

+72
-3
lines changed

1 file changed

+72
-3
lines changed

docs/source/guide/storage.md

+72-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ Set up the following cloud and other storage systems with Label Studio:
2424

2525
When working with an external cloud storage connection, keep the following in mind:
2626

27-
* Label Studio doesnt import the data stored in the bucket, but instead creates *references* to the objects. Therefore, you must have full access control on the data to be synced and shown on the labeling screen.
28-
* Sync operations with external buckets only goes one way. It either creates tasks from objects on the bucket (Source storage) or pushes annotations to the output bucket (Target storage). Changing something on the bucket side doesnt guarantee consistency in results.
27+
* Label Studio doesn't import the data stored in the bucket, but instead creates *references* to the objects. Therefore, you must have full access control on the data to be synced and shown on the labeling screen.
28+
* Sync operations with external buckets only goes one way. It either creates tasks from objects on the bucket (Source storage) or pushes annotations to the output bucket (Target storage). Changing something on the bucket side doesn't guarantee consistency in results.
2929
* We recommend using a separate bucket folder for each Label Studio project.
3030

3131
<div class="opensource-only">
@@ -280,7 +280,7 @@ After you [configure access to your S3 bucket](#Configure-access-to-your-S3-buck
280280
- <div class="enterprise-only">(Optional) Enable **Can delete objects from storage** if you want to delete annotations stored in the S3 bucket when they are deleted in Label Studio. The storage credentials associated with the bucket must include the ability to delete bucket objects. Leave disabled to not take any action on annotations if they are deleted in Label Studio. </div>
281281
8. Click **Add Storage**.
282282

283-
After adding the storage, click **Sync** to collect tasks from the bucket, or make an API call to [sync export storage](https://api.labelstud.io/api-reference/api-reference/export-storage/s-3/sync).
283+
After adding the storage, click **Sync** to collect tasks from the bucket, or make an API call to [sync export storage](https://api.labelstud.io/api-reference/api-reference/export-storage/s-3/sync)
284284

285285
<div class="enterprise-only">
286286

@@ -471,6 +471,75 @@ You can also create a storage connection using the Label Studio API.
471471
- See [Create new import storage](/api#operation/api_storages_gcs_create) then [sync the import storage](/api#operation/api_storages_gcs_sync_create).
472472
- See [Create export storage](/api#operation/api_storages_export_gcs_create) and after annotating, [sync the export storage](/api#operation/api_storages_export_gcs_sync_create).
473473

474+
475+
### IP Filtering for Enhanced Security
476+
477+
Google Cloud Storage offers [bucket IP filtering](https://cloud.google.com/storage/docs/ip-filtering-overview) as a powerful security mechanism to restrict access to your data based on source IP addresses. This feature helps prevent unauthorized access and provides fine-grained control over who can interact with your storage buckets.
478+
479+
**Common Use Cases:**
480+
- Restrict bucket access to only your organization's IP ranges
481+
- Allow access only from specific VPC networks in your infrastructure
482+
- Secure sensitive data by limiting access to known IP addresses
483+
- Control access for third-party integrations by whitelisting their IPs
484+
485+
**How to Set Up IP Filtering:**
486+
487+
1. First, create your GCS bucket through the console or CLI
488+
2. Create a JSON configuration file to define IP filtering rules. You have two options:
489+
For public IP ranges:
490+
```json
491+
{
492+
"mode": "Enabled",
493+
"publicNetworkSource": {
494+
"allowedIpCidrRanges": [
495+
"xxx.xxx.xxx.xxx", // Your first IP address
496+
"xxx.xxx.xxx.xxx", // Your second IP address
497+
"xxx.xxx.xxx.xxx/xx" // Your IP range in CIDR notation
498+
]
499+
}
500+
}
501+
```
502+
503+
!!! note
504+
If you're using Label Studio Enterprise at app.humansignal.com and accessing it from your office network:
505+
- Add Label Studio Enterprise outgoing IP addresses (see [IP ranges](saas.html#IP-range))
506+
- Add your office network IP range (e.g. 192.168.1.0/24)
507+
- If both Label Studio Enterprise and your office are on the same VPN network (e.g. 10.0.0.0/16), you only need to add that VPN subnet
508+
509+
510+
For VPC network sources:
511+
```json
512+
{
513+
"mode": "Enabled",
514+
"vpcNetworkSources": [
515+
{
516+
"network": "projects/PROJECT_ID/global/networks/NETWORK_NAME",
517+
"allowedIpCidrRanges": [
518+
RANGE_CIDR
519+
]
520+
}
521+
]
522+
}
523+
```
524+
525+
3. Apply the IP filtering rules to your bucket using the following command:
526+
```bash
527+
gcloud alpha storage buckets update gs://BUCKET_NAME --ip-filter-file=IP_FILTER_CONFIG_FILE
528+
```
529+
530+
4. To remove IP filtering rules when no longer needed:
531+
```bash
532+
gcloud alpha storage buckets update gs://BUCKET_NAME --clear-ip-filter
533+
```
534+
535+
#### Limitations to Consider
536+
- Maximum of 200 IP CIDR blocks across all rules
537+
- Maximum of 25 VPC networks in the IP filter rules
538+
- Not supported for dual-regional buckets
539+
- May affect access from certain Google Cloud services
540+
541+
[Read more about GCS IP filtering](https://cloud.google.com/storage/docs/ip-filtering-overview)
542+
474543
## Microsoft Azure Blob storage
475544

476545
Connect your [Microsoft Azure Blob storage](https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blobs-introduction) container with Label Studio. For details about how Label Studio secures access to cloud storage, see [Secure access to cloud storage](security.html#Secure-access-to-cloud-storage).

0 commit comments

Comments
 (0)