Skip to content

Commit 7bb5b9c

Browse files
netomimbarbero
authored andcommitted
also confine the check_sync task
1 parent ab9e29f commit 7bb5b9c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

otterdog/webapp/tasks/check_sync.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from quart import current_app, render_template
1717

1818
from otterdog.operations.plan import PlanOperation
19-
from otterdog.utils import IndentingPrinter, LogLevel
19+
from otterdog.utils import IndentingPrinter, LogLevel, restrict_jsonnet_imports
2020
from otterdog.webapp.db.models import TaskModel
2121
from otterdog.webapp.db.service import (
2222
get_latest_sync_task_for_organization,
@@ -173,7 +173,10 @@ def sync_callback(
173173
operation.set_callback(sync_callback)
174174
operation.init(otterdog_config, printer)
175175

176-
await operation.execute(org_config)
176+
# confine jsonnet imports to the org config directory so that
177+
# configurations cannot reach files outside the expected vendor layout.
178+
with restrict_jsonnet_imports(org_config.jsonnet_config.org_dir):
179+
await operation.execute(org_config)
177180

178181
self.merge_statistics_from_provider(operation.gh_client)
179182

0 commit comments

Comments
 (0)