Skip to content

Commit

Permalink
WIP Linux tracing fix
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Glastra <[email protected]>
  • Loading branch information
matglas committed Oct 14, 2024
1 parent 1c720f2 commit d033075
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions attestation/commandrun/tracing_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,18 @@ func (p *ptraceContext) handleSyscall(pid int, regs unix.PtraceRegs) error {
environ, err := os.ReadFile(envinLocation)
if err == nil {
allVars := strings.Split(string(environ), "\x00")
filteredEnviron := p.environmentCapturer.Capture(allVars)

procInfo.Environ = strings.Join(filteredEnviron, " ")
env := make([]string, 0)
environment.FilterEnvironmentArray(allVars, p.environmentBlockList, func(_, _, varStr string) {

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

View workflow job for this annotation

GitHub Actions / lint

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

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

View workflow job for this annotation

GitHub Actions / lint

not enough arguments in call to environment.FilterEnvironmentArray

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

View workflow job for this annotation

GitHub Actions / lint

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

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

View workflow job for this annotation

GitHub Actions / lint

not enough arguments in call to environment.FilterEnvironmentArray

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

View workflow job for this annotation

GitHub Actions / lint

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

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

View workflow job for this annotation

GitHub Actions / lint

not enough arguments in call to environment.FilterEnvironmentArray

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

View workflow job for this annotation

GitHub Actions / Verify Schema

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

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

View workflow job for this annotation

GitHub Actions / Verify Schema

not enough arguments in call to environment.FilterEnvironmentArray

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

View workflow job for this annotation

GitHub Actions / unit-test / witness

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

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

View workflow job for this annotation

GitHub Actions / unit-test / witness

not enough arguments in call to environment.FilterEnvironmentArray

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

View workflow job for this annotation

GitHub Actions / sast / witness

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

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

View workflow job for this annotation

GitHub Actions / sast / witness

not enough arguments in call to environment.FilterEnvironmentArray
filteredEnviron = append(filteredEnviron, varStr)

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

View workflow job for this annotation

GitHub Actions / lint

undefined: filteredEnviron) (typecheck)

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

View workflow job for this annotation

GitHub Actions / lint

undefined: filteredEnviron) (typecheck)

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

View workflow job for this annotation

GitHub Actions / Verify Schema

undefined: filteredEnviron

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

View workflow job for this annotation

GitHub Actions / unit-test / witness

undefined: filteredEnviron

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

View workflow job for this annotation

GitHub Actions / sast / witness

undefined: filteredEnviron
})

var capturedEnv map[string]string = p.environmentCapturer.Capture(allVars)
for k, v := range capturedEnv {
env = append(env, fmt.Sprintf("%s=%s", k, v))
}

procInfo.Environ = strings.Join(env, " ")
}

cmdline, err := os.ReadFile(cmdlineLocation)
Expand Down

0 comments on commit d033075

Please sign in to comment.