Skip to content

Commit 4e4a347

Browse files
authored
renerate spec 04/26/2024 (#427)
* renerate spec 04/26/2024 * fix ioc example
1 parent 48f6999 commit 4e4a347

File tree

362 files changed

+51558
-8224
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

362 files changed

+51558
-8224
lines changed

examples/falcon_iocs/falcon_iocs.go

+32-7
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ func getIOCType(iocStr string) (string, error) {
8282
// addCrowdStrikeIOC will add a supported iocs with an optional description
8383
// defaults to an expiration date of 10 years & a severity of medium.
8484
// will detect on domains/ips and block on hashes. Retro detection enabled by default.
85-
func addCrowdStrikeIOCs(iocs []string, description string, client *client.CrowdStrikeAPISpecification) error {
85+
func addCrowdStrikeIOCs(
86+
iocs []string,
87+
description string,
88+
client *client.CrowdStrikeAPISpecification,
89+
) error {
8690

8791
body := models.APIIndicatorCreateReqsV1{}
8892

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

107+
expiration := strfmt.DateTime(time.Now().Add(24 * time.Hour * 365 * 10))
108+
103109
// add iocs to body
104110
truth := true
105111
body.Indicators = append(body.Indicators, &models.APIIndicatorCreateReqV1{
@@ -110,7 +116,7 @@ func addCrowdStrikeIOCs(iocs []string, description string, client *client.CrowdS
110116
Description: description,
111117
Platforms: []string{"windows", "mac", "linux"},
112118
Value: iocStr,
113-
Expiration: strfmt.DateTime(time.Now().Add(24 * time.Hour * 365 * 10)),
119+
Expiration: &expiration,
114120
// Tags: []string{"example_tag1", "example_tag2"},
115121
})
116122
}
@@ -134,13 +140,20 @@ func addCrowdStrikeIOCs(iocs []string, description string, client *client.CrowdS
134140
return nil
135141
}
136142

137-
func addCrowdStrikeIOC(iocStr string, description string, client *client.CrowdStrikeAPISpecification) error {
143+
func addCrowdStrikeIOC(
144+
iocStr string,
145+
description string,
146+
client *client.CrowdStrikeAPISpecification,
147+
) error {
138148
return addCrowdStrikeIOCs([]string{iocStr}, description, client)
139149
}
140150

141151
// searchCrowdStrikeIOC searches custom IOCs for an IOC and returns an id if found.
142152
// if no IOC is found, an empty string is returned
143-
func _getCrowdStrikeIOCID(iocStr string, client *client.CrowdStrikeAPISpecification) (id string, err error) {
153+
func _getCrowdStrikeIOCID(
154+
iocStr string,
155+
client *client.CrowdStrikeAPISpecification,
156+
) (id string, err error) {
144157
fql := fmt.Sprintf(`value:"%s"`, iocStr)
145158

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

220233
func main() {
221234

222-
falconClientId := flag.String("client-id", os.Getenv("FALCON_CLIENT_ID"), "Client ID for accessing CrowdStrike Falcon Platform (default taken from FALCON_CLIENT_ID env)")
223-
falconClientSecret := flag.String("client-secret", os.Getenv("FALCON_CLIENT_SECRET"), "Client Secret for accessing CrowdStrike Falcon Platform (default taken from FALCON_CLIENT_SECRET)")
224-
clientCloud := flag.String("cloud", os.Getenv("FALCON_CLOUD"), "Falcon cloud abbreviation (us-1, us-2, eu-1, us-gov-1)")
235+
falconClientId := flag.String(
236+
"client-id",
237+
os.Getenv("FALCON_CLIENT_ID"),
238+
"Client ID for accessing CrowdStrike Falcon Platform (default taken from FALCON_CLIENT_ID env)",
239+
)
240+
falconClientSecret := flag.String(
241+
"client-secret",
242+
os.Getenv("FALCON_CLIENT_SECRET"),
243+
"Client Secret for accessing CrowdStrike Falcon Platform (default taken from FALCON_CLIENT_SECRET)",
244+
)
245+
clientCloud := flag.String(
246+
"cloud",
247+
os.Getenv("FALCON_CLOUD"),
248+
"Falcon cloud abbreviation (us-1, us-2, eu-1, us-gov-1)",
249+
)
225250
debug := flag.Bool("debug", false, "Debug requests")
226251

227252
list := flag.Bool("list", false, "list all IOC values in the IOC management panel")

falcon/client/alerts/update_v3_parameters.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

falcon/client/cloud_snapshots/cloud_snapshots_client.go

+200
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)