kandi X-RAY | waf Summary
kandi X-RAY | waf Summary
waf
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Run the agent .
- callback
- return the location of an IP address
- Get the area of the file
- Initialize this request .
- Convert an IP address to a string .
- Convert a string into an IP address .
- Initialize the database .
waf Key Features
waf Examples and Code Snippets
Community Discussions
Trending Discussions on waf
QUESTION
Trying to implement Azure WAF policy and associate with http listener the code was working fine until I try to include a new optional parameter called http_listener_ids
Tf code:
...ANSWER
Answered 2021-Jun-15 at 10:40The documentation for the azurerm_web_application_firewall_policy
resource is out of date but http_listener_ids
and path_based_rule_ids
are read only now (as of v2.55.0) so you can't set them and can only read them as an attribute of the resource.
QUESTION
I Would like to understand what is the difference between WAF, Security Group, and a routing table. Let's say I have a VPC, 2 subnets (a private one) and I want to deploy a web application (UI and backend service and a database (RDS)), In this scenario where does WAF and security groups come into the picture. Can someone help me to understand a use case?
...ANSWER
Answered 2021-Jun-14 at 15:13HTTP protocol is built on top of the TCP protocol.
WAF inspects the HTTP traffic before it reaches your web application in order to block malicious web traffic. In order to implement WAF in front of a containerized application (running on ECS for example) or in front of an application running on EC2 you should use an Application Load Balancer in front of the application servers and associate the WAF with that load balancer. If your application runs on Lambda you can do the same but using API Gateway.
A Security Group accepts or blocks networking protocols such as TCP, UDP, ICMP - based on ports. Open up port 443 and 80 if you want to expose your web application.
Routing tables should be associated with your subnets so that the network traffic (TCP) can knows where to go.
Best practice is to put your application servers and databases in private subnets (with routing tables that does not route traffic from the Internet) and then put e.g Application Load Balancer in the public subnets in order to accept traffic from the Internet and route it to your private subnets.
QUESTION
I heard that Azure App Gateway's Web App Firewall is able to protect apps from SQL injection attacks. How does it actually achieve that?
Does it inspect all the incoming payload (both body and URL params)? If it does, I assume TLS termination has to be set up on the Application Gateway level, otherwise it wouldn't be able to read anything. Does it just look for some suspicious strings in the payload (like ";DROP TABLE....")? How does it know if the content in the payload is safe or not? I mean, I could be sending some payload to my web app that could look like SQL injection - how does the WAF know which request is an attack and which isn't?
...ANSWER
Answered 2021-Jun-10 at 15:14Here is a list of reference material that OWASP used to create the rules for SQL injections. Essentially it is looking at the query to see if there is anything suspect in it (comments trying to obfuscate commands, backticks in the wrong place, trying to gain server/host information, etc). It is a long list, too long to describe here but the reference sites might be easier to understand than the raw rules.
References (from rule code):
- SQL Injection Knowledgebase (via @LightOS)
- SQLi Filter Evasion Cheat Sheet -
- SQL Injection Cheat Sheet -
- http://ferruh.mavituna.com/sql-injection-cheatsheet-oku/ (Link no longer valid) https://www.netsparker.com/blog/web-security/sql-injection-cheat-sheet/ has background info
- SQLMap's Tamper Scripts (for evasions)
- https://svn.sqlmap.org/sqlmap/trunk/sqlmap/tamper/(Link no longer valid) https://medium.com/@drag0n/sqlmap-tamper-scripts-sql-injection-and-waf-bypass-c5a3f5764cb3 has details on the process.
QUESTION
i have a question related to design and architecture needs instead of issue one, we have a kubernetes cluster which handle our production workload, we need to secure external traffic to this cluster so we have designed this approach :
- make a worker node with ingress controller and without any workload
- place this worker node in a DMZ zone in order to handle external traffic to our clusterIP services of our applications.
is that a good idea for securing our workloads ?
if we place an HAproxy in a DMZ zone (as a L4 just to load balance traffic to workers to be handled by ingress nginx for ex) it'll not give us an other level of security (protocol break)
note that we don't have a WAF. Any ideas please??
...ANSWER
Answered 2021-Jun-09 at 23:29Agree to use two dedicated nodes, for high availability, for external traffic entry point.
I would use the haproxy ingress controller Announcing HAProxy Kubernetes Ingress Controller 1.6 with Evolving Kubernetes networking with the Gateway API
QUESTION
I got a microservice in an ECS instance in AWS behind a WAF, I want to create these rules:
- Allow specific IPs (done)
- Allow all connections from inside the VPN (done)
- Deny all the other requests.
The first two IP set are created, but I can't make the last one to work. I tried creating the IP set with 0.0.0.0/0
and another combinations without success.
This is my code, I removed ipset 1 and 2 (that are working), this is the ipset 3:
...ANSWER
Answered 2021-Jun-01 at 01:22You can't block all addresses (CIDR /0). It is not supported. From docs:
AWS WAF supports all IPv4 and IPv6 CIDR ranges except for /0.
Instead, you can use network ACL to deny all traffic, or security groups.
QUESTION
I need to get an ALB name or id to attach WAF rules to it. The ALB is created by Kubernetes and not used anywhere in Terraform. Oficial data resource only supports name and arn with no filtering.
...ANSWER
Answered 2021-Apr-05 at 16:42I'm currently facing the same issue, the name of the ALB doesn't appear to be something that you can set whilst you're deploying the Helm chart and there doesn't appear to be a way of getting the name once the chart has been deployed.
The only workaround I can think of is to describe the ingress resource and then do a trim of some sort on the ingress address using Terraform (ignoring everything after the 4th dash).
It's not a great workaround but is the only one that I've come up with to get this all working through Terraform. Do let me know if you find a better solution for this.
EDIT: It appears that there is already an open issue for this on GitHub: https://github.com/hashicorp/terraform-provider-aws/issues/12265 There is a solution posted a bit further down in the thread which is similar to what I had originally suggested - using regex to get the name of the load balancer from the ingress resource.
QUESTION
I'm deploying WAF with Cloud Armor and I realized that the rules can be created in a "Preview only" mode and that there are Cloud Armor entries in Cloud Logging.
The problem is that when I create a "Preview only" rule and that rule is matched by some request, I cannot differentiate, in the logs, the requests that matched some specific rule and/or the normal, ordinary requests. They look all pretty much the same.
Are there any logging attributes that only exist (or have specific values) when the request match a specific rule in these cases? Because the only way I found to explicitly check the rules matched by some request is unchecking the "Preview only" flag, and it is not nice for production when testing.
...ANSWER
Answered 2021-May-21 at 01:27When you have rules configured in Cloud Armor set to "Preview", Cloud Logging will record what the rule would have done if enabled.
This Cloud Logging filter will show you entries that were denied by Cloud Armor:
QUESTION
My company has 2 AWS accounts. On the first (lets call it playground), I have full administrative permissions. On the second (lets call it production) I have limited IAM permissions
I enabled AWS Config (using the terraform file on the appendix) on both accounts.
- On the playground it runs smoothly, everything is fine.
- One the production, it fails. More specifically, it fails to detect the account's resources with the message "Your resources are being discovered" as shown in the screenshot below.
I initially suspected this could be an IAM role permission issue.
e.g running
aws configservice list-discovered-resources --resource-type AWS::EC2::SecurityGroup --profile playground
gives me a list of the SecurityGroups discovered by the AWS Config on the playground (pretty much what I see on the console dashboard).
On the other hand:
aws configservice list-discovered-resources --resource-type AWS::EC2::SecurityGroup --profile production
returns a null list (there are security groups though. Same results with other types such as AWS::EC2::Instance
)
ANSWER
Answered 2021-May-19 at 11:52This was likely a AWS terraform provider bug.
The service linked role AWSServiceRoleForConfig
does not get activated automatically the first time you apply the terraform plan. You need to manually add it to AWS config. Then it works fine.
EDIT
The solution could be another than the aforementioned (or a combination of both). I also noticed that AWS Config get stuck on "resources are being discovered" when there are no rules/conformance packs deployed. If you deploy a single rule it discovers resources (?!)
QUESTION
I have an App Service (SSL and Custom domain configured at App Service level) for which I would like to add Azure WAF protection as a layer that sits in front of the App Service. I learned that I can do this by using an Application Gateway or Azure Frontdoor. But as a cost optimization approach, can I use WAF only without integrating with a load balancing resource?
Thanks in advance.
...ANSWER
Answered 2021-May-13 at 02:32No, there is no standalone WAF resource in Azure--just the integrated service in Application Gateway and Frontdoor.
QUESTION
I have a Python script running as a lambda function to send data in S3 to Splunk. It can read my data, but cannot send data to Splunk. Can anyone please make any changes to the script attached?
...ANSWER
Answered 2021-May-12 at 12:27The variable name is file_content
not filecontent
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install waf
You can use waf like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page