Skip to content

Commit 7e3a2bb

Browse files
committed
feat: add README.md example
1 parent 5ca1390 commit 7e3a2bb

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

README.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@ apt install libselinux1-dev
1616

1717
## Usage
1818

19-
A main tool is implemented to check what modules are enabled, output of `go run cmd/main.go`:
20-
19+
```go
20+
import "github.com/rogercoll/go-lsm"
2121
```
22-
WARNING: LoadPin still not implemented
23-
WARNING: Smack still not implemented
24-
WARNING: TOMOYO still not implemented
25-
Module: selinux is enabled
26-
Module: apparmor is not enabled
27-
Module: yama is enabled
22+
23+
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:
24+
25+
```go
26+
l, err := lsm.NewDefaultConfig()
27+
if err != nil {
28+
log.Fatalf("Failed to create default config: %v", err)
29+
}
30+
modules, err := l.GetLoadedModules()
2831
```

0 commit comments

Comments
 (0)