dbt-labs / dbt-core

dbt enables data analysts and engineers to transform their data using the same practices that software engineers use to build applications.
https://getdbt.com
Apache License 2.0
9.61k stars 1.59k forks source link

[CT-2937] [Feature] Optional config / flag to disallow paths outside current working directory #8318

Closed jtcohen6 closed 11 months ago

jtcohen6 commented 1 year ago

Is this your first time submitting a feature request?

Describe the feature

Prevent dbt-core from deleting/overwriting files outside the relative project directory. For example:

clean-targets: ["../.."]

This is most relevant for clean-targets (where dbt deletes files), but I think we would also want to prevent it for target-paths (where dbt overwrites files).

We could either:

Describe alternatives you've considered

Not making this configurable behavior, but simply disallowing it for everyone always. I can't think of a legitimate use case for doing this, but you never know

Who will this benefit?

Are you interested in contributing this feature?

No response

Anything else?

Jira ticket for context: https://dbtlabs.atlassian.net/browse/CLI-118

graciegoheen commented 1 year ago

From estimation meeting: mostly a concern for writing and deleting

graciegoheen commented 1 year ago

From estimation meeting: probably best to throw an error instead of failing silently