{"id":13581339,"url":"https://github.com/orivej/fptrace","last_synced_at":"2026-03-12T13:44:04.830Z","repository":{"id":53263703,"uuid":"87885295","full_name":"orivej/fptrace","owner":"orivej","description":"Record process launches and files read and written by each process","archived":false,"fork":false,"pushed_at":"2024-12-06T16:56:35.000Z","size":70,"stargazers_count":60,"open_issues_count":3,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-06T07:34:43.618Z","etag":null,"topics":["dependency-graph","ptrace","seccomp","strace"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orivej.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-11T03:42:13.000Z","updated_at":"2025-02-22T14:32:00.000Z","dependencies_parsed_at":"2024-06-19T00:08:11.525Z","dependency_job_id":"fd2f0ef7-572f-42f3-aea0-e213b8349425","html_url":"https://github.com/orivej/fptrace","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/orivej/fptrace","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orivej%2Ffptrace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orivej%2Ffptrace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orivej%2Ffptrace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orivej%2Ffptrace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orivej","download_url":"https://codeload.github.com/orivej/fptrace/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orivej%2Ffptrace/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30427346,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T12:46:33.731Z","status":"ssl_error","status_checked_at":"2026-03-12T12:42:20.405Z","response_time":114,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dependency-graph","ptrace","seccomp","strace"],"created_at":"2024-08-01T15:02:00.515Z","updated_at":"2026-03-12T13:44:04.804Z","avatar_url":"https://github.com/orivej.png","language":"Go","funding_links":[],"categories":["Go","others"],"sub_categories":[],"readme":"# Introduction\n\n`fptrace` is a Linux process tracing tool that records process launches and file accesses.  Results can be saved in a `deps.json` file or used to generate launcher scripts.  It works like `strace` but produces machine readable output and resolves relative pathnames into absolute ones.  Optionally it also records environment variables and prevents deletions.  It incurs much less overhead than `strace` thanks to seccomp filtering.\n\n# `deps.json`\n\n`fptrace -d deps.json sh -c 'echo a \u003e a; cat a | tee b; exec test -d a'` in `/tmp` makes:\n\n```json\n[\n  {\n    \"Cmd\": {\n      \"Parent\": 1, \"ID\": 2,\n      \"Dir\": \"/tmp\", \"Path\": \"/bin/cat\", \"Args\": [\"cat\", \"a\"]\n    },\n    \"Inputs\": [\"/etc/ld.so.cache\", \"/lib/x86_64-linux-gnu/libc.so.6\", \"/tmp/a\"],\n    \"Outputs\": [\"/dev/fptrace/pipe/1\"],\n    \"FDs\": {\"0\": \"/dev/stdin\", \"1\": \"/dev/fptrace/pipe/1\", \"2\": \"/dev/stderr\"}\n  },\n  {\n    \"Cmd\": {\n      \"Parent\": 1, \"ID\": 3,\n      \"Dir\": \"/tmp\", \"Path\": \"/usr/bin/tee\", \"Args\": [\"tee\", \"b\"]\n    },\n    \"Inputs\": [\"/etc/ld.so.cache\", \"/lib/x86_64-linux-gnu/libc.so.6\", \"/dev/fptrace/pipe/1\"],\n    \"Outputs\": [\"/tmp/b\", \"/dev/stdout\"],\n    \"FDs\": {\"0\": \"/dev/fptrace/pipe/1\", \"1\": \"/dev/stdout\", \"2\": \"/dev/stderr\"}\n  },\n  {\n    \"Cmd\": {\n      \"Parent\": 0, \"ID\": 1, \"Exec\": 4,\n      \"Dir\": \"/tmp\", \"Path\": \"/bin/sh\", \"Args\": [\"sh\", \"-c\", \"echo a \u003e a; cat a | tee b; exec false\"]\n    },\n    \"Inputs\": [\"/etc/ld.so.cache\", \"/lib/x86_64-linux-gnu/libc.so.6\"],\n    \"Outputs\": [\"/tmp/a\"],\n    \"FDs\": {\"0\": \"/dev/stdin\", \"1\": \"/dev/stdout\", \"2\": \"/dev/stderr\"}\n  },\n  {\n    \"Cmd\": {\n      \"Parent\": 1, \"ID\": 4, \"Exit\": 1,\n      \"Dir\": \"/tmp\", \"Path\": \"/bin/false\", \"Args\": [\"false\"]\n    },\n    \"Inputs\": [\"/etc/ld.so.cache\", \"/lib/x86_64-linux-gnu/libc.so.6\"],\n    \"Outputs\": [],\n    \"FDs\": {\"0\": \"/dev/stdin\", \"1\": \"/dev/stdout\", \"2\": \"/dev/stderr\"}\n  }\n]\n```\n\nThe result is a list of command executions (ordered by the time of their exit): an execution begins with an `execve` and ends with the last spawned thread or fork.\n\n- `ID` is a unique execution identifier (counting from 1)\n- `Parent` is the `ID` of the execution that spawned it\n- `Exit` is the exit code of the first process of the execution (omitted if zero, negative on death by signal)\n- `Exec` is the ID of next execution, if the first process has spawned it before the exit\n- `Dir` is the initial working directory\n- `Path` is an absolute path to the executable\n- `Args` are `execve` arguments\n- `FDs` are initial file descriptors\n\n`Inputs` and `Outputs` list chronologically absolute paths to files opened for reading and writing, except that files opened for writing and later opened for reading are not listed as execution `Inputs`. `/dev/fptrace/pipe/` is a fictional directory that enumerates pipes.\n\n# Launcher scripts\n\n`fptrace -s /tmp/scripts sh -c 'echo a \u003e a; cat a | tee b'` generates `0-1-sh`, `1-2-cat`, and `1-3-tee`:\n\n- `0-1-sh`\n```sh\n#!/bin/sh\ncd /tmp\n${exec:-exec} sh -c 'echo a \u003e a; cat a | tee b' \"$@\"\n```\n- `1-2-cat`\n```sh\n#!/bin/sh\ncd /tmp\n${exec:-exec} cat a \"$@\"\n```\n- `1-3-tee`\n```sh\n#!/bin/sh\ncd /tmp\n${exec:-exec} tee b \"$@\"\n```\n\n# Installation\n\nWith go get:\n```sh\ngo get github.com/orivej/fptrace\ngo generate github.com/orivej/fptrace\n```\n\nWith [Nix](https://nixos.org/nix/):\n```sh\nnix-env -if https://github.com/orivej/fptrace/archive/master.tar.gz\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forivej%2Ffptrace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forivej%2Ffptrace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forivej%2Ffptrace/lists"}