gitleaks

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 26 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratePutFindingRequest added in v0.11.0

func GeneratePutFindingRequest(projectID uint32, f *GitleaksFinding) (*finding.PutFindingRequest, error)

func NewHandler

func NewHandler(
	ctx context.Context,
	fc finding.FindingServiceClient,
	ac alert.AlertServiceClient,
	cc code.CodeServiceClient,
	codeDataKey string,
	githubDefaultToken string,
	redact bool,
	gitleaksConfigPath string,
	limitRepositorySizeKb int,
	l logging.Logger,
) (*sqsHandler, error)

Types

type GitleaksFinding added in v0.11.0

type GitleaksFinding struct {
	*RepositoryMetadata `json:"repository_metadata,omitempty"`
	Result              *LeakFinding `json:"results,omitempty"`
}

func GenrateGitleaksFinding added in v0.11.0

func GenrateGitleaksFinding(repo *github.Repository, leaks []report.Finding) []*GitleaksFinding

type LeakFinding added in v0.11.0

type LeakFinding struct {
	DataSourceID string `json:"data_source_id"`

	StartLine       int      `json:"startLine,omitempty"`
	EndLine         int      `json:"endLine,omitempty"`
	StartColumn     int      `json:"startColumn,omitempty"`
	Secret          string   `json:"secret,omitempty"`
	Commit          string   `json:"commit,omitempty"`
	Repo            string   `json:"repo,omitempty"`
	RuleDescription string   `json:"ruleDescription,omitempty"`
	Message         string   `json:"commitMessage,omitempty"`
	Author          string   `json:"author,omitempty"`
	Email           string   `json:"email,omitempty"`
	File            string   `json:"file,omitempty"`
	Date            string   `json:"date,omitempty"`
	Tags            []string `json:"tags,omitempty"`
	URL             string   `json:"url,omitempty"`
}

func (*LeakFinding) GenerateDataSourceID added in v0.11.0

func (l *LeakFinding) GenerateDataSourceID() string

func (*LeakFinding) GenerateGitHubURL added in v0.11.0

func (l *LeakFinding) GenerateGitHubURL(repositoryURL string) string

type Recommend added in v0.11.0

type Recommend struct {
	Risk           string `json:"risk,omitempty"`
	Recommendation string `json:"recommendation,omitempty"`
}

func GetRecommend added in v0.11.0

func GetRecommend(rule, repoName, fileName, visibility, githubURL, author, authorEmail string) *Recommend

type RepositoryMetadata

type RepositoryMetadata struct {
	ID                  *int64           `json:"id,omitempty"`
	NodeID              *string          `json:"node_id,omitempty"`
	Name                *string          `json:"name,omitempty"`
	FullName            *string          `json:"full_name,omitempty"`
	Description         *string          `json:"description,omitempty"`
	Homepage            *string          `json:"homepage,omitempty"`
	CloneURL            *string          `json:"clone_url,omitempty"`
	GitURL              *string          `json:"git_url,omitempty"`
	MirrorURL           *string          `json:"mirror_url,omitempty"`
	SSHURL              *string          `json:"ssh_url,omitempty"`
	Language            *string          `json:"language,omitempty"`
	Fork                *bool            `json:"fork,omitempty"`
	Size                *int             `json:"size,omitempty"`
	DeleteBranchOnMerge *bool            `json:"delete_branch_on_merge,omitempty"`
	Topics              []string         `json:"topics,omitempty"`
	Archived            *bool            `json:"archived,omitempty"`
	Disabled            *bool            `json:"disabled,omitempty"`
	Permissions         *map[string]bool `json:"permissions,omitempty"`
	Private             *bool            `json:"private,omitempty"`
	TeamID              *int64           `json:"team_id,omitempty"`
	Visibility          *string          `json:"visibility,omitempty"`

	CreatedAt *github.Timestamp `json:"created_at,omitempty"`
	PushedAt  *github.Timestamp `json:"pushed_at,omitempty"`
	UpdatedAt *github.Timestamp `json:"updated_at,omitempty"`
}

Jump to

Keyboard shortcuts

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