Skip to content
This repository has been archived by the owner on May 21, 2023. It is now read-only.

Commit

Permalink
Change capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
cugu committed Jan 12, 2022
1 parent 4d86af7 commit d43922a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ github.com/pkg/errors

## Capabilities

| Name | Description | Packages |
|---------|-------------------------------------------------------------------------------------------------------------------------------------|--------------------|
| file | Read and write access to files | os io/ioutil |
| network | Read and write to the network | net net/http |
| execute | Execute other binaries | os/exec reflect |
| runtime | Access system information | runtime |
| syscall | Perform any system call in context of the software. Unsafe might indicate a //go:linkname and login of external C or assembler code | syscall, C, unsafe |

| Name | Description | Packages |
|---------|-------------------------------------------------------------------------------------------------------------------------------------|--------------|
| file | Read and write access to files | os io/ioutil |
| network | Read and write to the network | net net/http |
| execute | Execute other binaries | os/exec |
| syscall | Perform any system call in context of the software | syscall, C |
| unsafe | Usage of the unsafe package in combination with a //go:linkname compiler directive can be used to load external C or assembler code | unsafe |
| reflect | reflect.NewAt in combination with reflect#Value.Call might be used call arbitrary functions | reflect |
5 changes: 2 additions & 3 deletions capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ var permissionMap = map[string][]string{
"net/http": {"network"},
"os/exec": {"execute"},
"syscall": {"syscall"},
"runtime": {"runtime"},
"reflect": {"execute"},
"unsafe": {"syscall"},
"reflect": {"reflect"},
"unsafe": {"unsafe"},
}

func toCapabilities(dependencies []string) []string {
Expand Down
4 changes: 2 additions & 2 deletions go.cap
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github.com/cugu/gocap (execute, file)

github.com/alecthomas/kong (file, syscall)
github.com/pkg/errors (runtime)
github.com/alecthomas/kong (file, syscall, reflect, unsafe)
github.com/alecthomas/participle/v2 (reflect)

0 comments on commit d43922a

Please sign in to comment.