Skip to content

Commit 7995d5f

Browse files
authored
Merge pull request #2402 from ricardoapl/add-dependencies-policy
docs: add policy for consuming and upgrading dependencies
2 parents f28abc9 + 9917008 commit 7995d5f

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

SECURITY-INSIGHTS.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ dependencies:
3232
dependencies-lists:
3333
- https://github.com/kubernetes/kube-state-metrics/blob/main/go.mod
3434
- https://github.com/kubernetes/kube-state-metrics/blob/main/Dockerfile
35+
env-dependencies-policy:
36+
policy-url: https://github.com/kubernetes/kube-state-metrics/blob/main/docs/dependencies-policy.md
3537
documentation:
3638
- https://github.com/kubernetes/kube-state-metrics/tree/main/docs
3739
security-testing:

docs/dependencies-policy.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Dependencies Policy
2+
3+
## Purpose
4+
5+
This policy describes how kube-state-metrics maintainers consume third-party packages.
6+
7+
## Scope
8+
9+
This policy applies to all kube-state-metrics maintainers and all third-party packages used in the kube-state-metrics project.
10+
11+
## Policy
12+
13+
kube-state-metrics maintainers must follow these guidelines when consuming third-party packages:
14+
15+
* Only use third-party packages that are necessary for the functionality of kube-state-metrics.
16+
* Use the latest version of all third-party packages whenever possible.
17+
* Avoid using third-party packages that are known to have security vulnerabilities.
18+
* Pin all third-party packages to specific versions in the kube-state-metrics codebase.
19+
* Use a dependency management tool, such as Go modules, to manage third-party dependencies.
20+
21+
## Procedure
22+
23+
When adding a new third-party package to kube-state-metrics, maintainers must follow these steps:
24+
25+
1. Evaluate the need for the package. Is it necessary for the functionality of kube-state-metrics?
26+
2. Research the package. Is it actively maintained? Does it have a good reputation?
27+
3. Choose a version of the package. Use the latest version whenever possible.
28+
4. Pin the package to the specific version in the kube-state-metrics codebase.
29+
5. Update the kube-state-metrics documentation to reflect the new dependency.
30+
31+
## Enforcement
32+
33+
This policy is enforced by the kube-state-metrics maintainers.
34+
35+
Maintainers are expected to review each other's code changes to ensure that they comply with this policy.
36+
37+
## Exceptions
38+
39+
Exceptions to this policy may be granted by the kube-state-metrics project owners on a case-by-case basis.
40+
41+
## Credits
42+
43+
This policy was adapted from Kubescape's [Environment Dependencies Policy](https://github.com/kubescape/kubescape/blob/master/docs/environment-dependencies-policy.md).

0 commit comments

Comments
 (0)