ctlogacquisition

package module
v0.0.0-...-c9dc440 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: MIT Imports: 13 Imported by: 0

README

ctlog-acquisition

NOTE: This code is a work in progress and should not be used in production. Pull requests and issues are most welcome.

A golang application to pull Certificate Transparency logs

Problems and TODO:

  • Clean up the code
  • Implement backoff algorithm to retry failed download
  • Authentication option for web server
  • cli arguments for various options.

HOW TO:

To get the code running quickly, try the docker container. This will start writing the CT logs to a local directory called 'ct_logs'. NOTE - it takes a while before writing any data to the created files.

docker run -it --rm --v /ct_logs:/static 2ajpekr8/ctlog-acquisition -disable-webserver -start-current

or to build it yourself!

docker build . -t go-ctlog
docker run -it --rm --v /ct_logs:/static go-ctlog -disable-webserver -start-current

To see how the code may work, you can try running

go get github.com/GovAuCSU/ctlog-acquisition 
cd $GOPATH/src/github.com/GovAuCSU/ctlog-acquisition/cmd
go run main.go

visit http://localhost:3000 to download the populated DNS name file

Documentation

Index

Constants

View Source
const DOWNLOADURI = "ct/v1/get-entries"
View Source
const INFOURI = "ct/v1/get-sth"

Variables

View Source
var DisableAPICertValidation bool = true

Determines if certificates should be validated when downloading from Log API endpoints

Functions

func GetListCT

func GetListCT() (*ctlist, error)

Types

type Endpoint

type Endpoint struct {
	Url                 string `json:url`
	Infourl             string `json:"info_url"`
	Downloadurl         string `json:"download_url"`
	Tree_size           int    `json:"tree_size"`
	Timestamp           int    `json:"timestamp"`
	Sha256_root_hash    string `json:"sha256_root_hash"`
	Tree_head_signature string `json:"tree_head_signature"`
}

func Newendpoint

func Newendpoint(path string) (*Endpoint, error)

func (*Endpoint) StreamLog

func (ep *Endpoint) StreamLog(message chan string, start, end int) (int, error)

StreamLog connects to the Downloadurl of the specified endpoint, requests the records between start and end (inclusively), extracts the potential hostnames, sends the hostnames down the 'message' channel, and returns the number of log entry records retrieved.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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