A Go library to manage the Lacework configuration file ($HOME/.lacework.toml
)
Download the library into your $GOPATH
:
$ go get github.com/lacework/go-sdk/v2/lwconfig
Import the library into your tool:
import "github.com/lacework/go-sdk/v2/lwconfig"
Load the default Lacework configuration file and detect if there is a profile named test
:
package main
import (
"fmt"
"os"
"github.com/lacework/go-sdk/v2/lwconfig"
)
func main() {
profiles, err := lwconfig.LoadProfiles()
if err != nil {
fmt.Printf("Error trying to load profiles: %s\n", err)
os.Exit(1)
}
config, ok := profiles["test"]
if !ok {
fmt.Println("You have a test profile configured!")
} else {
fmt.Println("'test' profile not found")
}
}
Look at the examples/ folder for more examples.