Skip to content

Commit 308f0a0

Browse files
authored
feat: use allow list for rclone (#1202)
Update rclone validation to use an allow list system: * All storage types are listed and are explicitly allowed or blocked * For all allowed storage types, all options are marked as allowed or blocked This update also blocks potentially unsafe options (referring to a local file or a potential arbitrary command). Tests in `test/components/renku_data_services/storage/test_rclone.py` are designed to help maintain the configuration of allowed storage types and storage options.
1 parent c7738d1 commit 308f0a0

7 files changed

Lines changed: 6437 additions & 14129 deletions

File tree

components/renku_data_services/data_connectors/doi/schema_org.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ def get_rclone_config(dataset: SchemaOrgDataset, provider: DatasetProvider) -> S
3636
case DatasetProvider.envidat:
3737
return __get_rclone_s3_config_envidat(dataset)
3838
# TODO: Add scicat here
39-
case x:
40-
raise errors.ValidationError(message=f"Got an unknown dataset provider {x}")
39+
case _:
40+
raise errors.ValidationError(message=f"Got an unknown dataset provider {provider}")
4141

4242

4343
def __get_rclone_s3_config_envidat(dataset: SchemaOrgDataset) -> S3Config:

0 commit comments

Comments
 (0)