File Intel | Golang SDK
The File Intel service enables you to submit a file's hash and get the file's attributes back - giving you insight into the disposition of the file.
Reputation check
func (e *fileIntel) Reputation(ctx context.Context, input *FileReputationRequest) (*pangea.PangeaResponse[FileReputationResult], error)Lookup a file's hash to retrieve reputation data.
input := &file_intel.FileReputationRequest{
Hash: "322ccbd42b7e4fd3a9d0167ca2fa9f6483d9691364c431625f1df54270647ca8",
HashType: "sha256",
Raw: true,
Verbose: true,
Provider: "reversinglabs",
}
checkOutput, _, err := fileintel.Reputation(ctx, input)
Reputation check V2
func (e *fileIntel) ReputationBulk(ctx context.Context, input *FileReputationBulkRequest) (*pangea.PangeaResponse[FileReputationBulkResult], error)Retrieve a reputation score for a set of file hashes from a provider, including an optional detailed report.
hashes := [...]string{"179e2b8a4162372cd9344b81793cbf74a9513a002eda3324e6331243f3137a63"}
input := &file_intel.FileReputationBulkRequest{
Hashes: hashes,
HashType: "sha256",
Raw: true,
Verbose: true,
Provider: "reversinglabs",
}
checkOutput, _, err := fileintel.ReputationBulk(ctx, input)
Type Client
type Client interfacetype Client interface {
Reputation(ctx context.Context, req *FileReputationRequest) (*pangea.PangeaResponse[FileReputationResult], error)
ReputationBulk(ctx context.Context, req *FileReputationBulkRequest) (*pangea.PangeaResponse[FileReputationBulkResult], error)
// Base service methods
pangea.BaseServicer
}
Type FileReputationBulkRequest
type FileReputationBulkRequest structtype FileReputationBulkRequest struct {
// Base request has ConfigID for multi-config projects
pangea.BaseRequest
Hashes []string `json:"hashes"`
// One of "sha256", "sha", "md5".
HashType string `json:"hash_type"`
// Echo the API parameters in the response.
Verbose *bool `json:"verbose,omitempty"`
// Include raw data from this provider.
Raw *bool `json:"raw,omitempty"`
// Use reputation data from this provider.
Provider string `json:"provider,omitempty"`
}
Type FileReputationBulkResult
type FileReputationBulkResult structtype FileReputationBulkResult struct {
// High-level normalized results sent
// by the Pangea service
Data map[string]ReputationData `json:"data"`
// The parameters, which were passed in
// the request, echoed back
Parameters map[string]any `json:"parameters,omitempty"`
// The raw data from the provider.
// Each provider's data will have its own format
RawData map[string]any `json:"raw_data,omitempty"`
}
Type FileReputationRequest
type FileReputationRequest structtype FileReputationRequest struct {
// Base request has ConfigID for multi-config projects
pangea.BaseRequest
Hash string `json:"hash"`
// One of "sha256", "sha", "md5".
HashType string `json:"hash_type"`
// Echo the API parameters in the response.
Verbose *bool `json:"verbose,omitempty"`
// Include raw data from this provider.
Raw *bool `json:"raw,omitempty"`
// Use reputation data from this provider.
Provider string `json:"provider,omitempty"`
}
Type FileReputationResult
type FileReputationResult structtype FileReputationResult struct {
// High-level normalized results sent
// by the Pangea service
Data ReputationData `json:"data"`
// The parameters, which were passed in
// the request, echoed back
Parameters interface{} `json:"parameters,omitempty"`
// The raw data from the provider.
// Each provider's data will have its own format
RawData interface{} `json:"raw_data,omitempty"`
}
Type ReputationData
type ReputationData structtype ReputationData struct {
// The categories that apply to this
// indicator as determined by the provider
Category []string `json:"category"`
// The score, given by the Pangea service,
// for the indicator
Score int `json:"score"`
// The verdict, given by the Pangea service,
// for the indicator
Verdict string `json:"verdict"`
}
Type fileIntel
type fileIntel structtype fileIntel struct {
pangea.BaseService
}