Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ik5/gocapng
Binding of libcap-ng for golang
https://github.com/ik5/gocapng
go golang golang-package libcap libcap-ng linux posix
Last synced: 27 days ago
JSON representation
Binding of libcap-ng for golang
- Host: GitHub
- URL: https://github.com/ik5/gocapng
- Owner: ik5
- License: mit
- Created: 2022-01-15T19:15:08.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-13T13:54:56.000Z (almost 3 years ago)
- Last Synced: 2024-06-20T03:41:04.850Z (7 months ago)
- Topics: go, golang, golang-package, libcap, libcap-ng, linux, posix
- Language: Go
- Homepage:
- Size: 1.46 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- License: license
Awesome Lists containing this project
README
gocapng
=======The following code
-------------------The following code provides a (C)Go binding for libcap-ng by Red-Hat using
__static__ linking.The aim of the binding is to provide a Go'ish approach on using libcap-ng's API.
The code is only for Linux without a support for any additional OSes.The API itself allows to provide to 3rd party execution rights.
The examples directory provides both the usage, and the actual right
attributes provided for the executable.What is it all about
--------------------The aim of POSIX's libcap and libcap-ng is to provide elevated permissions for
specific type of actions without becoming root, and only open it when required
and turn it off after performing the call itself.In order to bind low port number (bellow 1024) you need to become root, or use
CAP_NET_BIND_SERVICE with libcap or libcap-ng.The difference between libcap and libcap-ng is that libcap-ng is a library that
provides helps for taking care of POSIX libcap in simpler manner.Building Requirements
---------------------Every executable binary that requires to have capabilities attributes enabled.
The way to set capabilities is to use `setcap` command that arrive from `libcap`.
```shell
$ sudo setcap CAP_ ....
```Without using `setcap`, the executable will not gain any required permission.