Skip to main content

Something about NACL and Security Groups- Cloud Security

NACL and Security Groups:

Archietctre:
1. Security Groups are attached with every EC2 instance.
2. NACLs are situarted at boundary level- at subnet bounadries.

Firewall type:
1. NACLs are Stateless firewalls- meaing they don't keep track of packest going in and out. Everytime a packet leaves a boundary, the NACL checks if this packet is going to be allwed or not, and every time a packet comes inside the boundary, it checks again if the packet is allowed to enter or not. As an analogy, NACL can be condidered as Passwport Control, which even if remebers you by face, will check for your visa and passport before letting you in.
2. Security groups are stateful firewalls- meaning they remember what packet left and do not check when they come back. They keep track of ecah packet going out and in. As an analogy, they can be considered as a security guard siitng at the front gate, who remenbers who went out and let him in.

Traffic:
1. As NACL is stateles, it makes the decision to let a packet go out and In based on rles defined on paramteres- ip, port and protocol. It has separate rule sets for Inbound and Outbound traffic and evaluated independently.

2. As Secruity Groups are stateful, they only care about Inbound packets/ traffci based on rules not outgoing. By defualt, the policy is Deny All for Inbound and Allow All outbound so one has to explicitly define what traffic needs to be allowed In. Packets going out of the Secruity Groups are rememebered on basis of source address and thus are allowed in without any check.

Are NACL and Secruity Groups are redundant?
Not really, as discussed, NACL only inspects the traffic ging in and out of a boundary of a subnet. But there could be many EC2 instances within one subnet and they need to be regulated based on Secrutiy groups rules.

Comments

Popular posts from this blog

Ardilla- New tool for finding SQL Injection and XSS

Three Researchers -- MIT's Adam Kiezun , Stanford's Philip Guo , and Syracuse University's Karthick Jayaraman -- has developed a new tool ' Ardilla ' that automatically finds and exploits SQL injection and cross-site scripting vulnerabilities in Web applications. It creates inputs that pinpoint bugs in Web applications and then generates SQL injection and XSS attacks. But for now Ardilla is for PHP -based Web app only. The researchers say Ardilla found 68 never-before found vulnerabilities in five different PHP applications using the tool -- 23 SQL injection and 45 XSS flaws. More information is awaited. For their attack generation techniques refer to their document at: http://www.cs.washington.edu/homes/mernst/pubs/create-attacks-tr054.pdf

File Upload through Null Byte Injection

Sometimes, during file upload we come across situation wherein there would be check on the file extension at the client side as well as server side too. If the application does allow only .jpeg extension to be uploaded, the client side java script checks for the extension of the file before passing the request. We all know that how easily this can be defeated. Some applications, checks for the extension at the server side also. That's not easy to bypass. However there are some ways with which it still can be bypassed. Most of server side scripts are written in high level languages such as Php, Java etc who still use some C/C++ libraries to read the file name and contents. That leads to the problem. In C/C++ a line ends with /00 or which is called Null Byte. So whenever the interpreter sees a null byte at the end of the a string, it stops reading thinking it has reached at the end of the string. This can be used for the bypass. It works for many servers, specially php servers. T

jtool - an alternative to otool

jtool comes with a capability of running on Linux environment. Some ipa scanning tools are created to run on Linux environment where mac environment is not available. In such cases tools such as otool and class-dump-z will not work. So jtool can be an alternative to otool. For more information on jtool please refer to http://www.newosxbook.com/tools/jtool.html . It lists down various commands which have same output as otool or a equivalent. There are several commands mentioned in link. But for our customized requirements and basis checks I have listed down the below ones after running on many binaries. The outputs are similar or equivalent to otool and class-dump-z: Commands for checking PIE flag (ASLR) in jTool jtool -d -v -arch | grep stack ·           Automatic Reference Counting (ARC) protection: jtool -d -v -arch | grep _objc_release ·           To check if the device is jailbroken: jtool -d -v -arch | grep jail ·           Dyldinfo compatible options