Add the exit status code to the analysis output for commands executed by scripts.

Đang mở
#249 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 6 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
38/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
go
Lĩnh vực
tooling

Hướng nghiên cứu

Bắt đầu bằng việc xác định đoạn mã phân tích đầu ra của GVisor strace và tạo đầu ra phân tích cho các lệnh được script thực thi; issue xác định các bản ghi execve, exit và exit_group cùng với dấu ngoặc PID/TID là các đầu vào liên quan. Xác nhận rằng trạng thái thoát được ghép cặp với binary đã thực thi, bao gồm các ví dụ 0x0 và 0x7f được hiển thị, rồi kiểm tra đầu ra phân tích thu được.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

dynamic analysis enhancement go

This ability can help find places where the sandbox can be improved, or be used to identify when a command being executed succeeded for failed.

The strace output generated by GVisor includes can be parsed to pair execve syscalls with exit or exit_group syscalls to extract the exit status of the executed binary.

For example, below shows a sample of strace output from GVisor of syscall exits. Note the PID == 3, with TID 4 and 7 exiting explicitly using (exit), with the entire group being exited as well (exit_group)

I0303 03:30:37.681359     206 strace.go:629] [   3:   3] analyze.js X execve(0x7f782e606b40 /usr/local/bin/node ...
...
I0303 03:32:19.471116     206 strace.go:623] [   3:   4] node X exit(0x0) = 0 (0x0) (1.336µs)
I0303 03:32:19.471135     206 strace.go:623] [   3:   7] node X exit(0x0) = 0 (0x0) (1.413µs)
...
I0303 03:32:19.476033     206 strace.go:623] [   3:   3] node X exit_group(0x0) = 0 (0x0) (15.45µs)

The exit code is included as the strace arg to the syscall. For example, below the exit code is 0x7f or 127:

I0303 03:32:04.019615     206 strace.go:623] [  83:  83] ld-linux-x86-64 X exit_group(0x7f) = 0 (0x0) (1.823µs)

It is worth remembering in Linux that a process will first clone or fork itself and then call execve to hand execution over to the new binary. This means the PID and TID can be parsed from the square brackets before the name (e.g. [ 3: 7] corresponds to a PID of 3 and a TID of 7).

Ngôn ngữ chính
Go
Star
925
Fork
75
Merge trung bình
4 ngày 2 giờ
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ossf/package-analysis

Tất cả issue của ossf/package-analysis

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.