Configuring App Security Groups for Email Notifications

This topic describes creating App Security Groups (ASGs) to allow the Notifications Service to have network access. Without ASGs, you cannot use the Notifications Service. For more information about ASGs, see App Security Groups.

Prerequisite

You must set up the Notifications Service. For more information, see Getting Started with the Notifications Service.

Configure Network Connections

The Notifications Service deploys as a suite of apps to the notifications-with-ui space in the system org, and requires the following outbound network connections:

Destination Ports Protocol Reason
SMTP_SERVER 587 (default) tcp (default) This service is used to send out email notifications.
LOAD_BALANCER_IP 80, 443 tcp This service accesses the load balancer.
ASSIGNED_NETWORK 3306 tcp This service requires access to internal services. ASSIGNED_NETWORK is the CIDR of the network assigned to this service.

Note: The SMTP server port and protocol are dependent on how you configure your server.

Create a SMTP Server ASG

  1. Navigate to the Ops Manager Installation Dashboard and click the Pivotal Application Service (PAS) tile.

  2. Select Email Notifications.

  3. Record the information in the SMTP server address and SMTP server port fields.

  4. Using the SMTP server address information you obtained in the previous step, find the IP addresses and protocol of your SMTP server from the service you are using. You might need to contact your service provider for this information.

  5. Create a smtp-server.json file. For destination, you must enter the IP address of your SMTP Server.

    [
        {
            "protocol": "tcp",
            "destination": SMTP_SERVER_IPS,
            "ports": "587"
        }
    ]
    
  6. Create a security group called smtp-server:

    cf create-security-group smtp-server smtp-server.json
    

Create a Load Balancer ASG

Note: If you already have a ASG set up for a load balancer, you do not need to perform this step. Review your ASGs to check which groups you have set up.

If you are using the built-in HAProxy as your load balancer, follow this procedure. If you are using an external load balancer, you must obtain your HAProxy IPs from the service you are using.

  1. Record the HAProxy IPs in the Networking pane of the PAS tile.

  2. Create a load-balancer-https.json file. For destination, use the HAProxy IPs you recorded above.

    [
        {
            "protocol": "tcp",
            "destination": "10.68.196.250",
            "ports": "80,443"
        }
    ]
    
  3. Create a security group called load-balancer-https:

    $ cf create-security-group load-balancer-https load-balancer-https.json
    

Create an Assigned Network ASG

Note: If you use external services, the IP addresses, ports, and protocols depend on the service.

  1. Go to the Assign AZs and Networks pane of the PAS tile.

  2. Navigate to the network selected in the dropdown.

  3. Go to the BOSH Director tile and select Create Networks, then record the CIDR for the network identified in the previous step. Ensure the subnet mask allows the space to access p-mysql, p-rabbitmq, and p-redis.

  4. Create a file assigned-network.json. For the destination, enter the CIDR you recorded above.

    [
        {
            "protocol": "tcp",
            "destination": "10.68.0.0/20",
            "ports": "3306,5672,6379"
        }
    ]
    
  5. Create a security group called assigned-network:

    $ cf create-security-group assigned-network assigned-network.json
    

Bind the ASGs

To bind the ASGs to the Notifications Service:

  1. Target the system org:

    $ cf target -o system
    

  2. Create a notifications-with-ui space:

    $ cf create-space notifications-with-ui
    

  3. Bind the ASGs you created in this topic to thenotifications-with-ui space:

    $ cf bind-security-group smtp-server system notifications-with-ui
    $ cf bind-security-group load-balancer-https system notifications-with-ui
    $ cf bind-security-group assigned-network system notifications-with-ui