authenticationbypass

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Check = hxcheckdef.NewResourceCheck(Def, func(ctx context.Context, _ harnessx.Target, resource harnessx.Resource, _ harnessx.ResultStore) (harnessx.Result, error) {
	op, ok := operationOf(resource)
	if !ok {
		return harnessx.Result{Err: errors.New("authentication_bypass: resource missing *operation.Operation")}, nil
	}

	noAuthSecurityScheme := auth.MustNewNoAuthSecurityScheme()
	attempt, err := finding.Fetch(ctx, op, noAuthSecurityScheme)
	if err != nil {
		return harnessx.Result{}, err
	}
	if finding.IsUnauthorizedStatusCodeOrSimilar(attempt.Response) {
		return harnessx.Result{}, nil
	}

	return harnessx.Result{Data: &finding.Finding{
		Attempt: attempt,
	}}, nil
},
	hxcheckdef.WithSkip(harnessx.SkipResourceWhen(func(_ context.Context, _ harnessx.Target, resource harnessx.Resource, _ harnessx.ResultStore) string {
		op, ok := operationOf(resource)
		if !ok {
			return "resource is missing operation data"
		}
		if op.GetSecurityScheme().GetType() == auth.None {
			return "operation has no authentication to bypass"
		}
		return ""
	})),
)
View Source
var Def = hxcheckdef.MustParseCheckDefYAML("authentication_bypass", checkYAML)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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