Skip to content

Commit

Permalink
chore: Fix linux tracing in commandrun.
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Glastra <matglas.git@gmail.com>
  • Loading branch information
matglas committed Oct 2, 2024
1 parent 92968d0 commit f8bdde2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions attestation/commandrun/tracing_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type ptraceContext struct {
processes map[int]*ProcessInfo
exitCode int
hash []cryptoutil.DigestValue
environmentBlockList map[string]struct{}
sensitiveEnvList map[string]struct{}
}

func enableTracing(c *exec.Cmd) {
Expand All @@ -57,7 +57,7 @@ func (r *CommandRun) trace(c *exec.Cmd, actx *attestation.AttestationContext) ([
mainProgram: c.Path,
processes: make(map[int]*ProcessInfo),
hash: actx.Hashes(),
environmentBlockList: r.environmentBlockList,
sensitiveEnvList: r.sensitiveEnvList,
}

if err := pctx.runTrace(); err != nil {
Expand Down Expand Up @@ -201,7 +201,7 @@ func (p *ptraceContext) handleSyscall(pid int, regs unix.PtraceRegs) error {
if err == nil {
allVars := strings.Split(string(environ), "\x00")
filteredEnviron := make([]string, 0)
environment.FilterEnvironmentArray(allVars, p.environmentBlockList, func(_, _, varStr string) {
environment.FilterEnvironmentArray(allVars, p.sensitiveVarsList, map[string]struct{}{}, func(_, _, varStr string) {

Check failure on line 204 in attestation/commandrun/tracing_linux.go

View workflow job for this annotation

GitHub Actions / Verify Schema

p.sensitiveVarsList undefined (type *ptraceContext has no field or method sensitiveVarsList)

Check failure on line 204 in attestation/commandrun/tracing_linux.go

View workflow job for this annotation

GitHub Actions / lint

p.sensitiveVarsList undefined (type *ptraceContext has no field or method sensitiveVarsList)) (typecheck)

Check failure on line 204 in attestation/commandrun/tracing_linux.go

View workflow job for this annotation

GitHub Actions / lint

p.sensitiveVarsList undefined (type *ptraceContext has no field or method sensitiveVarsList)) (typecheck)

Check failure on line 204 in attestation/commandrun/tracing_linux.go

View workflow job for this annotation

GitHub Actions / lint

p.sensitiveVarsList undefined (type *ptraceContext has no field or method sensitiveVarsList) (typecheck)

Check failure on line 204 in attestation/commandrun/tracing_linux.go

View workflow job for this annotation

GitHub Actions / lint

p.sensitiveVarsList undefined (type *ptraceContext has no field or method sensitiveVarsList)) (typecheck)

Check failure on line 204 in attestation/commandrun/tracing_linux.go

View workflow job for this annotation

GitHub Actions / lint

p.sensitiveVarsList undefined (type *ptraceContext has no field or method sensitiveVarsList) (typecheck)

Check failure on line 204 in attestation/commandrun/tracing_linux.go

View workflow job for this annotation

GitHub Actions / lint

p.sensitiveVarsList undefined (type *ptraceContext has no field or method sensitiveVarsList) (typecheck)

Check failure on line 204 in attestation/commandrun/tracing_linux.go

View workflow job for this annotation

GitHub Actions / unit-test / witness

p.sensitiveVarsList undefined (type *ptraceContext has no field or method sensitiveVarsList)

Check failure on line 204 in attestation/commandrun/tracing_linux.go

View workflow job for this annotation

GitHub Actions / sast / witness

p.sensitiveVarsList undefined (type *ptraceContext has no field or method sensitiveVarsList)
filteredEnviron = append(filteredEnviron, varStr)
})

Expand Down

0 comments on commit f8bdde2

Please sign in to comment.