security

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package security implements the Security domain. Security

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(conn *rpcc.Conn) *domainClient

NewClient returns a client for the Security domain with the connection set to conn.

Types

type CertificateErrorAction

type CertificateErrorAction string

CertificateErrorAction The action to take when a certificate error occurs. continue will continue processing the request and cancel will cancel the request.

const (
	CertificateErrorActionNotSet   CertificateErrorAction = ""
	CertificateErrorActionContinue CertificateErrorAction = "continue"
	CertificateErrorActionCancel   CertificateErrorAction = "cancel"
)

CertificateErrorAction as enums.

func (CertificateErrorAction) String

func (e CertificateErrorAction) String() string

func (CertificateErrorAction) Valid

func (e CertificateErrorAction) Valid() bool

type CertificateErrorClient

type CertificateErrorClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*CertificateErrorReply, error)
	rpcc.Stream
}

CertificateErrorClient is a client for CertificateError events. There is a certificate error. If overriding certificate errors is enabled, then it should be handled with the `handleCertificateError` command. Note: this event does not fire if the certificate error has been allowed internally. Only one client per target should override certificate errors at the same time.

type CertificateErrorReply

type CertificateErrorReply struct {
	EventID    int    `json:"eventId"`    // The ID of the event.
	ErrorType  string `json:"errorType"`  // The type of the error.
	RequestURL string `json:"requestURL"` // The url that was requested.
}

CertificateErrorReply is the reply for CertificateError events.

type CertificateID

type CertificateID int

CertificateID An internal certificate ID value.

type CertificateSecurityState added in v0.25.0

type CertificateSecurityState struct {
	Protocol                    string                         `json:"protocol"`                          // Protocol name (e.g. "TLS 1.2" or "QUIC").
	KeyExchange                 string                         `json:"keyExchange"`                       // Key Exchange used by the connection, or the empty string if not applicable.
	KeyExchangeGroup            *string                        `json:"keyExchangeGroup,omitempty"`        // (EC)DH group used by the connection, if applicable.
	Cipher                      string                         `json:"cipher"`                            // Cipher name.
	MAC                         *string                        `json:"mac,omitempty"`                     // TLS MAC. Note that AEAD ciphers do not have separate MACs.
	Certificate                 []string                       `json:"certificate"`                       // Page certificate.
	SubjectName                 string                         `json:"subjectName"`                       // Certificate subject name.
	Issuer                      string                         `json:"issuer"`                            // Name of the issuing CA.
	ValidFrom                   internal.NetworkTimeSinceEpoch `json:"validFrom"`                         // Certificate valid from date.
	ValidTo                     internal.NetworkTimeSinceEpoch `json:"validTo"`                           // Certificate valid to (expiration) date
	CertificateNetworkError     *string                        `json:"certificateNetworkError,omitempty"` // The highest priority network error code, if the certificate has an error.
	CertificateHasWeakSignature bool                           `json:"certificateHasWeakSignature"`       // True if the certificate uses a weak signature aglorithm.
	CertificateHasSha1Signature bool                           `json:"certificateHasSha1Signature"`       // True if the certificate has a SHA1 signature in the chain.
	ModernSSL                   bool                           `json:"modernSSL"`                         // True if modern SSL
	ObsoleteSSLProtocol         bool                           `json:"obsoleteSslProtocol"`               // True if the connection is using an obsolete SSL protocol.
	ObsoleteSSLKeyExchange      bool                           `json:"obsoleteSslKeyExchange"`            // True if the connection is using an obsolete SSL key exchange.
	ObsoleteSSLCipher           bool                           `json:"obsoleteSslCipher"`                 // True if the connection is using an obsolete SSL cipher.
	ObsoleteSSLSignature        bool                           `json:"obsoleteSslSignature"`              // True if the connection is using an obsolete SSL signature.
}

CertificateSecurityState Details about the security state of the page certificate.

Note: This type is experimental.

type HandleCertificateErrorArgs

type HandleCertificateErrorArgs struct {
	EventID int                    `json:"eventId"` // The ID of the event.
	Action  CertificateErrorAction `json:"action"`  // The action to take on the certificate error.
}

HandleCertificateErrorArgs represents the arguments for HandleCertificateError in the Security domain.

func NewHandleCertificateErrorArgs

func NewHandleCertificateErrorArgs(eventID int, action CertificateErrorAction) *HandleCertificateErrorArgs

NewHandleCertificateErrorArgs initializes HandleCertificateErrorArgs with the required arguments.

type InsecureContentStatus deprecated

type InsecureContentStatus struct {
	RanMixedContent                bool  `json:"ranMixedContent"`                // Always false.
	DisplayedMixedContent          bool  `json:"displayedMixedContent"`          // Always false.
	ContainedMixedForm             bool  `json:"containedMixedForm"`             // Always false.
	RanContentWithCertErrors       bool  `json:"ranContentWithCertErrors"`       // Always false.
	DisplayedContentWithCertErrors bool  `json:"displayedContentWithCertErrors"` // Always false.
	RanInsecureContentStyle        State `json:"ranInsecureContentStyle"`        // Always set to unknown.
	DisplayedInsecureContentStyle  State `json:"displayedInsecureContentStyle"`  // Always set to unknown.
}

InsecureContentStatus

Deprecated: Information about insecure content on the page.

type MixedContentType

type MixedContentType string

MixedContentType A description of mixed content (HTTP resources on HTTPS pages), as defined by https://www.w3.org/TR/mixed-content/#categories

const (
	MixedContentTypeNotSet              MixedContentType = ""
	MixedContentTypeBlockable           MixedContentType = "blockable"
	MixedContentTypeOptionallyBlockable MixedContentType = "optionally-blockable"
	MixedContentTypeNone                MixedContentType = "none"
)

MixedContentType as enums.

func (MixedContentType) String

func (e MixedContentType) String() string

func (MixedContentType) Valid

func (e MixedContentType) Valid() bool

type SafetyTipInfo added in v0.25.0

type SafetyTipInfo struct {
	SafetyTipStatus SafetyTipStatus `json:"safetyTipStatus"`   // Describes whether the page triggers any safety tips or reputation warnings. Default is unknown.
	SafeURL         *string         `json:"safeUrl,omitempty"` // The URL the safety tip suggested ("Did you mean?"). Only filled in for lookalike matches.
}

SafetyTipInfo

Note: This type is experimental.

type SafetyTipStatus added in v0.25.0

type SafetyTipStatus string

SafetyTipStatus

Note: This type is experimental.

const (
	SafetyTipStatusNotSet        SafetyTipStatus = ""
	SafetyTipStatusBadReputation SafetyTipStatus = "badReputation"
	SafetyTipStatusLookalike     SafetyTipStatus = "lookalike"
)

SafetyTipStatus as enums.

func (SafetyTipStatus) String added in v0.25.0

func (e SafetyTipStatus) String() string

func (SafetyTipStatus) Valid added in v0.25.0

func (e SafetyTipStatus) Valid() bool

type SetIgnoreCertificateErrorsArgs added in v0.15.5

type SetIgnoreCertificateErrorsArgs struct {
	Ignore bool `json:"ignore"` // If true, all certificate errors will be ignored.
}

SetIgnoreCertificateErrorsArgs represents the arguments for SetIgnoreCertificateErrors in the Security domain.

func NewSetIgnoreCertificateErrorsArgs added in v0.15.5

func NewSetIgnoreCertificateErrorsArgs(ignore bool) *SetIgnoreCertificateErrorsArgs

NewSetIgnoreCertificateErrorsArgs initializes SetIgnoreCertificateErrorsArgs with the required arguments.

type SetOverrideCertificateErrorsArgs

type SetOverrideCertificateErrorsArgs struct {
	Override bool `json:"override"` // If true, certificate errors will be overridden.
}

SetOverrideCertificateErrorsArgs represents the arguments for SetOverrideCertificateErrors in the Security domain.

func NewSetOverrideCertificateErrorsArgs

func NewSetOverrideCertificateErrorsArgs(override bool) *SetOverrideCertificateErrorsArgs

NewSetOverrideCertificateErrorsArgs initializes SetOverrideCertificateErrorsArgs with the required arguments.

type State

type State string

State The security level of a page or resource.

const (
	StateNotSet         State = ""
	StateUnknown        State = "unknown"
	StateNeutral        State = "neutral"
	StateInsecure       State = "insecure"
	StateSecure         State = "secure"
	StateInfo           State = "info"
	StateInsecureBroken State = "insecure-broken"
)

State as enums.

func (State) String

func (e State) String() string

func (State) Valid

func (e State) Valid() bool

type StateChangedClient

type StateChangedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*StateChangedReply, error)
	rpcc.Stream
}

StateChangedClient is a client for SecurityStateChanged events. The security state of the page changed.

type StateChangedReply

type StateChangedReply struct {
	SecurityState State `json:"securityState"` // Security state.
	// SchemeIsCryptographic is deprecated.
	//
	// Deprecated: True if the page was loaded over cryptographic
	// transport such as HTTPS.
	SchemeIsCryptographic bool               `json:"schemeIsCryptographic"`
	Explanations          []StateExplanation `json:"explanations"` // List of explanations for the security state. If the overall security state is `insecure` or `warning`, at least one corresponding explanation should be included.
	// InsecureContentStatus is deprecated.
	//
	// Deprecated: Information about insecure content on the page.
	InsecureContentStatus InsecureContentStatus `json:"insecureContentStatus"`
	Summary               *string               `json:"summary,omitempty"` // Overrides user-visible description of the state.
}

StateChangedReply is the reply for SecurityStateChanged events.

type StateExplanation

type StateExplanation struct {
	SecurityState    State            `json:"securityState"`             // Security state representing the severity of the factor being explained.
	Title            string           `json:"title"`                     // Title describing the type of factor.
	Summary          string           `json:"summary"`                   // Short phrase describing the type of factor.
	Description      string           `json:"description"`               // Full text explanation of the factor.
	MixedContentType MixedContentType `json:"mixedContentType"`          // The type of mixed content described by the explanation.
	Certificate      []string         `json:"certificate"`               // Page certificate.
	Recommendations  []string         `json:"recommendations,omitempty"` // Recommendations to fix any issues.
}

StateExplanation An explanation of an factor contributing to the security state.

type VisibleSecurityState added in v0.25.0

type VisibleSecurityState struct {
	SecurityState            State                     `json:"securityState"`                      // The security level of the page.
	CertificateSecurityState *CertificateSecurityState `json:"certificateSecurityState,omitempty"` // Security state details about the page certificate.
	SafetyTipInfo            *SafetyTipInfo            `json:"safetyTipInfo,omitempty"`            // The type of Safety Tip triggered on the page. Note that this field will be set even if the Safety Tip UI was not actually shown.
	SecurityStateIssueIDs    []string                  `json:"securityStateIssueIds"`              // Array of security state issues ids.
}

VisibleSecurityState Security state information about the page.

Note: This type is experimental.

type VisibleSecurityStateChangedClient added in v0.25.0

type VisibleSecurityStateChangedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*VisibleSecurityStateChangedReply, error)
	rpcc.Stream
}

VisibleSecurityStateChangedClient is a client for VisibleSecurityStateChanged events. The security state of the page changed.

type VisibleSecurityStateChangedReply added in v0.25.0

type VisibleSecurityStateChangedReply struct {
	VisibleSecurityState VisibleSecurityState `json:"visibleSecurityState"` // Security state information about the page.
}

VisibleSecurityStateChangedReply is the reply for VisibleSecurityStateChanged events.

Jump to

Keyboard shortcuts

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