Examples
This section provides two examples of how to use the Amazon EC2 firewall.
Note | |
---|---|
These examples use the Command Line Tools Reference. You can also achieve these results using the SOAP API. For more information, see Using the SOAP API. |
This example shows Albert modifying the default group to meet his security needs.
Albert Modifies the Default Group
1 |
Albert launches a copy of his favorite public AMI.
|
2 |
After a little wait for image launch to complete. Albert, who is a cautious type, checks the access rules of the default group.
Albert notices that it only accepts ingress network connections from other members of the default group for all protocols and ports. |
3 |
Albert, being paranoid as well as cautious, port scans his instance.
|
4 |
Albert decides he should be able to SSH into his instance, but only from his own machine.
|
5 |
Albert repeats the port scan.
Albert is happy (or at least less paranoid). |
Mary wants to deploy her public, failure resilient, three-tier web service in Amazon EC2. Her grand plan is to have her web tier start off executing in seven instances of ami-fba54092, her application tier executing in twenty instances of ami-e3a5408a, and her multi-master database in two instances of ami-f1a54098. She's concerned about the security of her subscriber database, so she wants to restrict network access to her middle and back tier machines. When the traffic to her site increases over the holiday shopping period, she adds additional instances to her web and application tiers to handle the extra load.
Launch Process
1 |
First, Mary creates a group for her Apache web server instances and allows HTTP access to the world.
|
2 |
Mary launches seven instances of her web server AMI as members
of the
|
3 |
Being as paranoid as Albert, Mary does a port scan to confirm the permissions she just configured.
|
4 |
Mary verifies her web server can be reached.
Mary can reach her web server. |
5 |
Mary creates a separate group for her application server.
|
6 |
Mary starts twenty instances as members of
|
7 |
Mary grants network access between her web server group and the application server group.
|
8 |
Mary verifies access to her app server is restricted by port scanning one of the application servers.
|
9 |
Mary confirms that her web servers have access to her application servers.
|
10 |
Mary repeats these steps to create the database server group and to grant access between the application server and database server groups. |
Note | |
---|---|
Defining firewall rules in terms of groups is flexible enough to allow you to implement functionality equivalent to a VLAN. In addition to the distributed firewall, you can maintain your own firewall on any of your instances. This can be useful if you have specific requirements not met by the Amazon EC2 distributed firewall. |