Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-04-29 11:19:19 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-04-29 11:19:50 +0300
commit56f708e661bf2269453582e2aceb35cd25321776 (patch)
treec06478b7d9fcb209e799d7a4d5d4fb2a3e0997b0 /doc
parent02a7d94cef3ff69081d79df0215bb9b79ac0f94d (diff)
Add latest changes from gitlab-org/security/gitlab@14-9-stable-ee
Diffstat (limited to 'doc')
-rw-r--r--doc/ci/caching/index.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/ci/caching/index.md b/doc/ci/caching/index.md
index c634491662d..25271864895 100644
--- a/doc/ci/caching/index.md
+++ b/doc/ci/caching/index.md
@@ -31,6 +31,7 @@ can't link to files outside it.
- Subsequent pipelines can use the cache.
- Subsequent jobs in the same pipeline can use the cache, if the dependencies are identical.
- Different projects cannot share the cache.
+- Protected and non-protected branches do not share the cache.
### Artifacts
@@ -446,6 +447,22 @@ is stored on the machine where GitLab Runner is installed. The location also dep
If you use cache and artifacts to store the same path in your jobs, the cache might
be overwritten because caches are restored before artifacts.
+### Segregation of caches between protected and non-protected branches
+
+> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/330047) in GitLab 14.10.
+
+A suffix is added to the cache key, with the exception of the [fallback cache key](#use-a-fallback-cache-key).
+This is done in order to prevent cache poisoning that might occur through manipulation of the cache in a non-protected
+branch. Any subsequent protected-branch jobs would then potentially use a poisoned cache from the preceding job.
+
+As an example, assuming that `cache.key` is set to `$CI_COMMIT_REF_SLUG`, and that we have two branches `main`
+and `feature`, then the following table represents the resulting cache keys:
+
+| Branch name | Cache key |
+|-------------|-----------|
+| `main` | `main-protected` |
+| `feature` | `feature-non_protected` |
+
### How archiving and extracting works
This example shows two jobs in two consecutive stages: