common

package module
v0.0.0-...-be50511 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// TagCode code tag
	TagCode = "code"
	// TagCode repository tag
	TagRipository = "repository"
	// TagGitleaks gitleaks tag
	TagGitleaks = "gitleaks"

	// TagPrivate private tag
	TagPrivate = "private"
	// TagInternal internal tag
	TagInternal = "internal"
	// TagPublic public tag
	TagPublic = "public"
)
View Source
const (
	// GitleaksDataSource is the specific data_source label for gitleaks
	GitleaksDataSource = "code:gitleaks"
)

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(block *cipher.Block, encrypted []byte) []byte

Decrypt Decrypt the `encrypted`.

func DecryptWithBase64

func DecryptWithBase64(block *cipher.Block, encrypted string) (string, error)

DecryptWithBase64 Decrypt the `encrypted` and base64 decoding.

func Encrypt

func Encrypt(block *cipher.Block, plainText string) ([]byte, error)

Encrypt Encrypt the `plainText`.

func EncryptWithBase64

func EncryptWithBase64(block *cipher.Block, plainText string) (string, error)

EncryptWithBase64 Encrypt the `plainText` and base64 encoding.

Types

type CodeDataSource

type CodeDataSource struct {
	CodeDataSourceID uint32 `gorm:"primary_key"`
	Name             string
	Description      string
	MaxScore         float32
	CreatedAt        time.Time
	UpdatedAt        time.Time
}

CodeDataSource entity

type CodeEnterpriseOrg

type CodeEnterpriseOrg struct {
	GitleaksID uint32 `gorm:"primary_key"`
	Login      string `gorm:"primary_key"`
	ProjectID  uint32
	CreatedAt  time.Time
	UpdatedAt  time.Time
}

CodeEnterpriseOrg entity

type CodeGitleaks

type CodeGitleaks struct {
	GitleaksID          uint32 `gorm:"primary_key"`
	CodeDataSourceID    uint32
	Name                string
	ProjectID           uint32
	Type                string
	BaseURL             string
	TargetResource      string
	RepositoryPattern   string
	GithubUser          string
	PersonalAccessToken string
	ScanPublic          bool
	ScanInternal        bool
	ScanPrivate         bool
	GitleaksConfig      string
	Status              string
	StatusDetail        string
	ScanAt              time.Time
	ScanSucceededAt     *time.Time
	CreatedAt           time.Time
	UpdatedAt           time.Time
}

CodeGitleaks entity

type GitleaksQueueMessage

type GitleaksQueueMessage struct {
	GitleaksID uint32 `json:"gitleaks_id"`
	ProjectID  uint32 `json:"project_id"`
	ScanOnly   bool   `json:"scan_only,string"`
}

GitleaksQueueMessage is the message for SQS queue

func ParseMessage

func ParseMessage(msg string) (*GitleaksQueueMessage, error)

ParseMessage parse message & validation

func (*GitleaksQueueMessage) Validate

func (g *GitleaksQueueMessage) Validate() error

Validate is the validation to GuardDutyMessage

Jump to

Keyboard shortcuts

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