GithubHelp home page GithubHelp logo

hal-y / go-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lacework/go-sdk

0.0 0.0 0.0 24.75 MB

A set of tools and libraries written in Go to interact with the Lacework platform.

License: Apache License 2.0

Shell 0.89% Go 93.59% Standard ML 0.13% PowerShell 0.47% Makefile 0.30% HTML 3.94% HCL 0.60% Dockerfile 0.07%

go-sdk's Introduction

Lacework Go SDK

GitHub release Go version Go report Codefresh build status GitHub releases

This repository provides a set of tools, libraries, relevant documentation, code samples, processes, and/or guides that allow users and developers to interact with the Lacework platform.

Find more information about this repository at the following Wiki page.

Lacework CLI (cli)

The Lacework Command Line Interface is a tool that helps you manage the Lacework cloud security platform. You can use it to manage compliance reports, external integrations, vulnerability scans, and other operations.

Install

Bash:

curl https://raw.githubusercontent.com/lacework/go-sdk/main/cli/install.sh | bash

Powershell:

Set-ExecutionPolicy Bypass -Scope Process -Force;
iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/lacework/go-sdk/main/cli/install.ps1'))

Homebrew:

brew install lacework/tap/lacework-cli

For more details, see Lacework Homebrew Tap.

Look at the cli/ folder for more information.

Lacework API Client (api)

A Golang API client for interacting with the Lacework API.

Basic Usage

package main

import (
	"fmt"
	"log"

	"github.com/lacework/go-sdk/api"
)

func main() {
	lacework, err := api.NewClient("account")
	if err != nil {
		log.Fatal(err)
	}

	tokenRes, err := lacework.GenerateTokenWithKeys("KEY", "SECRET")
	if err != nil {
		log.Fatal(err)
	}

	// Output: YOUR-ACCESS-TOKEN
	fmt.Println(tokenRes.Token())
}

Look at the api/ folder for more information.

Lacework Logger (lwlogger)

A Logger wrapper for Lacework based of zap logger Go package.

Basic Usage

package main

import "github.com/lacework/go-sdk/lwlogger"

func main() {
	lwL := lwlogger.New("INFO")

	// Output: {"level":"info","ts":"[timestamp]","caller":"main.go:9","msg":"interesting info"}
	lwL.Info("interesting info")
}

Look at the lwlogger/ folder for more information.

Lacework Updater (lwupdater)

A Go library to check for available updates of Lacework projects.

Basic Usage

package main

import (
	"fmt"

	"github.com/lacework/go-sdk/lwupdater"
)

func main() {
	var (
		project  = "go-sdk"
		sdk, err = lwupdater.Check(project, "v0.1.0")
	)

	if err != nil {
		fmt.Println("Unable to check for updates: %s", err)
	} else {
		// Output: The latest release of the go-sdk project is v0.1.7
		fmt.Printf("The latest release of the %s project is %s\n",
			project, sdk.LatestVersion,
		)
	}
}

Set the environment variable LW_UPDATES_DISABLE=1 to avoid checking for updates.

Lacework Config (lwconfig)

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

Basic Usage

package main

import (
	"fmt"

	"github.com/lacework/go-sdk/lwconfig"
)

func main() {
	profiles, err := lwconfig.LoadProfiles()
	if err != nil {
		fmt.Printf("Unable to load profiles: %s\n", err)
	} else {
		fmt.Printf("You have '%d' profiles configured!\n", len(profiles))
	}
}

Look at the lwconfig/ folder for more information.

Lacework Domain (lwdomain)

Go package to disseminate a domain URL into account, cluster and whether or not it is an internal account.

Basic Usage

package main

import (
	"fmt"
	"os"

	"github.com/lacework/go-sdk/lwdomain"
)

func main() {
	domain, err := lwdomain.New("https://account.fra.lacework.net")
	if err != nil {
		fmt.Printf("Error %s\n", err)
		os.Exit(1)
	}

	// Output: Lacework Account Name: account
	fmt.Println("Lacework Account Name: %s", domain.Account)
}

Release Process

The release process of this repository is documented at the following Wiki page.

Contributing

For guidelines on how to contribute to the project see the CONTRIBUTING.md

License and Copyright

Copyright 2020, Lacework Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

go-sdk's People

Contributors

afiune avatar dmurray-lacework avatar lacework-releng avatar dependabot[bot] avatar hazedav avatar rmoles avatar scottford-lw avatar vatasha avatar ipcrm avatar mjunglw avatar aircraft-cerier avatar djmctavish avatar lwmobeent avatar andrewelizondo avatar jjlace avatar larryebaum avatar chi-dev-2021 avatar iancrichardson avatar lhasadreams avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.