30 Commits
Author SHA1 Message Date
Caroline ZhuandgVisor bot 99ceedfd7f Add Python SandboxExec example.
PiperOrigin-RevId: 967520968
2026-08-19 18:52:41 -07:00
Xin ZhongandgVisor bot 2ac0774eeb Revise examples/seccheck/README.md
PiperOrigin-RevId: 954857552
2026-07-27 15:23:04 -07:00
Xin ZhongandgVisor bot f5d3ac2cf3 seccheck: updates examples/seccheck/server.cc to comply with the Style Guide
- Wraps all non-main helper functions, structs, and variables in an anonymous
namespace to avoid One Definition Rule (ODR) violations.
- Capitalizes function names to follow CamelCase conventions (e.g., Unpack,
ReadAndUnpack, PollLoop, Handshake).
- Renames struct and macro variables (e.g., struct header -> struct Header,
maxEventSize -> kMaxEventSize).
- Modernizes ParseFromArray calls by replacing them with ParseFromString.
- Adds missing standard library includes (<cerrno>, <cstdint>, <array>,
<functional>).
- Renames the non-templated Unpack front-door function to DispatchMessage to
clarify its routing purpose and avoid naming collisions.
- Resolves a strict aliasing violation in PollLoop by explicitly casting the
file descriptor through intptr_t.

PiperOrigin-RevId: 953469340
2026-07-24 11:28:05 -07:00
Xin ZhongandgVisor bot edbfb28dee seccheck: fix dispatcher array order
The order in dispatchers array does not match the enum in common.proto. This
caused the server to silently process syscall endpoints like Dup, Prlimit,
Pipe, Fcntl, Signalfd, Chroot, and Eventfd using the wrong protobuf types.

This change realigns the dispatcher indices correctly with the protobuf
MessageType enum.

PiperOrigin-RevId: 953118943
2026-07-23 21:14:59 -07:00
Xin ZhongandgVisor bot c35a9ff00a seccheck: support ptrace request extraction via syscall points
PiperOrigin-RevId: 953109282
2026-07-23 20:43:59 -07:00
Xin ZhongandgVisor bot ed5e3a44cd seccheck: Add trace point for the listen(2) syscall.
This change implements the PointListen trace point to capture details of the
listen syscall, including the file descriptor, backlog, socket family,
socket type, and bound address. It also updates the seccheck metadata for
amd64 and arm64, adds the Listen protobuf message, and includes test coverage.

PiperOrigin-RevId: 952916092
2026-07-23 13:13:25 -07:00
Xin ZhongandgVisor bot 164b417225 Add seccheck point for mmap(2).
This change introduces a seccheck point for the mmap syscall on both amd64 and
arm64. A new proto message `Mmap` is defined to capture the syscall arguments,
including the file descriptor path when requested. The example seccheck server
is updated to handle the new message type, and a basic test case is added to
the trace tests.

PiperOrigin-RevId: 947914706
2026-07-14 14:45:56 -07:00
Xin ZhongandgVisor bot 95e33b9705 Add seccheck point for mmap.
This change introduces a new seccheck point, "sentry/mmap", which is triggered
when a memory mapping is created. The seccheck event includes information about
the mapped file, such as its path, inode, mode, UID, and GID, as well as a
timestamp. It also indicates if the mapping corresponds to the initial
executable. This allows for monitoring of potential code injection or execution
from unexpected sources.

PiperOrigin-RevId: 944614086
2026-07-08 11:45:33 -07:00
gVisor bot 9e8afa6c9f Internal change.
PiperOrigin-RevId: 899832459
2026-04-14 16:41:47 -07:00
gVisor bot d16c336c51 Internal change.
PiperOrigin-RevId: 854115401
2026-01-09 03:18:30 -08:00
gVisor bot 69ea527a5f Internal change.
PiperOrigin-RevId: 709861006
2024-12-26 12:45:32 -08:00
gVisor bot ee6b326754 Internal change.
PiperOrigin-RevId: 663801589
2024-08-16 11:44:31 -07:00
gVisor bot e5cdc4f605 Internal change.
PiperOrigin-RevId: 595450791
2024-01-03 11:10:14 -08:00
gVisor bot 88ee367532 Redacting sensitive fields in debug logs.
PiperOrigin-RevId: 537407555
2023-06-02 14:20:21 -07:00
Andrei Vagin 3445db339d Fix all c++ compile time warnings 2023-03-09 19:01:00 -08:00
Adin ScannellandgVisor bot 2911d8c3b8 Add default_applicable_licenses rules to packages.
PiperOrigin-RevId: 513581243
2023-03-02 10:50:04 -08:00
Fabricio VoznikaandgVisor bot 22de242ebf Add read/write syscalls to trace points
Closes #8092

PiperOrigin-RevId: 488719448
2022-11-15 11:54:23 -08:00
Fabricio VoznikaandgVisor bot 8fa0abbc3c Add documentation and tutorials for Runtime Monitoring
Updates #4805

PiperOrigin-RevId: 467993824
2022-08-16 12:29:59 -07:00
Shambhavi SrivastavaandgVisor bot b160b2ad2a Add Points to some syscalls
Added a raw syscall points to all syscalls. Added schematized syscall
points to the following syscalls:

  - timerfd_create
  - timerfd_settime
  - timerfd_gettime
  - fork, vfork
  - inotify_init, inotify_init1
  - inotify_add_watch
  - inotify_rm_watch
  - socketpair

Updates #4805

PiperOrigin-RevId: 459596784
2022-07-07 14:10:36 -07:00
Shambhavi SrivastavaandgVisor bot 6a894725e6 Add Points to some syscalls
Added a raw syscall points to all syscalls. Added schematized syscall
points to the following syscalls:

  - chroot
  - dup, dup2, dup3
  - prlimit64
  - eventfd, eventfd2
  - signalfd, signalfd4
  - bind
  - accept, accept4
  - fcntl
  - pipe, pipe2

Updates #4805

PiperOrigin-RevId: 457139504
2022-06-24 19:37:41 -07:00
Fabricio VoznikaandgVisor bot 10042f7421 Add async write to remote checker
When writing a trace point fails, the remote checker can retry with
configurable exponential backoff. After the number of retries is
exceeded, the point is dropped. The number of dropped events are
reported in the message header and also in `runsc trace list`
command.

Updates #4805

PiperOrigin-RevId: 456662539
2022-06-22 19:23:48 -07:00
Fabricio VoznikaandgVisor bot 63607d0f4f Drain all messages before closing socket
Updates #4805

PiperOrigin-RevId: 452812458
2022-06-03 11:56:09 -07:00
Shambhavi SrivastavaandgVisor bot 2adbcf780f Add Points to some syscalls
Added a raw syscall points to all syscalls. Added schematized syscall
points to the following syscalls:

- Chdir
- Fchdir
- Setgid
- Setuid
- Setsid
- Setresuid
- Setresgid

PiperOrigin-RevId: 451001973
2022-05-25 13:34:03 -07:00
Fabricio VoznikaandgVisor bot 389c768c03 Add version handshake before communication is stablished
Details on how it works is in wire.Handshake.

Updates #4805

PiperOrigin-RevId: 448552448
2022-05-13 12:33:43 -07:00
Fabricio VoznikaandgVisor bot 0a75fa3cc6 Faster proto serialization
The use of protobuf.Any is convenient, but adds to proto serialization
time and number of memory allocations required to send a message.
Instead, we now use an enum to indentify the message and use it to
determine how to unmarshall the message on the receiveing end. It
also speeds up event consuption by not requiring a map from string
(proto names) to callbacks.

BenchmarkProtoAny-6   115.9 ns/op        210 B/op       4 allocs/op
BenchmarkProtoEnum-6   58.3 ns/op          2 B/op       1 allocs/op

Updates #4805

PiperOrigin-RevId: 446879057
2022-05-05 19:29:49 -07:00
Fabricio VoznikaandgVisor bot 974fc32a4d Add Points to some syscalls
Added a raw syscall points to all syscalls. Added schematized syscall
points to the following syscalls:

  - read
  - close
  - socket
  - connect
  - execve
  - creat
  - openat
  - execveat

Updates #4805

PiperOrigin-RevId: 446008358
2022-05-02 13:03:04 -07:00
Fabricio VoznikaandgVisor bot 78c6e57f48 Add sentry/task_exit point
Updates #4805

PiperOrigin-RevId: 445222912
2022-04-28 12:45:48 -07:00
Fabricio VoznikaandgVisor bot a24055105a Add container/start Point
Updates #4805

PiperOrigin-RevId: 444983390
2022-04-27 15:30:31 -07:00
Fabricio VoznikaandgVisor bot e46a13c4c5 Plumb seccheck configuration in runsc
Added new flag `--pod-init-config` that allows custom configuration
steps to be specified when a pod is being created. For now, the only
step supported is to configure a seccheck session, but more can be
added in the future, e.g. startup hook.

In seccheck, metadata was added for all Points and sinks (aka Checkers)
so that an external configuration files can reference them. In addition,
infrastructure to read and configure sessions from a file has been
added. Only a single session ("Default") is supported for now.

Updates #4805

PiperOrigin-RevId: 444705708
2022-04-26 17:08:08 -07:00
Fabricio VoznikaandgVisor bot 9bbaf52841 Remote checker
Add a generic checker that serializes Points protos to a remote process.

More details here: https://docs.google.com/document/d/1RQQKzeFpO-zOoBHZLA-tr5Ed_bvAOLDqgGgKhqUff2A/

Updates #4805

PiperOrigin-RevId: 443690622
2022-04-22 09:54:21 -07:00