Fix handling of enroll secret env vars in Orbit (#3458)

This commit is contained in:
Zach Wasserman 2021-12-22 15:57:09 -08:00 committed by GitHub
parent d3b2bd362d
commit d377923750
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -0,0 +1 @@
* Fix handling of enroll secrets to address 0.0.3 enrollment issue.

View File

@ -219,7 +219,7 @@ func main() {
if enrollSecret != "" {
const enrollSecretEnvName = "ENROLL_SECRET"
options = append(options,
osquery.WithEnv([]string{enrollSecretEnvName, enrollSecret}),
osquery.WithEnv([]string{enrollSecretEnvName + "=" + enrollSecret}),
osquery.WithFlags([]string{"--enroll_secret_env", enrollSecretEnvName}),
)
}

View File

@ -38,7 +38,7 @@ func CheckFileHash(meta *data.TargetFileMeta, localPath string) error {
}
// selectHashFunction returns the first matching hash function and expected
// hash, otherwise returning an error if not matching hash can be found.
// hash, otherwise returning an error if no matching hash can be found.
//
// SHA512 is preferred, and SHA256 is returned if 512 is not available.