example

package
v2.3.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

README

ObservatoryTLS

ToDo

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsCertLintResult

type AwsCertLintResult struct {
	Bugs          []string `json:"bugs"`
	Errors        []string `json:"errors"`
	Notices       []string `json:"notices"`
	Warnings      []string `json:"warnings"`
	FatalErrors   []string `json:"fatalErrors"`
	Informational []string `json:"informational"`
}

type CAAWorkerResult

type CAAWorkerResult struct {
	Host      string `json:"host"`
	Issue     string `json:"issue"`
	HasCaa    bool   `json:"has_caa"`
	Issuewild string `json:"issuewild"`
}

type CRLWorkerResult

type CRLWorkerResult struct {
	Revoked        string    `json:"host"`
	RevocationTime time.Time `json:"RevocationTime"`
}

type CertificateInfoResult

type CertificateInfoResult struct {
	ID                 int    `json:"id"`
	SerialNumber       string `json:"serialNumber"`
	Version            int8   `json:"version"`
	SignatureAlgorithm string `json:"signatureAlgorithm"`

	FirstSeenTimestamp string `json:"firstSeenTimestamp"`
	LastSeenTimestamp  string `json:"lastSeenTimestamp"`

	Raw               string `json:"Raw"`
	CiscoUmbrellaRank int    `json:"ciscoUmbrellaRank"`

	Issuer struct {
		ID int      `json:"id"`
		C  []string `json:"c"`
		O  []string `json:"o"`
		CN string   `json:"cn"`
	} `json:"issuer"`

	Validity struct {
		NotBefore string `json:"notBefore"`
		NotAfter  string `json:"notAfter"`
	} `json:"validity"`

	Subject struct {
		CN string `json:"cn"`
	} `json:"subject"`

	Key struct {
		Alg      string `json:"alg"`
		Size     int    `json:"size"`
		Exponent int    `json:"exponent"`
	} `json:"key"`

	X509V3Extensions struct {
		AuthorityKeyId           string   `json:"authorityKeyId"`
		SubjectKeyId             string   `json:"subjectKeyId"`
		KeyUsage                 []string `json:"keyUsage"`
		ExtendedKeyUsage         []string `json:"extendedKeyUsage"`
		ExtendedKeyUsageOID      []string `json:"extendedKeyUsageOID"`
		SubjectAlternativeName   []string `json:"subjectAlternativeName"`
		CrlDistributionPoint     []string `json:"crlDistributionPoint"`
		PolicyIdentifiers        []string `json:"policyIdentifiers"`
		IsTechnicallyConstrained bool     `json:"isTechnicallyConstrained"`
	} `json:"x509v3Extensions"`

	X509V3BasicConstraints string `json:"x509v3BasicConstraints"`
	CA                     bool   `json:"ca"`

	ValidationInfo struct {
		ValidationInfoItemMap
	} `json:"validationInfo"`

	Hashes struct {
		SHA1                string `json:"sha1"`
		SHA256              string `json:"sha256"`
		SPKI_SHA256         string `json:"spki-sha256"`
		Subject_SPKI_SHA256 string `json:"subject-spki-sha256"`
		Pin_SHA256          string `json:"pin-sha256"`
	} `json:"hashes"`

	MozillaPolicyV2_5 struct {
		IsTechnicallyConstrained bool `json:"IsTechnicallyConstrained"`
	}
}

type Config

type Config struct {
	Retries       int
	ScanType      int
	ParallelScans int
	LogLevel      string
	APILocation   string
	Rescan        bool
}

Config contains the configurable Values for this scan

type MozillaEvaluationWorkerResult

type MozillaEvaluationWorkerResult struct {
	Level string `json:"level"`

	Failures struct {
		Bad          []string `json:"bad"`
		Old          []string `json:"old"`
		Modern       []string `json:"modern"`
		Intermediate []string `json:"intermediate"`
	} `json:"failures"`
}

type MozillaGradingWorkerResult

type MozillaGradingWorkerResult struct {
	Grade    float32  `json:"grade"`
	Failures []string `json:"failures"`
	//Failures    json.RawMessage `json:"failures"` // can be null or array
	Lettergrade string `json:"lettergrade"`
}

type OscpStatusResult

type OscpStatusResult struct {
	Status    int       `json:"status"`
	RevokedAt time.Time `json:"revoked_at"`
}

type SSLLabsClientSupportResult

type SSLLabsClientSupportResult struct {
	Name            string `json:"name"`
	Curve           string `json:"curve"`
	Version         string `json:"version"`
	Platform        string `json:"platform"`
	CurveCode       int    `json:"curve_code"`
	Ciphersuite     string `json:"ciphersuite"`
	IsSupported     bool   `json:"is_supported"`
	ProtocolCode    int    `json:"protocol_code"`
	CiphersuiteCode int    `json:"ciphersuite_code"`
}

type ScanRequestResponse

type ScanRequestResponse struct {
	ScanID int `json:"scan_id"`
}

type SymantecDistrustResult

type SymantecDistrustResult struct {
	Reasons      []string `json:"reasons"`
	IsDistrusted bool     `json:"isDistrusted"`
}

type TableRow

type TableRow struct {
	ScanStatus                       int
	TestWithSSL                      bool
	Target                           string
	ObsScanID                        int
	EndTime                          string
	MozillaEvaluationWorker_Level    string
	MozillaGradingWorker_Grade       float32
	MozillaGradingWorker_Lettergrade string
	Cert_CommonName                  string
	Cert_AlternativeNames            string
	Cert_FirstObserved               string
	Cert_ValidFrom                   string
	Cert_ValidTo                     string
	Cert_Key                         string
	Cert_Issuer                      string
	Cert_SignatureKeyAlgorithm       string
	HasCAARecord                     bool
	ServerSideCipherOrdering         bool
	OCSPStapling                     bool
}

TableRow represents the scan results for the crawler table

type TlsObservatoryResult

type TlsObservatoryResult struct {
	Id             int       `json:"id"`              // "id": 38911638,
	Timestamp      time.Time `json:"timestamp"`       // "timestamp": "2019-11-20T14:43:54.560707Z",
	Target         string    `json:"target"`          // "target": "www.adesso-service.com",
	Replay         int       `json:"replay"`          // "replay": -1,
	HasTls         bool      `json:"has_tls"`         // "has_tls": true,
	CertId         int       `json:"cert_id"`         // "cert_id": 88958679,
	TrustId        int       `json:"trust_id"`        // "trust_id": 148515746,
	IsValid        bool      `json:"is_valid"`        // "is_valid": true,
	CompletionPerc int       `json:"completion_perc"` // "completion_perc": 100,
	Ack            bool      `json:"ack"`             // "ack": true,
	Attempts       int       `json:"attempts"`        // "attempts": 1,

	// The following fields will be filled manually
	AwsCertLintResult             AwsCertLintResult             `json:"-"`
	CAAWorkerResult               CAAWorkerResult               `json:"-"`
	CRLWorkerResult               CRLWorkerResult               `json:"-"`
	MozillaEvaluationWorkerResult MozillaEvaluationWorkerResult `json:"-"`
	MozillaGradingWorkerResult    MozillaGradingWorkerResult    `json:"-"`
	OscpStatusResult              OscpStatusResult              `json:"-"`
	SSLLabsClientSupportResults   []SSLLabsClientSupportResult  `json:"-"`
	SymantecDistrustResult        SymantecDistrustResult        `json:"-"`
	Top1MResult                   Top1MResult                   `json:"-"`

	//AnalysisParams []string  `json:"analysis_params"` // "analysis_params": {} // ToDo: cannot unmarshal object into Go struct field TlsObservatoryResult.analysis_params of type []string
	Analysis []struct {
		Id       int    `json:"id"`
		Analyzer string `json:"analyzer"`

		Success bool `json:"success"`

		Result json.RawMessage `json:"result"`
	} `json:"analysis"`

	ConnectionInfo struct {
		ScanIp     string `json:"scanIP"`     // "scanIP": "85.22.57.97",
		Serverside bool   `json:"serverside"` // "serverside": true,

		Ciphersuite []struct {
			Cipher       string   `json:"cipher"`        // "cipher": "ECDHE-RSA-AES256-GCM-SHA384",
			Code         int      `json:"code"`          // "code": 49200,
			Protocols    []string `json:"protocols"`     // "protocols": ["TLSv1.2"],
			Pubkey       int      `json:"pubkey"`        // "pubkey": 2048,
			Sigalg       string   `json:"sigalg"`        // "sigalg": "sha256WithRSAEncryption",
			TicketHint   string   `json:"ticket_hint"`   // "ticket_hint": "7200",
			OscpStapling bool     `json:"oscp_stapling"` // "ocsp_stapling": false,
			Pfs          string   `json:"pfs"`           // "pfs": "ECDH,P-256,256bits",
			Curves       []string `json:"curves"`        // "curves": ["prime256v1", "secp521r1", "secp384r1", "secp256k1"]
		} `json:"ciphersuite"`
	} `json:"connection_info"`

	AnalyzeResult struct {
		Id       int             `json:"id"`
		Analyzer string          `json:"string"`
		Result   json.RawMessage `json:"result"` // Will be unmarshaled later due to variable structure (https://stackoverflow.com/questions/19691468/json-decode-with-flexible-type)
		Success  bool            `json:"success"`
	} `json:"analsyis"`
}

type Top1MResult

type Top1MResult struct {
	Target struct {
		Rank      int    `json:"rank"`
		Domain    string `json:"domain"`
		AlexaRank int    `json:"alexa_rank"`
		CiscoRank int    `json:"cisco_rank"`
	} `json:"target"`

	Certificate struct {
		Rank        int    `json:"rank"`
		Domain      string `json:"domain"`
		AlexaRank   int    `json:"alexa_rank"`
		CiscoRank   int    `json:"cisco_rank"`
		AlexaDomain string `json:"alexa_domain"`
		CiscoDomain string `json:"cisco_domain"`
	} `json:"certificate"`
}

type ValidationInfoItem

type ValidationInfoItem struct {
	IsValid bool `json:"isValid"`
}

type ValidationInfoItemMap

type ValidationInfoItemMap map[string]ValidationInfoItem

Jump to

Keyboard shortcuts

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