weakjwt

package
v0.0.0-...-37aa375 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JWTNoAlgField        = "JWT_NO_ALG_FIELD"
	JWTAlgFieldNone      = "JWT_ALG_FIELD_NONE"
	JWTNotRecommendedAlg = "JWT_NOT_RECOMMENDED_ALG"
	JWTNoExpireClaim     = "JWT_NO_EXPIRE_CLAIM"
	JWTExpTooFar         = "JWT_EXP_TOO_FAR"
	//nolint:gosec
	JWTWeakSymetricSecret = "JWT_WEAK_SYMETRIC_SECRET"
	JWTSensitiveContent   = "JWT_SENSITIVE_CONTENT"
)
View Source
const (
	AuthorizationHeader = "authorization"
	BearerAuth          = "Bearer"
	MaxTokenAge         = 5 * 24 * time.Hour
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIAnnotationAlgFieldNone

type APIAnnotationAlgFieldNone struct {
	utils.BaseTraceAnalyzerAPIAnnotation
}

func NewAPIAnnotationAlgFieldNone

func NewAPIAnnotationAlgFieldNone(path, method string) *APIAnnotationAlgFieldNone

func (*APIAnnotationAlgFieldNone) Aggregate

func (a *APIAnnotationAlgFieldNone) Aggregate(ann utils.TraceAnalyzerAnnotation) (updated bool)

func (*APIAnnotationAlgFieldNone) Name

func (APIAnnotationAlgFieldNone) Redacted

func (APIAnnotationAlgFieldNone) Severity

func (a APIAnnotationAlgFieldNone) Severity() string

func (*APIAnnotationAlgFieldNone) ToAPIFinding

type APIAnnotationExpTooFar

type APIAnnotationExpTooFar struct {
	utils.BaseTraceAnalyzerAPIAnnotation
	ExpireInExample time.Duration `json:"expire_in_example"`
}

func NewAPIAnnotationExpTooFar

func NewAPIAnnotationExpTooFar(path, method string) *APIAnnotationExpTooFar

func (*APIAnnotationExpTooFar) Aggregate

func (a *APIAnnotationExpTooFar) Aggregate(ann utils.TraceAnalyzerAnnotation) (updated bool)

func (*APIAnnotationExpTooFar) Name

func (a *APIAnnotationExpTooFar) Name() string

func (APIAnnotationExpTooFar) Redacted

func (APIAnnotationExpTooFar) Severity

func (a APIAnnotationExpTooFar) Severity() string

func (*APIAnnotationExpTooFar) ToAPIFinding

func (a *APIAnnotationExpTooFar) ToAPIFinding() oapicommon.APIFinding

type APIAnnotationNoAlgField

type APIAnnotationNoAlgField struct {
	utils.BaseTraceAnalyzerAPIAnnotation
}

func NewAPIAnnotationNoAlgField

func NewAPIAnnotationNoAlgField(path, method string) *APIAnnotationNoAlgField

func (*APIAnnotationNoAlgField) Aggregate

func (a *APIAnnotationNoAlgField) Aggregate(ann utils.TraceAnalyzerAnnotation) (updated bool)

func (*APIAnnotationNoAlgField) Name

func (a *APIAnnotationNoAlgField) Name() string

func (APIAnnotationNoAlgField) Redacted

func (APIAnnotationNoAlgField) Severity

func (a APIAnnotationNoAlgField) Severity() string

func (*APIAnnotationNoAlgField) ToAPIFinding

func (a *APIAnnotationNoAlgField) ToAPIFinding() oapicommon.APIFinding

type APIAnnotationNoExpireClaim

type APIAnnotationNoExpireClaim struct {
	utils.BaseTraceAnalyzerAPIAnnotation
}

func NewAPIAnnotationNoExpireClaim

func NewAPIAnnotationNoExpireClaim(path, method string) *APIAnnotationNoExpireClaim

func (*APIAnnotationNoExpireClaim) Aggregate

func (a *APIAnnotationNoExpireClaim) Aggregate(ann utils.TraceAnalyzerAnnotation) (updated bool)

func (*APIAnnotationNoExpireClaim) Name

func (APIAnnotationNoExpireClaim) Redacted

func (APIAnnotationNoExpireClaim) Severity

func (a APIAnnotationNoExpireClaim) Severity() string

func (*APIAnnotationNoExpireClaim) ToAPIFinding

type APIAnnotationNotRecommendedAlg

type APIAnnotationNotRecommendedAlg struct {
	utils.BaseTraceAnalyzerAPIAnnotation
	NotRecommendedAlgs map[string]bool `json:"not_recommended"`
}

func NewAPIAnnotationNotRecommendedAlg

func NewAPIAnnotationNotRecommendedAlg(path, method string) *APIAnnotationNotRecommendedAlg

func (*APIAnnotationNotRecommendedAlg) Aggregate

func (*APIAnnotationNotRecommendedAlg) Name

func (APIAnnotationNotRecommendedAlg) Redacted

func (APIAnnotationNotRecommendedAlg) Severity

func (*APIAnnotationNotRecommendedAlg) ToAPIFinding

type APIAnnotationSensitiveContent

type APIAnnotationSensitiveContent struct {
	utils.BaseTraceAnalyzerAPIAnnotation
	SensitiveWordsInHeaders map[string]bool `json:"sensitive_words_in_headers"`
	SensitiveWordsInClaims  map[string]bool `json:"sensitive_words_in_claims"`
}

func NewAPIAnnotationSensitiveContent

func NewAPIAnnotationSensitiveContent(path, method string) *APIAnnotationSensitiveContent

func (*APIAnnotationSensitiveContent) Aggregate

func (*APIAnnotationSensitiveContent) Name

func (APIAnnotationSensitiveContent) Redacted

func (APIAnnotationSensitiveContent) Severity

func (*APIAnnotationSensitiveContent) ToAPIFinding

type APIAnnotationWeakSymetricSecret

type APIAnnotationWeakSymetricSecret struct {
	utils.BaseTraceAnalyzerAPIAnnotation
}

func NewAPIAnnotationWeakSymetricSecret

func NewAPIAnnotationWeakSymetricSecret(path, method string) *APIAnnotationWeakSymetricSecret

func (*APIAnnotationWeakSymetricSecret) Aggregate

func (*APIAnnotationWeakSymetricSecret) Name

func (APIAnnotationWeakSymetricSecret) Redacted

func (APIAnnotationWeakSymetricSecret) Severity

func (*APIAnnotationWeakSymetricSecret) ToAPIFinding

type AnnotationAlgFieldNone

type AnnotationAlgFieldNone struct{}

func NewAnnotationAlgFieldNone

func NewAnnotationAlgFieldNone() *AnnotationAlgFieldNone

func (*AnnotationAlgFieldNone) Name

func (a *AnnotationAlgFieldNone) Name() string

func (*AnnotationAlgFieldNone) NewAPIAnnotation

func (a *AnnotationAlgFieldNone) NewAPIAnnotation(path, method string) utils.TraceAnalyzerAPIAnnotation

func (AnnotationAlgFieldNone) Redacted

func (*AnnotationAlgFieldNone) Severity

func (a *AnnotationAlgFieldNone) Severity() string

func (*AnnotationAlgFieldNone) ToFinding

func (a *AnnotationAlgFieldNone) ToFinding() utils.Finding

type AnnotationExpTooFar

type AnnotationExpTooFar struct {
	ExpireAt time.Time     `json:"expire_at"`
	ExpireIn time.Duration `json:"expire_in"`
}

func NewAnnotationExpTooFar

func NewAnnotationExpTooFar(expireAt time.Time) *AnnotationExpTooFar

func (*AnnotationExpTooFar) Name

func (a *AnnotationExpTooFar) Name() string

func (*AnnotationExpTooFar) NewAPIAnnotation

func (a *AnnotationExpTooFar) NewAPIAnnotation(path, method string) utils.TraceAnalyzerAPIAnnotation

func (AnnotationExpTooFar) Redacted

func (*AnnotationExpTooFar) Severity

func (a *AnnotationExpTooFar) Severity() string

func (*AnnotationExpTooFar) ToFinding

func (a *AnnotationExpTooFar) ToFinding() utils.Finding

type AnnotationNoAlgField

type AnnotationNoAlgField struct{}

func NewAnnotationNoAlgField

func NewAnnotationNoAlgField() *AnnotationNoAlgField

func (*AnnotationNoAlgField) Name

func (a *AnnotationNoAlgField) Name() string

func (*AnnotationNoAlgField) NewAPIAnnotation

func (a *AnnotationNoAlgField) NewAPIAnnotation(path, method string) utils.TraceAnalyzerAPIAnnotation

func (AnnotationNoAlgField) Redacted

func (*AnnotationNoAlgField) Severity

func (a *AnnotationNoAlgField) Severity() string

func (*AnnotationNoAlgField) ToFinding

func (a *AnnotationNoAlgField) ToFinding() utils.Finding

type AnnotationNoExpireClaim

type AnnotationNoExpireClaim struct{}

func NewAnnotationNoExpireClaim

func NewAnnotationNoExpireClaim() *AnnotationNoExpireClaim

func (*AnnotationNoExpireClaim) Name

func (a *AnnotationNoExpireClaim) Name() string

func (*AnnotationNoExpireClaim) NewAPIAnnotation

func (a *AnnotationNoExpireClaim) NewAPIAnnotation(path, method string) utils.TraceAnalyzerAPIAnnotation

func (AnnotationNoExpireClaim) Redacted

func (*AnnotationNoExpireClaim) Severity

func (a *AnnotationNoExpireClaim) Severity() string

func (*AnnotationNoExpireClaim) ToFinding

func (a *AnnotationNoExpireClaim) ToFinding() utils.Finding

type AnnotationNotRecommendedAlg

type AnnotationNotRecommendedAlg struct {
	Algorithm       string   `json:"algorithm"`
	RecommendedAlgs []string `json:"recommended_algs"`
}

func NewAnnotationNotRecommendedAlg

func NewAnnotationNotRecommendedAlg(alg string, recommended []string) *AnnotationNotRecommendedAlg

func (*AnnotationNotRecommendedAlg) Name

func (*AnnotationNotRecommendedAlg) NewAPIAnnotation

func (a *AnnotationNotRecommendedAlg) NewAPIAnnotation(path, method string) utils.TraceAnalyzerAPIAnnotation

func (AnnotationNotRecommendedAlg) Redacted

func (*AnnotationNotRecommendedAlg) Severity

func (a *AnnotationNotRecommendedAlg) Severity() string

func (*AnnotationNotRecommendedAlg) ToFinding

func (a *AnnotationNotRecommendedAlg) ToFinding() utils.Finding

type AnnotationSensitiveContent

type AnnotationSensitiveContent struct {
	SensitiveWordsInHeaders []string `json:"sensitive_words_in_headers"`
	SensitiveWordsInClaims  []string `json:"sensitive_words_in_claims"`
}

func NewAnnotationSensitiveContent

func NewAnnotationSensitiveContent(sensitiveInHeaders, sensitiveInClaims []string) *AnnotationSensitiveContent

func (*AnnotationSensitiveContent) Name

func (*AnnotationSensitiveContent) NewAPIAnnotation

func (a *AnnotationSensitiveContent) NewAPIAnnotation(path, method string) utils.TraceAnalyzerAPIAnnotation

func (AnnotationSensitiveContent) Redacted

func (*AnnotationSensitiveContent) Severity

func (a *AnnotationSensitiveContent) Severity() string

func (*AnnotationSensitiveContent) ToFinding

func (a *AnnotationSensitiveContent) ToFinding() utils.Finding

type AnnotationWeakSymetricSecret

type AnnotationWeakSymetricSecret struct {
	WeakKey    []byte `json:"weak_key"`
	WeakKeyLen int    `json:"weak_key_len"`
}

func NewAnnotationWeakSymetricSecret

func NewAnnotationWeakSymetricSecret(weakKey []byte) *AnnotationWeakSymetricSecret

func (*AnnotationWeakSymetricSecret) Name

func (*AnnotationWeakSymetricSecret) NewAPIAnnotation

func (a *AnnotationWeakSymetricSecret) NewAPIAnnotation(path, method string) utils.TraceAnalyzerAPIAnnotation

func (AnnotationWeakSymetricSecret) Redacted

func (*AnnotationWeakSymetricSecret) Severity

func (a *AnnotationWeakSymetricSecret) Severity() string

func (*AnnotationWeakSymetricSecret) ToFinding

type WeakJWT

type WeakJWT struct {
	// contains filtered or unexported fields
}

func NewWeakJWT

func NewWeakJWT(weakKeyList []string, sensitiveKeywords []string) *WeakJWT

func (*WeakJWT) Analyze

func (w *WeakJWT) Analyze(trace *models.Telemetry) (eventAnns []utils.TraceAnalyzerAnnotation)

Jump to

Keyboard shortcuts

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