Documentation
¶
Overview ¶
Package hybrid looks up a run's risky inputs on CrowdStrike's Hybrid Analysis by SHA-256 alone. The CLI process asks, never a container, and nothing of a file but its hash leaves the machine: the one call is GET /api/v2/overview/{sha256}, and no submission route is ever called. What the service answers is reduced to a fixed vocabulary: malicious refuses the run, suspicious is noted with its threat score, anything else and an unseen hash are clean. A lookup that cannot answer is recorded and does not stop the run.
Index ¶
Constants ¶
const DefaultBase = "https://hybrid-analysis.com"
DefaultBase is Hybrid Analysis's origin.
const ( // MaxWait is the most a run waits in all on rate limits before the // rest of its lookups are not checked, quota. MaxWait = time.Minute )
The bounds on one lookup.
Variables ¶
This section is empty.
Functions ¶
func Key ¶
Key is the Hybrid Analysis key as the runner policy says to read it: the variable its hybridAnalysis block names (HYBRID_API_KEY by default, where a sandbox host hands the platform's key), else, with apiKeySource keyring, the OS keychain entry provider:hybrid-analysis. "" is no key; an error is a keychain the policy names that could not be read.
func Risky ¶
Risky says whether a file of this detected type, at this report path, is looked up. Everything else is never sent.
func ValidSHA256 ¶
ValidSHA256 says whether s is a lower-case hex SHA-256.
Types ¶
type Client ¶
type Client struct {
Key string
Base string
HTTP *http.Client
// contains filtered or unexported fields
}
Client asks Hybrid Analysis with one key. A nil Client, or one with no key, asks nothing and answers every hash not checked, no key.
func FromPolicy ¶
FromPolicy is the client a run looks up with: the policy's key, or none, which asks nothing and says so.
func (*Client) Look ¶
Look asks for each distinct hash once, in order, and answers every one. A rate limit waits, up to MaxWait in all; past that, a refused key, an outage or an answer that is not the overview's ends the lookups, and the hash and those after it are not checked, with the reason. A string that is not a SHA-256 is never asked and is not checked, unavailable.
type Outcome ¶
type Outcome string
Outcome is what the lookup made of one hash, in the receipt's words.
type Result ¶
Result is one hash's lookup. ThreatScore is the service's 0–100 score for a noted or refused hash, 0 when it gave none.
func (Result) String ¶
String is the result in the receipt's words. The verdict is named from the outcome, never echoed from the service's answer.
func (Result) Verdict ¶
Verdict names a noted or refused hash's verdict and threat score, as "malicious, threat score 100"; empty for any other outcome.
func (Result) VerdictWord ¶
VerdictWord is the verdict alone, "malicious" or "suspicious", from the outcome and never from the service's answer; empty for any other.