Skip to content

Latest commit

 

History

History

lwconfig

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Lacework Config

A Go library to manage the Lacework configuration file ($HOME/.lacework.toml)

Usage

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"

Examples

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.