Comments (5)
the problem comes from the total_diff_min = ((now_timestamp - prev_updated_at).total_seconds())/60
lines. the prev_update_at does not have any timezone associated to it. I had to add the UTC timezone to it for it to work.
from aws-waf-security-automations.
Thanks, @jpbelangerupgrade
from aws-waf-security-automations.
it can be fixed with:
from dateutil import tz
# somewhere around line 185
# fix for https://github.com/awslabs/aws-waf-security-automations/issues/18
prev_updated_at = prev_updated_at.replace(tzinfo=tz.tzutc())
# end fix
from aws-waf-security-automations.
Hi all,
I was using the solution from before the last "stack" update on the 29 jully 2017. And it was working great.
When the updated stack got updated I updated it. I realised this morning that it was not working properly with the same reason provided by @thechrisproject here : #25. Not that big of a deal because those ip making too much request get's blocked again. It was just not working as expected by following the amount of time I wanted to block.
I added after line 184
prev_updated_at = prev_updated_at.replace(tzinfo=response['LastModified'].tzinfo)
Before :
prev_updated_at = datetime.datetime.strptime(v['updated_at'], "%Y-%m-%d %H:%M:%S")
total_diff_min = ((now_timestamp - prev_updated_at).total_seconds())/60
After :
prev_updated_at = datetime.datetime.strptime(v['updated_at'], "%Y-%m-%d %H:%M:%S")
prev_updated_at = prev_updated_at.replace(tzinfo=response['LastModified'].tzinfo)
total_diff_min = ((now_timestamp - prev_updated_at).total_seconds())/60
It now work as expected.
from aws-waf-security-automations.
Hi,
Thanks for the comment and recommendation about how to fix it.
The current version is supposed to use the same timezone. Here.
from aws-waf-security-automations.
Related Issues (20)
- missing file HOT 1
- Runtime.ImportModuleError: Unable to import module 'helper': No module named 'lib.s3_util' HOT 2
- Need help writing Custom ACL HOT 3
- Most if not all of Lambda functions created by version 4.0.0 contain vulnerability in requests package of Python HOT 1
- Honeypot doesn't detect correct IP address with CloudFront and recommended cache configuration. HOT 4
- 4.0.2 helper.zip not available in cn-north-1 HOT 1
- Failing to create security-automations-for-aws-waf in il-central-1 HOT 3
- Support for Cloudfront realtime logs HOT 2
- Failing to create security-automations-for-aws-waf in il-central-1 HOT 3
- WAFWebACL Drift for Security Automations for AWS WAF Solution HOT 1
- Glue Table for WAF Access Logs is missing some of the log fields (e.g. labels) HOT 4
- allow cloudwatch logs destination for traffic logs, currently only supported target is s3 HOT 8
- Invalid CRON expression `cron(* ? * * * *)` HOT 6
- Can we align the resources to CIS standards from security hub. HOT 1
- Support for COUNT mode for WAF HOT 2
- How to disable managed ruleset options HOT 1
- Add a option to use a existing WebACL HOT 1
- Based on the template https://docs.aws.amazon.com/solutions/latest/security-automations-for-aws-waf/aws-cloudformation-templates.html the KeyPrefix: 'security-automations-for-aws-waf/v4.0.3' was associated with Python 3.10. Do you have a release for python 3.11? HOT 1
- S3 Access Denied for eu-central-1 HOT 1
- Unable to upgrade from v3.2.5 to v4.x HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-waf-security-automations.