helper

package
v0.0.0-...-785707f Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckToken

func CheckToken() (*appknox.Me, error)

CheckToken checks if access token is valid.

func ConvertToSARIFReport

func ConvertToSARIFReport(fileID int, riskThreshold int, filePath string, staticScanTimeout time.Duration) error

func GetHostMappings

func GetHostMappings() map[string]string

GetHostMappings returns a map of host names to URLs.

func GetMe

func GetMe() (*appknox.Me, error)

GetMe return current User.

func GetProxy

func GetProxy() (*url.URL, error)

GetProxy return the proxy url if proxy is set.

func HandleDynamicScan

func HandleDynamicScan(fileID, riskThreshold int) error

HandleDynamicScan checks the latest scan and acts accordingly.

func PrintError

func PrintError(a ...interface{})

PrintError prints message to Stderr

func ProcessAnalyses

func ProcessAnalyses(fileID int)

ProcessAnalyses takes the list of analyses and print it to CLI.

func ProcessCiCheck

func ProcessCiCheck(fileID, riskThreshold int, staticScanTimeout time.Duration)

ProcessCiCheck takes the list of analyses and print it to CLI.

func ProcessCreateReport

func ProcessCreateReport(fileID int) (reportID int, err error)

func ProcessDownloadReportCSV

func ProcessDownloadReportCSV(reportID int, outputFilePath string) error

func ProcessDownloadReportExcel

func ProcessDownloadReportExcel(reportID int, outputFilePath string) error

func ProcessFiles

func ProcessFiles(projectID int, versionCode string, offset, limit int)

ProcessFiles takes the list of files and print it to CLI.

func ProcessInit

func ProcessInit()

ProcessInit initializes Appknox CLI.

func ProcessMe

func ProcessMe()

ProcessMe takes the me data and print it to CLI.

func ProcessOrganizations

func ProcessOrganizations()

ProcessOrganizations returns the list of organizations for the current user.

func ProcessOwasp

func ProcessOwasp(owaspID string)

ProcessOwasp takes the me data and print it to CLI.

func ProcessProjects

func ProcessProjects(platform, packageName, query string, offset, limit int)

ProcessProjects takes the list of files and print it to CLI.

func ProcessUpload

func ProcessUpload(file *os.File)

ProcessUpload takes the filePath and upload it to the appknox dashboard.

func ProcessVulnerability

func ProcessVulnerability(vulnerabilityID int)

ProcessVulnerability takes the vulnerabilityID and print it's details to CLI.

func ResolveHostAndRegion

func ResolveHostAndRegion(host, region string, hostMappings map[string]string) (string, error)

ResolveHostAndRegion checks the host and region and returns the resolved base URL

func ScheduleDastAutomation

func ScheduleDastAutomation(fileID int) error

ScheduleDastAutomation calls the DynamicScanService.ScheduleDastAutomation to POST /api/v2/files/:file_id/dynamicscans with mode=Automated.

Types

type MeData

type MeData struct {
	ID                  int    `header:"id"`
	Username            string `header:"username"`
	Email               string `header:"email"`
	DefaultOrganization int    `header:"default-organization"`
}

MeData represents a struct which will be printed to the CLI.

type OrganizationData

type OrganizationData struct {
	ID            int    `header:"id"`
	Name          string `header:"name"`
	ProjectsCount int    `header:"projects-count"`
}

OrganizationData represents a struct which will be printed to the CLI.

type ProjectData

type ProjectData struct {
	ID          int        `header:"id"`
	CreatedOn   *time.Time `header:"created-on"`
	UpdatedOn   *time.Time `header:"updated-on"`
	PackageName string     `header:"package-name"`
	Platform    int        `header:"platform"`
	FileCount   int        `header:"file-count"`
}

ProjectData represents a struct which will be printed to the CLI.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳