Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support AS and country bans #7

Merged
merged 6 commits into from
May 27, 2021
Merged

Conversation

sbs2001
Copy link
Contributor

@sbs2001 sbs2001 commented May 26, 2021

No description provided.

sbs2001 added 5 commits May 25, 2021 11:47
Signed-off-by: Shivam Sandbhor <shivam@crowdsec.net>
Signed-off-by: Shivam Sandbhor <shivam@crowdsec.net>
Signed-off-by: Shivam Sandbhor <shivam@crowdsec.net>
Signed-off-by: Shivam Sandbhor <shivam@crowdsec.net>
Signed-off-by: Shivam Sandbhor <shivam@crowdsec.net>
@sbs2001 sbs2001 requested a review from AlteredCoder May 26, 2021 07:56
@@ -83,62 +159,24 @@ func (worker *CloudflareWorker) deleteExistingIPList() error {

func (worker *CloudflareWorker) removeIPListDependencies() error {
zones, err := worker.API.ListZones(worker.Ctx)
zoneIDs := make([]string, len(zones))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you can use extractZoneIDs() here ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cloudflare.go Outdated
IP: *decision.Value,
Comment: "Added by crowdsec bouncer",
}] = true
if strings.ToUpper(*decision.Scope) == "IP" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you use switch instead of else/if please?

cloudflare.go Outdated
}

if strings.ToUpper(*decision.Scope) == "IP" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you use switch instead of else/if please?

Signed-off-by: Shivam Sandbhor <shivam@crowdsec.net>
@AlteredCoder AlteredCoder merged commit 8bd0628 into crowdsecurity:main May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants