Skip to content

Commit

Permalink
renerate spec 04/26/2024 (#427)
Browse files Browse the repository at this point in the history
* renerate spec 04/26/2024

* fix ioc example
  • Loading branch information
ffalor committed Apr 26, 2024
1 parent 48f6999 commit 4e4a347
Show file tree
Hide file tree
Showing 362 changed files with 51,558 additions and 8,224 deletions.
39 changes: 32 additions & 7 deletions examples/falcon_iocs/falcon_iocs.go
Expand Up @@ -82,7 +82,11 @@ func getIOCType(iocStr string) (string, error) {
// addCrowdStrikeIOC will add a supported iocs with an optional description
// defaults to an expiration date of 10 years & a severity of medium.
// will detect on domains/ips and block on hashes. Retro detection enabled by default.
func addCrowdStrikeIOCs(iocs []string, description string, client *client.CrowdStrikeAPISpecification) error {
func addCrowdStrikeIOCs(
iocs []string,
description string,
client *client.CrowdStrikeAPISpecification,
) error {

body := models.APIIndicatorCreateReqsV1{}

Expand All @@ -100,6 +104,8 @@ func addCrowdStrikeIOCs(iocs []string, description string, client *client.CrowdS
action = "prevent"
}

expiration := strfmt.DateTime(time.Now().Add(24 * time.Hour * 365 * 10))

// add iocs to body
truth := true
body.Indicators = append(body.Indicators, &models.APIIndicatorCreateReqV1{
Expand All @@ -110,7 +116,7 @@ func addCrowdStrikeIOCs(iocs []string, description string, client *client.CrowdS
Description: description,
Platforms: []string{"windows", "mac", "linux"},
Value: iocStr,
Expiration: strfmt.DateTime(time.Now().Add(24 * time.Hour * 365 * 10)),
Expiration: &expiration,
// Tags: []string{"example_tag1", "example_tag2"},
})
}
Expand All @@ -134,13 +140,20 @@ func addCrowdStrikeIOCs(iocs []string, description string, client *client.CrowdS
return nil
}

func addCrowdStrikeIOC(iocStr string, description string, client *client.CrowdStrikeAPISpecification) error {
func addCrowdStrikeIOC(
iocStr string,
description string,
client *client.CrowdStrikeAPISpecification,
) error {
return addCrowdStrikeIOCs([]string{iocStr}, description, client)
}

// searchCrowdStrikeIOC searches custom IOCs for an IOC and returns an id if found.
// if no IOC is found, an empty string is returned
func _getCrowdStrikeIOCID(iocStr string, client *client.CrowdStrikeAPISpecification) (id string, err error) {
func _getCrowdStrikeIOCID(
iocStr string,
client *client.CrowdStrikeAPISpecification,
) (id string, err error) {
fql := fmt.Sprintf(`value:"%s"`, iocStr)

params := ioc.NewIndicatorSearchV1Params().WithFilter(&fql)
Expand Down Expand Up @@ -219,9 +232,21 @@ func showCrowdStrikeIOC(iocStr string, client *client.CrowdStrikeAPISpecificatio

func main() {

falconClientId := flag.String("client-id", os.Getenv("FALCON_CLIENT_ID"), "Client ID for accessing CrowdStrike Falcon Platform (default taken from FALCON_CLIENT_ID env)")
falconClientSecret := flag.String("client-secret", os.Getenv("FALCON_CLIENT_SECRET"), "Client Secret for accessing CrowdStrike Falcon Platform (default taken from FALCON_CLIENT_SECRET)")
clientCloud := flag.String("cloud", os.Getenv("FALCON_CLOUD"), "Falcon cloud abbreviation (us-1, us-2, eu-1, us-gov-1)")
falconClientId := flag.String(
"client-id",
os.Getenv("FALCON_CLIENT_ID"),
"Client ID for accessing CrowdStrike Falcon Platform (default taken from FALCON_CLIENT_ID env)",
)
falconClientSecret := flag.String(
"client-secret",
os.Getenv("FALCON_CLIENT_SECRET"),
"Client Secret for accessing CrowdStrike Falcon Platform (default taken from FALCON_CLIENT_SECRET)",
)
clientCloud := flag.String(
"cloud",
os.Getenv("FALCON_CLOUD"),
"Falcon cloud abbreviation (us-1, us-2, eu-1, us-gov-1)",
)
debug := flag.Bool("debug", false, "Debug requests")

list := flag.Bool("list", false, "list all IOC values in the IOC management panel")
Expand Down
2 changes: 1 addition & 1 deletion falcon/client/alerts/update_v3_parameters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

200 changes: 200 additions & 0 deletions falcon/client/cloud_snapshots/cloud_snapshots_client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4e4a347

Please sign in to comment.