file_scan

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Scan(ctx context.Context, input *FileScanRequest, file *os.File) (*pangea.PangeaResponse[FileScanResult], error)

	// Base service methods
	pangea.BaseServicer
}

func New

func New(cfg *pangea.Config) Client

type FileScan

type FileScan struct {
	pangea.BaseService
}

func (*FileScan) Scan

@summary Scan

@description Scan a file for malicious content.

@operationId file_scan_post_v1_scan

@example

input := &file_scan.FileScanRequest{
	Raw: true,
	Verbose: true,
	Provider: "crowdstrike",
}

// This should be your own file to scan
file, err := os.Open("./path/to/file.pdf")
if err != nil {
	log.Fatal("expected no error got: %v", err)
}

resp, err := client.Scan(ctx, input, file)
if err != nil {
	log.Fatal(err.Error())
}

type FileScanData

type FileScanData struct {
	Category []string `json:"category"`
	Score    int      `json:"score"`
	Verdict  string   `json:"verdict"`
}

type FileScanFileParams added in v3.1.0

type FileScanFileParams struct {
	Size   int    `json:"transfer_size,omitempty"`
	CRC    string `json:"transfer_crc32c,omitempty"`
	SHA256 string `json:"transfer_sha256,omitempty"`
}

func GetFSParams added in v3.1.0

func GetFSParams(file *os.File) (*FileScanFileParams, error)

type FileScanFullRequest added in v3.1.0

type FileScanFullRequest struct {
	FileScanRequest
	FileScanFileParams
}

type FileScanRequest

type FileScanRequest struct {
	// Base request has ConfigID for multi-config projects
	pangea.BaseRequest
	pangea.TransferRequest

	Verbose  bool   `json:"verbose,omitempty"`
	Raw      bool   `json:"raw,omitempty"`
	Provider string `json:"provider,omitempty"`
}

type FileScanResult

type FileScanResult struct {
	Data       FileScanData `json:"data"`
	Parameters interface{}  `json:"parameters,omitempty"`
	RawData    interface{}  `json:"raw_data,omitempty"`
}

Jump to

Keyboard shortcuts

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