database

package
v0.0.0-...-9090e5b Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ALLCERT_COL = "allCerts"
View Source
const BUFFER_SIZE = 650
View Source
const CERT_DB = "tls-observatory"
View Source
const CREDS_FILE = "output/dbcreds.json"
View Source
const SCANINFO_COL = "scanInfo"

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	ScanInfo *mongo.Collection
	AllCerts *mongo.Collection
	// contains filtered or unexported fields
}

func CreateDatabase

func CreateDatabase(user, pass, host string) (*Database, error)

func New

func New(client *mongo.Client) (Database, error)

func OpenDatabase

func OpenDatabase() (*Database, error)

func (*Database) AddCertInfo

func (d *Database) AddCertInfo(line []byte) error

expects a line of json Buffers the insert

func (*Database) Close

func (d *Database) Close() error

func (*Database) FlushCertInfo

func (d *Database) FlushCertInfo() error

func (*Database) GetCertByID

func (d *Database) GetCertByID(id primitive.ObjectID) (bson.M, error)

func (*Database) GetCertsByIDs

func (d *Database) GetCertsByIDs(ids []primitive.ObjectID) ([]bson.M, error)

func (*Database) GetUntransvalidatedCerts

func (d *Database) GetUntransvalidatedCerts() (*mongo.Cursor, error)

func (*Database) GetUnvalidatedCerts

func (d *Database) GetUnvalidatedCerts() (*mongo.Cursor, error)

func (*Database) InsertCert

func (d *Database) InsertCert(cert interface{}, getID bool) (interface{}, error)

func (*Database) SetCertValidation

func (d *Database) SetCertValidation(id primitive.ObjectID, validRoots map[string]struct{}) error

func (*Database) SetScanValidation

func (d *Database) SetScanValidation(id primitive.ObjectID, isValid bool, transvalid bool) error

type ZGrabResponse

type ZGrabResponse struct {
	ID     *interface{} `json:"_id" bson:"_id"`
	Domain *string      `json:"domain" bson:"domain"`
	IP     *string      `json:"ip" bson:"ip"`
	Data   *struct {
		TLS *struct {
			Timestamp string `json:"timestamp" bson:"timestamp"`
			Status    string `json:"status" bson:"status"`
			Error     string `json:"error" bson:"error"`
			Result    *struct {
				HandshakeLog *struct {
					ServerCertificates *struct {
						Certificate *interface{}   `json:"certificate" bson:"certificate"`
						Chain       *[]interface{} `json:"chain" bson:"chain"`
					} `json:"server_certificates" bson:"server_certificates"`
				} `json:"handshake_log" bson:"handshake_log"`
			} `json:"result" bson:"result"`
		} `json:"tls" bson:"tls"`
	} `json:"data" bson:"data"`
}

Jump to

Keyboard shortcuts

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