-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from anusha94/update-dockerfile-chart
Update dockerfile chart
- Loading branch information
Showing
23 changed files
with
105 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
charts/best-practices-dockerfile/pols/check-apt-command-force-yes.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
apiVersion: json.kyverno.io/v1alpha1 | ||
kind: ValidatingPolicy | ||
metadata: | ||
name: check-apt-command-force-yes | ||
annotations: | ||
policies.kyverno.io/title: Check for overidding of safety checks in apt-get command | ||
policies.kyverno.io/category: Dockerfile Best Practices | ||
policies.kyverno.io/severity: medium | ||
policies.nirmata.io/remediation-docs: "https://docs.nirmata.io/policysets/dockerfile_best_practices/check-apt-command-force-yes/" | ||
policies.kyverno.io/description: >- | ||
The --force-yes option in apt-get is used to override some safety checks | ||
and prompts, allowing the installation or upgrade of packages even if | ||
they require additional user confirmation or if they conflict with other | ||
packages. This can potentially lead to system instability or unexpected | ||
behavior, as it bypasses certain safeguards put in place to ensure the stability | ||
and consistency of the system. | ||
spec: | ||
rules: | ||
- name: check-apt-command-force-yes | ||
match: | ||
all: | ||
- ($analyzer.resource.type): dockerfile | ||
- (Stages[].Commands[?Name=='RUN'].CmdLine[][] | length(@) > `0`): true | ||
assert: | ||
all: | ||
- message: refrain from using the '--force-yes' option with `apt-get` as it bypasses important package validation checks and can potentially compromise the stability and security of your system. | ||
check: | ||
~.(Stages[].Commands[?Name=='RUN'].CmdLine[][]): | ||
((starts_with(@, 'apt-get ') || contains(@, ' apt-get ')) && contains(@, ' --force-yes')): false | ||
- message: refrain from using the '--force-yes' option with `apt` as it bypasses important package validation checks and can potentially compromise the stability and security of your system. | ||
check: | ||
~.(Stages[].Commands[?Name=='RUN'].CmdLine[][]): | ||
((starts_with(@, 'apt ') || contains(@, ' apt ')) && contains(@, ' --force-yes')): false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
charts/best-practices-dockerfile/pols/check-certificate-validation-git-env-var.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: json.kyverno.io/v1alpha1 | ||
kind: ValidatingPolicy | ||
metadata: | ||
name: check-certificate-validation-git-env-var | ||
annotations: | ||
policies.kyverno.io/title: Check for certificate validation in the Dockerfile using Node.js environment variable | ||
policies.kyverno.io/category: Dockerfile Best Practices | ||
policies.kyverno.io/severity: medium | ||
policies.nirmata.io/remediation-docs: "https://docs.nirmata.io/policysets/dockerfile_best_practices/check-certificate-validation-git-env-var/" | ||
policies.kyverno.io/description: >- | ||
To control SSL certificate validation in Git operations within a Docker container, | ||
you can use the GIT_SSL_NO_VERIFY environment variable. Setting this variable to true | ||
or 1 tells Git to bypass SSL certificate validation. | ||
spec: | ||
rules: | ||
- name: check-certificate-validation-git-env-var | ||
match: | ||
all: | ||
- ($analyzer.resource.type): dockerfile | ||
- (Stages[].Commands[?Name=='ENV'] | length(@) > `0`): true | ||
assert: | ||
any: | ||
- message: Ensure certificate validation is enabled by using `GIT_SSL_NO_VERIFY` env with value set to '0' or 'false' | ||
check: | ||
(Stages[].Commands[].Env[?Key=='GIT_SSL_NO_VERIFY' && (Value=='1' || Value=='true')][] | length(@) > `0`): false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
charts/best-practices-dockerfile/pols/check-label-maintainer.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
apiVersion: json.kyverno.io/v1alpha1 | ||
kind: ValidatingPolicy | ||
metadata: | ||
name: check-label-maintainer | ||
annotations: | ||
policies.kyverno.io/title: Validating LABEL maintainer instruction in Dockerfile | ||
policies.kyverno.io/category: Dockerfile Best Practices | ||
policies.kyverno.io/severity: medium | ||
policies.nirmata.io/remediation-docs: "https://docs.nirmata.io/policysets/dockerfile_best_practices/check-label-maintainer/" | ||
policies.kyverno.io/description: >- | ||
MAINTAINER instruction is deprecated for the Dockerfile. Instead, you can use the | ||
LABEL instruction to provide the maintainer name in the Dockerfile. This policy checks | ||
if LABEL instruction has been specified with maintainer name. | ||
spec: | ||
rules: | ||
- assert: | ||
all: | ||
- check: | ||
(Stages[].Commands[?Name=='MAINTAINER'][] | length(@) > `0`): false | ||
message: MAINTAINER instruction is deprecated, use LABELS instruction to mention maintainer name | ||
- check: | ||
(Stages[].Commands[].Labels[?Key=='maintainer' || Key=='owner' || Key=='author'][] | length(@) > `0`): true | ||
message: Use the LABELS instruction to set the MAINTAINER name | ||
name: dockerfile-allow-label-maintainer-instruction | ||
match: | ||
all: | ||
- ($analyzer.resource.type): dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters