auth

package
v0.0.0-...-d58163c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2020 License: GPL-3.0 Imports: 23 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnotherValidation

func AnotherValidation(respWriter http.ResponseWriter, req *http.Request, next http.HandlerFunc)

AnotherValidation validates authorization tokens. Is poorly named and up for refactor as time permits

func CrendentialedDbInstance

func CrendentialedDbInstance(fn, profile string) *dynamodb.DynamoDB

CrendentialedDbInstance returns an instance of dynamodb using an aws credential profile

func GetNodeSecret

func GetNodeSecret() (string, error)

GetNodeSecret gets current node secret from ssm parameter store

func GetPass deprecated

func GetPass() ([]byte, error)

GetPass gets password

Deprecated: no longer in use

func GetSsmParam

func GetSsmParam(s string) (string, error)

GetSsmParam returns value of a named ssm parameter

func GetTokenHandler

func GetTokenHandler(dyn AuthDB) http.Handler

GetTokenHandler handles requests to get-token api endpoint

func NewUser

func NewUser(credentialsFile, profile, username, role string, dyn AuthDB) error

NewUser creates new user

func SsmClient

func SsmClient() *ssm.SSM

SsmClient returns an instance of ssm client with credentials provided by ec2 assumed role

func ValidNodeKey

func ValidNodeKey(respWriter http.ResponseWriter, req *http.Request, next http.HandlerFunc)

func ValidateUser

func ValidateUser(request *http.Request, dyn AuthDB) error

ValidateUser checks if user is valid

Types

type AuthDB

type AuthDB interface {
	NewUser(u osquery_types.User) error
	GetUser(username string) (osquery_types.User, error)
	ValidNode(nodeKey string) error
}

type NodeConfigurePost

type NodeConfigurePost struct {
	EnrollSecret   string `json:"enroll_secret"`
	NodeKey        string `json:"node_key"`
	HostIdentifier string `json:"host_identifier"`
}

NodeConfigurePost type for handling post requests made by node

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL