Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Restrict loading to root or below. #700
Kustomization files refer to two kinds of files outside the kustomization file itself:
where root is the directory containing the kustomization file specifying these things.
This PR imposes an additional requirement on data paths.
They must still be root relative paths, but additionally they cannot go up out of root, either explicitly, or by following symbolic links. They can only refer to files in or below root.
This will require an increment in semver major, since it disallows certain file loading patterns.
No existing examples or documentation need to change, since this file arrangement wasn't used.
Example of disallowed behavior and how to fix:
Supposed a single data file
The fix is to simply add a kustomization file to the directory containing the data, and refer to that as a base from the kustomizations in the two overlays (i.e. refer to the base, not the data). It remains OK to go up and over when referring to a base (though not directly up, since that can result in cycles).
A followup PR should include an example discussing/defining this.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: monopole
The full list of commands accepted by this bot can be found here.
The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing
DirectXMan12 left a comment
fileLoader godoc needs to be updated with the new info.
This technically also disallows symlinks between "root trees" where the load might otherwise be acceptable (AFAICT), but that may be an acceptable caveat.