nozzle

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package nozzle defines an interface for all password spraying implementations For example, an Okta nozzle will send login requests to Okta. Additionally, this package provides a nozzle registration mechanism similar to database/sql. Make sure to "blank import" each nozzle.

import (
    "github.com/praetorian-inc/trident/pkg/nozzle"

    _ "github.com/praetorian-inc/trident/pkg/nozzle/adfs"
    _ "github.com/praetorian-inc/trident/pkg/nozzle/o365"
    _ "github.com/praetorian-inc/trident/pkg/nozzle/okta"
)

noz, err := nozzle.Open("okta", map[string]string{"subdomain":"example"})
if err != nil {
    // handle error
}
resp, err := noz.Login("username", "password")
// ...

See https://golang.org/doc/effective_go.html#blank_import for more information on "blank imports".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, driver Driver)

Register makes a nozzle driver available at the provided name. If register is called twice or if the driver is nil, if panics. Register() is typically called in the nozzle implementation's init() function to allow for easy importing of each nozzle.

Types

type Driver

type Driver interface {
	New(opts map[string]string) (Nozzle, error)
}

Driver is the interface the wraps creation of a Nozzle.

type Nozzle

type Nozzle interface {
	Login(username, password string) (*event.AuthResponse, error)
}

Nozzle is the interface that wraps a basic Login() method to be implemented for each authentication provider we support.

func Open

func Open(name string, opts map[string]string) (Nozzle, error)

Open opens a nozzle specified by the nozzle driver name (e.g. okta) and configures that nozzle via the provided opts argument. Each Nozzle should document its configuration options in its New() method.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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