From b1e8ab351ffce50cafb83eacf4797824b2b365ec Mon Sep 17 00:00:00 2001 From: d1vious Date: Mon, 10 Sep 2018 11:05:41 -0400 Subject: [PATCH 1/2] fixed minor issue with tags listing --- config_examples/waflyctl.toml.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config_examples/waflyctl.toml.example b/config_examples/waflyctl.toml.example index 719f83e..78a4665 100644 --- a/config_examples/waflyctl.toml.example +++ b/config_examples/waflyctl.toml.example @@ -1,7 +1,7 @@ logpath = "waflyctl.log" apiendpoint = "https://api.fastly.com" -tags = [""] +tags = [] publisher = ["owasp"] action = "log" rules = [] From 2ae460109ecfd79e8e0b2db9a7e1d1e148728b62 Mon Sep 17 00:00:00 2001 From: d1vious Date: Mon, 10 Sep 2018 11:07:32 -0400 Subject: [PATCH 2/2] fixed issue caused by setting page size in which the last page was not properly processed --- waflyctl.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/waflyctl.go b/waflyctl.go index 1910b04..144417d 100644 --- a/waflyctl.go +++ b/waflyctl.go @@ -1504,7 +1504,7 @@ func getRules(apiEndpoint, apiKey, serviceID, wafID string) bool { Info.Printf("Reading page: %d out of %d", currentpage, totalpages) //set our API call - apiCall := apiEndpoint + "/service/" + serviceID + "/wafs/" + wafID + "/rule_statuses?page[size]=200&page[number]=" + strconv.Itoa(currentpage) + apiCall := apiEndpoint + "/service/" + serviceID + "/wafs/" + wafID + "/rule_statuses?page[number]=" + strconv.Itoa(currentpage) resp, err := resty.R(). SetHeader("Accept", "application/vnd.api+json"). @@ -1572,7 +1572,7 @@ func getAllRules(apiEndpoint, apiKey, ConfigID string) bool { if ConfigID == "" { //set our API call - apiCall := apiEndpoint + "/wafs/rules?page[size]=200&page[number]=1" + apiCall := apiEndpoint + "/wafs/rules?page[number]=1" resp, err := resty.R(). SetHeader("Accept", "application/vnd.api+json"). @@ -1609,7 +1609,7 @@ func getAllRules(apiEndpoint, apiKey, ConfigID string) bool { Info.Printf("Reading page: %d out of %d", currentpage, totalpages) //set our API call - apiCall := apiEndpoint + "/wafs/rules?page[size]=200&page[number]=" + strconv.Itoa(currentpage) + apiCall := apiEndpoint + "/wafs/rules?page[number]=" + strconv.Itoa(currentpage) resp, err := resty.R(). SetHeader("Accept", "application/vnd.api+json"). @@ -1663,7 +1663,7 @@ func getAllRules(apiEndpoint, apiKey, ConfigID string) bool { } else { //set our API call - apiCall := apiEndpoint + "/wafs/rules?filter[configuration_set_id]=" + ConfigID + "&page[size]=200&page[number]=1" + apiCall := apiEndpoint + "/wafs/rules?filter[configuration_set_id]=" + ConfigID + "&page[number]=1" resp, err := resty.R(). SetHeader("Accept", "application/vnd.api+json"). @@ -1700,7 +1700,7 @@ func getAllRules(apiEndpoint, apiKey, ConfigID string) bool { Info.Printf("Reading page: %d out of %d", currentpage, totalpages) //set our API call - apiCall := apiEndpoint + "/wafs/rules?filter[configuration_set_id]=" + ConfigID + "&page[size]=200&page[number]=" + strconv.Itoa(currentpage) + apiCall := apiEndpoint + "/wafs/rules?filter[configuration_set_id]=" + ConfigID + "&page[number]=" + strconv.Itoa(currentpage) resp, err := resty.R(). SetHeader("Accept", "application/vnd.api+json").