Skip to content

Commit

Permalink
feat: add README.md example
Browse files Browse the repository at this point in the history
  • Loading branch information
rogercoll committed Sep 2, 2021
1 parent 5ca1390 commit 7e3a2bb
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ apt install libselinux1-dev

## Usage

A main tool is implemented to check what modules are enabled, output of `go run cmd/main.go`:

```go
import "github.com/rogercoll/go-lsm"
```
WARNING: LoadPin still not implemented
WARNING: Smack still not implemented
WARNING: TOMOYO still not implemented
Module: selinux is enabled
Module: apparmor is not enabled
Module: yama is enabled

Construct a new LSM config, then use the various methods to access different parts of the system Linux Security modules configuration. For example, to get all loaded security modules:

```go
l, err := lsm.NewDefaultConfig()
if err != nil {
log.Fatalf("Failed to create default config: %v", err)
}
modules, err := l.GetLoadedModules()
```

0 comments on commit 7e3a2bb

Please sign in to comment.