BUGFIX: Hide secrets from output

Security vulnerability
This commit is contained in:
Jeroen De Meerleer 2021-11-30 13:54:17 +01:00
parent ad7dad9e54
commit 86f0e9bd50
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
2 changed files with 8 additions and 1 deletions

2
package-lock.json generated
View File

@ -1921,7 +1921,7 @@
"node_modules/@types/minimatch": {
"version": "3.0.5",
"resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.5.tgz",
"integrity": "sha512-fKlz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==",
"integrity": "sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==",
"dev": true
},
"node_modules/@types/node": {

View File

@ -406,6 +406,13 @@ class Job extends Repository
if ($manual === true) {
$flags[] = Run::MANUAL;
}
// Remove secrets from output
foreach($job['data']['vars'] as $key => $var) {
if ($var['issecret']) {
$result['output'] = str_replace($var['value'], '{'.$key.'}', $result['output']);
}
}
// saving to database
$runRepo = new Run($this->dbcon);
$runRepo->addRun($job['id'], $result['exitcode'], floor($starttime), $runtime, $result['output'], $flags);