Skip to content

Commit 5d8a119

Browse files
zakiskpipelines-as-code[bot]
authored andcommitted
update: Set remeber-ok-to-test settings to false by default
`remeber-ok-to-test` setting is set to false by default to mitigate security risks of enabling an attacker to gain trust of repo owner and push malicious code. fixes: #1798 https://issues.redhat.com/browse/SRVKP-7238 Signed-off-by: Zaki Shaikh <[email protected]>
1 parent 8ce32f3 commit 5d8a119

File tree

5 files changed

+14
-8
lines changed

5 files changed

+14
-8
lines changed

config/302-pac-configmap.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ data:
129129
# pull request if ok-to-test is done once
130130
#
131131
# you may want to disable this if ok-to-test should be done on each iteration
132-
remember-ok-to-test: "true"
132+
remember-ok-to-test: "false"
133133

134134
# Configure a custom console here, the driver support custom parameters from
135135
# Repo CR along a few other template variable, see documentation for more

docs/content/docs/install/settings.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,13 @@ There is a few things you can configure through the config map
130130
case of push event on pull request either through new commit or amend, then CI will
131131
re-run automatically
132132

133-
You can disable by setting false if you want to provide `ok-to-test` on every iteration
133+
By default, the `remember-ok-to-test` setting is set to false in Pipelines-as-Code to mitigate serious security risks.
134+
An attacker could submit a seemingly harmless PR to gain the repository owner's trust, and later
135+
inject malicious code designed to compromise the build system, such as exfiltrating secrets.
136+
137+
Enabling this feature increases the risk of unauthorized access and is therefore strongly discouraged
138+
unless absolutely necessary. If you choose to enable it you can set it to true, you do so at your own
139+
risk and should be aware of the potential security vulnerabilities.
134140
(only GitHub and Gitea is supported at the moment).
135141

136142
### Tekton Hub support

pkg/params/settings/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ type Settings struct {
6969
CustomConsolePRTaskLog string `json:"custom-console-url-pr-tasklog"`
7070
CustomConsoleNamespaceURL string `json:"custom-console-url-namespace"`
7171

72-
RememberOKToTest bool `default:"true" json:"remember-ok-to-test"`
72+
RememberOKToTest bool `json:"remember-ok-to-test"`
7373
}
7474

7575
func (s *Settings) DeepCopy(out *Settings) {

pkg/params/settings/config_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func TestSyncConfig(t *testing.T) {
4343
CustomConsolePRdetail: "",
4444
CustomConsolePRTaskLog: "",
4545
CustomConsoleNamespaceURL: "",
46-
RememberOKToTest: true,
46+
RememberOKToTest: false,
4747
},
4848
},
4949
{

pkg/params/settings/convert_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func TestConvert(t *testing.T) {
3636
"hub-catalog-name": "tekton",
3737
"hub-url": "https://api.hub.tekton.dev/v1",
3838
"max-keep-run-upper-limit": "0",
39-
"remember-ok-to-test": "true",
39+
"remember-ok-to-test": "false",
4040
"remote-tasks": "true",
4141
"secret-auto-create": "true",
4242
"secret-github-app-scope-extra-repos": "",
@@ -74,7 +74,7 @@ func TestConvert(t *testing.T) {
7474
"hub-catalog-name": "tekton",
7575
"hub-url": "https://api.hub.tekton.dev/v1",
7676
"max-keep-run-upper-limit": "0",
77-
"remember-ok-to-test": "true",
77+
"remember-ok-to-test": "false",
7878
"remote-tasks": "true",
7979
"secret-auto-create": "true",
8080
"secret-github-app-scope-extra-repos": "",
@@ -113,7 +113,7 @@ func TestConvert(t *testing.T) {
113113
"hub-catalog-name": "test tekton",
114114
"hub-url": "https://api.hub.tekton.dev/v2",
115115
"max-keep-run-upper-limit": "0",
116-
"remember-ok-to-test": "true",
116+
"remember-ok-to-test": "false",
117117
"remote-tasks": "true",
118118
"secret-auto-create": "true",
119119
"secret-github-app-scope-extra-repos": "",
@@ -164,7 +164,7 @@ func TestConvert(t *testing.T) {
164164
"hub-catalog-name": "test tekton",
165165
"hub-url": "https://api.hub.tekton.dev/v2",
166166
"max-keep-run-upper-limit": "0",
167-
"remember-ok-to-test": "true",
167+
"remember-ok-to-test": "false",
168168
"remote-tasks": "true",
169169
"secret-auto-create": "true",
170170
"secret-github-app-scope-extra-repos": "",

0 commit comments

Comments
 (0)