Documentation
¶
Overview ¶
pkg/auth/crawlers.go
pkg/auth/discovery_engine.go
Index ¶
- type APIKeyEndpoints
- type AuthCrawler
- type AuthDiscoveryEngine
- type AuthDiscoveryResult
- type AuthEndpoints
- type AuthInventory
- type BasicAuthEndpoints
- type CertAuthEndpoints
- type CustomAuthEndpoints
- type DigestAuthEndpoints
- type Discovery
- type DiscoveryConfig
- type FormCrawler
- type FormEndpoint
- type JWTEndpoints
- type KerberosEndpoints
- type LDAPEndpoints
- type OAuth2Crawler
- type OAuth2EndpointInfo
- type OAuth2Endpoints
- type OIDCCrawler
- type OIDCEndpoints
- type PortScanner
- type RADIUSEndpoints
- type SAMLCrawler
- type SAMLEndpointInfo
- type SAMLEndpoints
- type SAMLScanner
- type WebAuthnCrawler
- type WebAuthnEndpointInfo
- type WebAuthnEndpoints
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKeyEndpoints ¶
type AuthCrawler ¶
type AuthCrawler interface { Crawl(ctx context.Context, target string) (*AuthEndpoints, error) Name() string }
AuthCrawler interface for protocol-specific crawlers
type AuthDiscoveryEngine ¶
type AuthDiscoveryEngine struct {
// contains filtered or unexported fields
}
AuthDiscoveryEngine discovers all authentication mechanisms for a target
func NewAuthDiscoveryEngine ¶
func NewAuthDiscoveryEngine(discoveryConfig DiscoveryConfig, log *logger.Logger) *AuthDiscoveryEngine
NewAuthDiscoveryEngine creates a new auth discovery engine
func (*AuthDiscoveryEngine) DiscoverAllAuth ¶
func (e *AuthDiscoveryEngine) DiscoverAllAuth(ctx context.Context, target string) (*AuthInventory, error)
DiscoverAllAuth discovers all authentication mechanisms for a target
func (*AuthDiscoveryEngine) RegisterCrawler ¶
func (e *AuthDiscoveryEngine) RegisterCrawler(name string, crawler AuthCrawler)
RegisterCrawler registers an auth crawler
type AuthDiscoveryResult ¶
type AuthDiscoveryResult struct { Target string `json:"target"` SAML *SAMLEndpointInfo `json:"saml,omitempty"` OAuth2 *OAuth2EndpointInfo `json:"oauth2,omitempty"` WebAuthn *WebAuthnEndpointInfo `json:"webauthn,omitempty"` }
AuthDiscoveryResult contains discovered authentication information
type AuthEndpoints ¶
type AuthInventory ¶
type AuthInventory struct { Target string `json:"target"` SAML *SAMLEndpoints `json:"saml,omitempty"` OAuth2 *OAuth2Endpoints `json:"oauth2,omitempty"` OIDC *OIDCEndpoints `json:"oidc,omitempty"` WebAuthn *WebAuthnEndpoints `json:"webauthn,omitempty"` LDAP *LDAPEndpoints `json:"ldap,omitempty"` Kerberos *KerberosEndpoints `json:"kerberos,omitempty"` RADIUS *RADIUSEndpoints `json:"radius,omitempty"` APIKeys *APIKeyEndpoints `json:"api_keys,omitempty"` JWT *JWTEndpoints `json:"jwt,omitempty"` Basic *BasicAuthEndpoints `json:"basic,omitempty"` Digest *DigestAuthEndpoints `json:"digest,omitempty"` Certificate *CertAuthEndpoints `json:"certificate,omitempty"` Custom *CustomAuthEndpoints `json:"custom,omitempty"` Forms []FormEndpoint `json:"forms,omitempty"` Headers map[string]string `json:"auth_headers,omitempty"` Cookies map[string]string `json:"auth_cookies,omitempty"` DiscoveredAt time.Time `json:"discovered_at"` Metadata map[string]interface{} `json:"metadata,omitempty"` }
AuthInventory contains all discovered authentication mechanisms
type BasicAuthEndpoints ¶
type CertAuthEndpoints ¶
type CustomAuthEndpoints ¶
type DigestAuthEndpoints ¶
type Discovery ¶
type Discovery struct{}
Discovery handles authentication endpoint discovery
func NewDiscovery ¶
func NewDiscovery() *Discovery
NewDiscovery creates a new authentication discovery instance
func (*Discovery) DiscoverAuth ¶
DiscoverAuth discovers authentication endpoints and methods for a target
type DiscoveryConfig ¶
type DiscoveryConfig struct { EnablePortScan bool EnableWebCrawl bool EnableMLDetection bool MaxDepth int Timeout time.Duration UserAgent string }
DiscoveryConfig contains configuration for auth discovery
type FormCrawler ¶
type FormCrawler struct {
// contains filtered or unexported fields
}
FormCrawler discovers form-based authentication
func NewFormCrawler ¶
func NewFormCrawler(log *logger.Logger) *FormCrawler
func (*FormCrawler) Crawl ¶
func (c *FormCrawler) Crawl(ctx context.Context, target string) (*AuthEndpoints, error)
func (*FormCrawler) Name ¶
func (c *FormCrawler) Name() string
type FormEndpoint ¶
type FormEndpoint struct { URL string `json:"url"` Method string `json:"method"` UsernameField string `json:"username_field,omitempty"` PasswordField string `json:"password_field,omitempty"` OtherFields map[string]string `json:"other_fields,omitempty"` SubmitValue string `json:"submit_value,omitempty"` FormAction string `json:"form_action,omitempty"` }
type JWTEndpoints ¶
type JWTEndpoints struct { LoginURL string `json:"login_url,omitempty"` RefreshURL string `json:"refresh_url,omitempty"` ValidateURL string `json:"validate_url,omitempty"` Algorithm string `json:"algorithm,omitempty"` TokenLocation string `json:"token_location,omitempty"` HeaderName string `json:"header_name,omitempty"` CookieName string `json:"cookie_name,omitempty"` Claims []string `json:"claims,omitempty"` }
type KerberosEndpoints ¶
type LDAPEndpoints ¶
type OAuth2Crawler ¶
type OAuth2Crawler struct {
// contains filtered or unexported fields
}
OAuth2Crawler discovers OAuth2 endpoints
func NewOAuth2Crawler ¶
func NewOAuth2Crawler(log *logger.Logger) *OAuth2Crawler
func (*OAuth2Crawler) Crawl ¶
func (c *OAuth2Crawler) Crawl(ctx context.Context, target string) (*AuthEndpoints, error)
func (*OAuth2Crawler) Name ¶
func (c *OAuth2Crawler) Name() string
type OAuth2EndpointInfo ¶
type OAuth2EndpointInfo struct { AuthorizeURL string `json:"authorize_url"` TokenURL string `json:"token_url"` UserInfoURL string `json:"userinfo_url"` }
OAuth2EndpointInfo contains OAuth2 endpoint information
type OAuth2Endpoints ¶
type OAuth2Endpoints struct { AuthorizationURL string `json:"authorization_url,omitempty"` TokenURL string `json:"token_url,omitempty"` RevokeURL string `json:"revoke_url,omitempty"` IntrospectURL string `json:"introspect_url,omitempty"` UserInfoURL string `json:"userinfo_url,omitempty"` Scopes []string `json:"scopes,omitempty"` GrantTypes []string `json:"grant_types,omitempty"` ResponseTypes []string `json:"response_types,omitempty"` }
type OIDCCrawler ¶
type OIDCCrawler struct {
// contains filtered or unexported fields
}
OIDCCrawler discovers OpenID Connect endpoints
func NewOIDCCrawler ¶
func NewOIDCCrawler(log *logger.Logger) *OIDCCrawler
func (*OIDCCrawler) Crawl ¶
func (c *OIDCCrawler) Crawl(ctx context.Context, target string) (*AuthEndpoints, error)
func (*OIDCCrawler) Name ¶
func (c *OIDCCrawler) Name() string
type OIDCEndpoints ¶
type OIDCEndpoints struct { ConfigurationURL string `json:"configuration_url,omitempty"` JWKSURL string `json:"jwks_url,omitempty"` Issuer string `json:"issuer,omitempty"` OAuth2 *OAuth2Endpoints `json:"oauth2,omitempty"` }
type PortScanner ¶
type PortScanner struct {
// contains filtered or unexported fields
}
PortScanner performs port scanning for auth services
func NewPortScanner ¶
func NewPortScanner(timeout time.Duration, logger *logger.Logger) *PortScanner
NewPortScanner creates a new port scanner
type RADIUSEndpoints ¶
type SAMLCrawler ¶
type SAMLCrawler struct {
// contains filtered or unexported fields
}
SAMLCrawler discovers SAML endpoints
func NewSAMLCrawler ¶
func NewSAMLCrawler(log *logger.Logger) *SAMLCrawler
func (*SAMLCrawler) Crawl ¶
func (c *SAMLCrawler) Crawl(ctx context.Context, target string) (*AuthEndpoints, error)
func (*SAMLCrawler) Name ¶
func (c *SAMLCrawler) Name() string
type SAMLEndpointInfo ¶
type SAMLEndpointInfo struct { MetadataURL string `json:"metadata_url"` SSOUrl string `json:"sso_url"` EntityID string `json:"entity_id"` }
SAMLEndpointInfo contains SAML endpoint information
type SAMLEndpoints ¶
type SAMLEndpoints struct { MetadataURL string `json:"metadata_url,omitempty"` SSOUrl string `json:"sso_url,omitempty"` SLOUrl string `json:"slo_url,omitempty"` EntityID string `json:"entity_id,omitempty"` IdPUrls []string `json:"idp_urls,omitempty"` SPUrls []string `json:"sp_urls,omitempty"` AssertionURL string `json:"assertion_url,omitempty"` X509Cert string `json:"x509_cert,omitempty"` }
Individual endpoint structures
type WebAuthnCrawler ¶
type WebAuthnCrawler struct {
// contains filtered or unexported fields
}
WebAuthnCrawler discovers WebAuthn endpoints
func NewWebAuthnCrawler ¶
func NewWebAuthnCrawler(log *logger.Logger) *WebAuthnCrawler
func (*WebAuthnCrawler) Crawl ¶
func (c *WebAuthnCrawler) Crawl(ctx context.Context, target string) (*AuthEndpoints, error)
func (*WebAuthnCrawler) Name ¶
func (c *WebAuthnCrawler) Name() string
type WebAuthnEndpointInfo ¶
type WebAuthnEndpointInfo struct { RegisterURL string `json:"register_url"` LoginURL string `json:"login_url"` }
WebAuthnEndpointInfo contains WebAuthn endpoint information
type WebAuthnEndpoints ¶
type WebAuthnEndpoints struct { RegisterURL string `json:"register_url,omitempty"` LoginURL string `json:"login_url,omitempty"` ChallengeURL string `json:"challenge_url,omitempty"` AttestationOptions []string `json:"attestation_options,omitempty"` RPName string `json:"rp_name,omitempty"` RPID string `json:"rp_id,omitempty"` }