This document supports the version of each product listed and
supports all subsequent versions until the document is replaced
by a new edition. To check for more recent editions of this
document, see http://www.vmware.com/support/pubs.
EN-000434-01
vShield API Programming Guide
You can find the most up-to-date technical documentation on the VMware Web site at:
http://www.vmware.com/support/
The VMware Web site also provides the latest product updates.
If you have comments about this documentation, submit your feedback to:
VMware is a registered trademark or trademark of VMware, Inc. in the United States and/or other jurisdictions. All other marks
and names mentioned herein may be trademarks of their respective companies.
VMware, Inc.
3401 Hillview Ave.
Palo Alto, CA 94304
www.vmware.com
2VMware, Inc.
Contents
About This Book7
1Overview of VMware vShield9
vShield Components 9
vShield Manager 9
vShield App 9
vShield Edge 10
vShield Endpoint 10
Ports Required for vShield 10
An Introduction to REST API for vShield Users 10
How REST Works 10
Using the vShield REST API 11
RESTful Workflow Patterns 11
For More Information About REST 12
2vShield Manager Management13
Synchronize the vShield Manager with vCenter Server and DNS 13
Retrieving Tech Support Logs 14
Get the vShield Manager Technical Support Log File Path 14
Get the vShield Edge Technical Support Log File Path 14
3ESX Host Preparation for vShield App, Endpoint, and Isolation15
Install the Licenses for vShield Edge, vShield App, and vShield Endpoint 15
Install vShield App, vShield Endpoint, and Port Group Isolation Services on an ESX Host 15
Get the Installation Status of vShield Services on an ESX Host 17
Uninstalling vShield Services from an ESX Host 18
4vNetwork Preparation and vShield Edge Installation19
Enabling Port Group Isolation 19
Enable Port Group Isolation on a vDS 20
Get the Port Group Isolation Debug Statistics from an ESX Host 20
Disable Port Group Isolation on a vDS 20
Installing a vShield Edge 21
Get the Install Parameters of a vShield Edge 22
Uninstall a vShield Edge 22
5vShield Edge Management23
Upgrading a vShield Edge 24
Force a vShield Edge to Synchronize with the vShield Manager 24
Manage CLI Credentials on a vShield Edge 25
Managing DHCP 25
Get the DHCP Server Status 25
Start, Stop, or Restart the DHCP Service 25
Post a DHCP Configuration 26
Get the Configuration for All DHCP Hosts and Pools 26
Get Timestamps of Last 10 DHCP Configurations 27
Get a DHCP Configuration by Timestamp 27
VMware, Inc.3
vShield API Programming Guide
Revert to a DHCP Configuration by Timestamp 27
Delete the DHCP Configuration on a vShield Edge 27
Managing NAT 28
Managing SNAT Rules 28
Managing DNAT Rules 30
Configuring the vShield Edge Firewall 33
Get the Firewall Rule Set for a vShield Edge 33
Post a Firewall Rule Set 34
Get the Status of the Default Policy for a vShield Edge 35
Change the Default Firewall Policy Action 35
Get Details of a Specific Firewall Rule 36
Get Timestamps of Last 10 Firewall Rule Sets for a vShield Edge 36
Get Firewall Rule Set by Timestamp 36
Revert to a Firewall Rule Set by Timestamp 36
Delete All Firewall Rules on a vShield Edge 36
Configuring VPNs 37
Get the Status of VPN Service 38
Start or Stop the VPN Service on a vShield Edge 38
Configure VPN Parameters on a vShield Edge 38
Add a Remote Site 39
Add Tunnels for a VPN Site 40
Get the Detailed IPSec Configurations for a Network 40
Get the Detailed Configuration for a VPN Site 41
Get the Detailed Tunnel Configuration 41
Delete a Tunnel for a VPN Site 41
Delete a Remote Site 41
Get the Current VPN Configuration on a vShield Edge 41
Get Timestamps of Last 10 VPN Configurations 42
Get a VPN Configuration by Timestamp 42
Revert to a VPN Configuration by Timestamp 42
Delete the VPN Configuration on a vShield Edge 42
Load Balancer 43
Get the Status of Load Balancer Service on a vShield Edge 43
Start or Stop the Load Balancer Service on a vShield Edge 44
Add a Listener for Load Balancing Service 44
Get the Current Load Balancer Configuration on a vShield Edge 45
Get the Configuration of a Specific Load Balancing Server 45
Get Timestamps of Last 10 Load Balancer Configurations 45
Get a Load Balancer Configuration by Timestamp 46
Revert to a Load Balancer Configuration by Timestamp 46
Delete the Load Balancer Configuration on a vShield Edge 46
Managing the MTU Threshold for a vShield Edge 46
View Traffic Statistics 47
Debug vShield Edge Services Using Service Statistics 47
Managing the Connection to a Syslog Server 47
Post a Syslog Server Configuration 47
Get the Current Syslog Server Configuration 48
Get Timestamps of Last 10 Syslog Server Configurations 48
Get a Syslog Server Configuration by Timestamp 48
Revert to a Syslog Server Configuration by Timestamp 48
Delete the Current Syslog Server Configuration 49
6vShield App Management51
Configuring Firewall Rules for a vCenter Container 51
View All Firewall Rules for a Container 51
Post an App Firewall Rule Set for a Container 52
4VMware, Inc.
View a List of Timestamps Identifying App Firewall Rule Set Changes 55
View a Previous Firewall Rule Set by Timestamp 55
Revert to a Previous Firewall Rule Set 55
Delete All Firewall Rules under a Container 55
Managing Security Groups 56
Add a Security Group 56
Add a Virtual Machine to a Security Group 57
Get the List of All Security Groups under a Base Node 57
Get the Details for a Single Security Group under a Base Node 58
Get IP Addresses for the Virtual Machines in a Security Group 58
Get the Properties from a Virtual Machine 58
Delete a Virtual Machine from a Security Group 58
Delete a Single Security Group 59
Delete All Security Groups under a Base Node 59
Configuring Syslog Service for a vShield App 59
7vShield Endpoint Management61
Register an SVM with the vShield Endpoint Service on an ESX Host 61
Retrieve SVM-Specific Network Information 62
Retrieve vShield Endpoint Service Status on an ESX Host 63
Uninstalling the vShield Endpoint Service from an ESX Host 63
Unregister an SVM from vShield Endpoint 63
Uninstall vShield Endpoint from the vShield Manager 64
Error Schema 64
Appendix65
vShield Manager Schemas 65
vShield Manager to vCenter Server Synchronization Schema 65
DNS Service Schema 66
Virtual Machine Information Schema 66
Security Groups Schema 67
ESX Host Preparation and Uninstallation Schema 68
vShield App Schemas 69
vShield App Configuration Schema 69
vShield App Firewall Schema 70
Port Group Isolation Management Schema 71
Port Group Isolation Statistics Schema 71
vShield Edge Schemas 72
Base vShield Edge Configuration Schema 72
vShield Edge Installation and Upgrade Schema 72
vShield Edge Global Configuration Schema 73
vShield Edge CLI Login Credentials Schema 74
vShield Edge Firewall Schema 74
NAT Schema 77
DHCP Schema 79
VPN Schema 80
Load Balancer Schema 83
MTU Threshold Schema 84
Traffic Stats Schema 85
Syslog Schema 85
Error Message Schema 86
Index87
VMware, Inc.5
VMware, Inc.6
About This Book
This manual, the vShield API Programming Guide, describes how to install, configure, monitor, and maintain the
VMware
instructions and examples.
®
vShield™ system by using REST API requests. The information includes step-by-step configuration
Intended Audience
This manual is intended for anyone who wants to use REST API to install or use vShield in a VMware
vCenter™ environment. The information in this manual is written for experienced system administrators who
are familiar with virtual machine technology and virtual datacenter operations. This manual assumes
familiarity with vShield.
VMware Technical Publications Glossary
VMware Technical Publications provides a glossary of terms that might be unfamiliar to you. For definitions
of terms as they are used in VMware technical documentation go to http://www.vmware.com/support/pubs.
Document Feedback
VMware welcomes your suggestions for improving our documentation. If you have comments, send your
feedback to docfeedback@vmware.com.
vShield Documentation
The following documents comprise the vShield documentation set:
vShield Administration Guide
vShield Quick Start Guide
vShield API Programming Guide, this guide
Technical Support and Education Resources
The following sections describe the technical support resources available to you. To access the current version
of this book and other books, go to http://www.vmware.com/support/pubs.
Online and Telephone Support
To use online support to submit technical support requests, view your product and contract information, and
register your products, go to http://www.vmware.com/support.
Customers with appropriate support contracts should use telephone support for the fastest response on
priority 1 issues. Go to http://www.vmware.com/support/phone_support.
VMware, Inc.7
vShield API Programming Guide
Support Offerings
To find out how VMware support offerings can help meet your business needs, go to
http://www.vmware.com/support/services.
VMware Professional Services
VMware Education Services courses offer extensive hands-on labs, case study examples, and course materials
designed to be used as on-the-job reference tools. Courses are available onsite, in the classroom, and live
online. For onsite pilot programs and implementation best practices, VMware Consulting Services provides
offerings to help you assess, plan, build, and manage your virtual environment. To access information about
education classes, certification programs, and consulting services, go to http://www.vmware.com/services.
8VMware, Inc.
1
Overview of VMware vShield
VMware® vShield™ is a suite of network edge and application-aware firewalls built for VMware vCenter™
Server integration. vShield inspects client-server communications and inter-virtual-machine communication
to provide detailed traffic analytics and application-aware firewall protection. vShield is a critical security
component for protecting virtualized datacenters from attacks and misuse helping you achieve your
compliance-mandated goals.
This guide assumes you have administrator access to the entire vShield system. If you are unable to access a
screen or perform a particular task, consult your vShield administrator.
This chapter includes the following topics:
“vShield Components” on page 9
“Ports Required for vShield” on page 10
“An Introduction to REST API for vShield Users” on page 10
vShield Components
vShield includes components and services essential for protecting virtual machines. vShield can be configured
through a web-based user interface, a command line interface (CLI), and REST API.
1
To run vShield, you need one vShield Manager virtual machine and at least one vShield Zones, vShield App,
or vShield Edge virtual machine.
vShield Manager
The vShield Manager is the centralized management component of vShield and is installed from OVA as a
virtual machine by using the vSphere Client. Using the vShield Manager user interface or vSphere Client
plug-in, administrators can install, configure, and maintain vShield components.
The vShield Manager virtual machine can run on a different ESX host from your vShield App and vShield
Edge virtual machines.
The vShield Manager user interface leverages the VMware Infrastructure SDK to display a copy of the vSphere
Client inventory panel.
For more on the using the vShield Manager user interface, see the vShield Administration Guide.
vShield App
A vShield App monitors all traffic into and out of an ESX host, and between virtual machines on the host.
vShield App provides application-aware traffic analysis and stateful firewall protection. vShield App
regulates traffic based on a set of rules, similar to an access control list (ACL).
VMware, Inc.9
vShield API Programming Guide
As traffic passes through a vShield App, each session header is inspected to catalog the data. The vShield App
creates a profile for each virtual machine detailing the operating system, applications, and ports used in
network communication. Based on this information, the vShield App allows ephemeral port usage by
permitting dynamic protocols such as FTP and RPC to pass through, while maintaining lockdown on ports
1024 and higher.
You cannot protect the Service Console or VMkernel with a vShield App because these components are not
virtual machines.
vShield Edge
A vShield Edge provides network edge security to protect the virtual machines in a vCloud tenant’s network
from attacks originating from the public network. The vShield Edge connects the isolated, private networks of
cloud tenants to the public side of the service provider network through common edge services such as DHCP,
VPN, NAT, and load balancing.
You install a vShield Edge from the vShield Manager. You can install one vShield Edge instance per tenant port
group on a vNetwork Distributed Switch (vDS).
You configure a vShield Edge by using REST API.
vShield Endpoint
vShield Endpoint delivers an introspection-based antivirus solution. vShield Endpoint uses the hypervisor to
scan guest virtual machines from the outside without a bulky agent. vShield Endpoint is efficient in avoiding
resource bottlenecks while optimizing memory use.
Ports Required for vShield
The vShield Manager requires ports 80/TCP and 443/TCP for REST API requests.
An Introduction to REST API for vShield Users
REST, an acronym for Representational State Transfer, is a term that has been widely employed to describe an
architectural style characteristic of programs that rely on the inherent properties of hypermedia to create and
modify the state of an object that is accessible at a URL.
How REST Works
Once a URL of such an object is known to a client, the client can use an HTTP GET request to discover the
properties of the object. These properties are typically communicated in a structured document with an HTTP
Content-Type of XML or JSON, that provides a representation of the state of the object. In a RESTful workflow,
documents (representations of object state) are passed back and forth (transferred) between a client and a
service with the explicit assumption that neither party need know anything about an entity other than what is
presented in a single request or response. The URLs at which these documents are available are often “sticky,”
in that they persist beyond the lifetime of the request or response that includes them. The other content of the
documents is nominally valid until the expiration date noted in the HTTP Expires header.
10VMware, Inc.
Chapter 1 Overview of VMware vShield
Using the vShield REST API
I
MPORTANTAll vShield REST requests require authorization. You can use the following basic authorization:
Authorization: Basic YWRtaW46ZGVmYXVsdA==
YWRtaW46ZGVmYXVsdA== represents the Base 64 encoding of the vShield Manager default login credentials
(admin:default).
REST API uses HTTP requests (which are often executed by a script or other higher-level language) as a way
of making what are essentially idempotent remote procedure calls that create, modify, or delete the objects
defined by the API. This REST API (and others) is defined by a collection of XML documents that represent
the objects on which the API operates. The operations themselves (HTTP requests) are generic to all HTTP
clients.
To write a RESTful client, you need to understand only the HTTP protocol and the semantics of standard
HTML markup. To use the vShield API effectively in such a client, you need to know three things:
the set of objects that the API supports, and what they represent (What is a vDC? How does it relate to an
Org?)
how the API represents these objects (What does the XML schema for the vShield Edge firewall rule set
look like? What do the individual elements and attributes represent?)
how the client refers to an object on which it wants to operate
To answer these questions, you need to understand the vShield API resource schemas. These schemas define
a number of XML types, many of which are extended by other types. The XML elements defined in these
schemas, along with their attributes and composition rules (minimum and maximum number of elements or
attributes, for example, or the prescribed hierarchy with which elements can be nested) represent the data
structures of vShield objects. A client can “read” an object by making an HTTP GET request to the object’s
resource URL. A client can “write” (create or modify) an object with an HTTP PUT or POST request that
includes a new or changed XML body document for the object. And a client can usually delete an object with
an HTTP DELETE request.
In this document, we present example requests and responses, and also provide reference information on the
XML schemas that define the request and response bodies.
RESTful Workflow Patterns
All RESTful workflows fall into a pattern that includes only two fundamental operations:
Make an HTTP request (typically GET, PUT, POST, or DELETE). The target of this request is either a
well-known URL (such as the vShield Manager) or a link obtained from the response to a previous
request. (For example, a GET request to an Org URL returns links to vDC objects contained by the Org.)
Examine the response, which can be an XML document or an HTTP response code. If the response is an
XML document, it may contain links or other information about the state of an object. If the response is
an HTTP response code, it indicates whether the request succeeded or failed, and may be accompanied
by a URL that points to a location from which additional information can be retrieved.
These two operations can repeat, in this order, for as long as necessary.
VMware, Inc.11
vShield API Programming Guide
For More Information About REST
For a comprehensive discussion of REST from both the client and server perspectives, see:
Richardson, Leonard, and Sam Ruby. RESTful Web Services. North Mankato: O'Reilly Media, Inc., 2007.
There are also many sources of information about REST on the Web, including:
The vShield Manager requires communication with your vCenter Server and services such as DNS and NTP
to provide details on your VMware Infrastructure inventory.
IMPORTANT All vShield REST requests require authorization. You can use the following basic authorization:
Authorization: Basic YWRtaW46ZGVmYXVsdA==
YWRtaW46ZGVmYXVsdA== represents the Base 64 encoding of the vShield Manager default login credentials
(admin:default).
The chapter includes the following topics:
“Synchronize the vShield Manager with vCenter Server and DNS” on page 13
“Retrieving Tech Support Logs” on page 14
Synchronize the vShield Manager with vCenter Server and DNS
You can use a single request to synchronize the vShield Manager with the vCenter Server and add DNS servers
to the vShield Manager for IP address and hostname resolution. Synchronizing with vCenter Server enables
the vShield Manager user interface to display your VMware Infrastructure inventory.
2
Synchronization with vCenter requires the vCenter URL and login credentials.
For the schema, see “vShield Manager to vCenter Server Synchronization Schema” on page 65.
For the DNS schema, see “DNS Service Schema” on page 66.
Example 2-1. Synchronizing the vShield Manager with vCenter Server and Identify DNS Services
Request:
POST <vshield_manager-uri>/api/1.0/global/config
You can also synchronize the vShield Manager with the vCenter Server without specifying DNS.
Example 2-2. Synchronizing the vShield Manager with vCenter Server without DNS
Request:
POST <vshield_manager-uri>/api/1.0/global/vcInfo
VMware, Inc.13
vShield API Programming Guide
Retrieving Tech Support Logs
You can retrieve Technical Support logs from the vShield Manager and vShield Edge.
Get the vShield Manager Technical Support Log File Path
You can get the path to the diagnostic log file for the vShield Manager. You can then send the diagnostic log to
technical support for assistance in troubleshooting an issue.
Example 2-3. Getting the Tech Support Log File Path for a vShield Manager
Request:
GET <vshield_manager-uri>/api/1.0/global/techSupportLogs
Get the vShield Edge Technical Support Log File Path
You can download the diagnostic log from a vShield Edge. You can then send the diagnostic log to technical
support for assistance in troubleshooting an issue.
Example 2-4. Getting the Tech Support Log File Path for a vShield Edge
Request:
GET <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/techSupportLogs
14VMware, Inc.
3
ESX Host Preparation for vShield
App, Endpoint, and Isolation
You can extend the capabilities of vShield by adding the following services: vShield App, vShield Endpoint,
and vShield Edge. You must prepare each ESX host in your environment for these services. The vShield
Manager OVA file contains the drivers and files necessary to install all additional services.
IMPORTANT All vShield REST requests require authorization. You can use the following basic authorization:
Authorization: Basic YWRtaW46ZGVmYXVsdA==
YWRtaW46ZGVmYXVsdA== represents the Base 64 encoding of the vShield Manager default login credentials
(admin:default).
This chapter includes the following topics:
“Install vShield App, vShield Endpoint, and Port Group Isolation Services on an ESX Host” on page 15
“Get the Installation Status of vShield Services on an ESX Host” on page 17
“Uninstalling vShield Services from an ESX Host” on page 18
Install the Licenses for vShield Edge, vShield App, and vShield
Endpoint
3
You must install licenses for vShield Edge, vShield App, and vShield Endpoint before installing these
components. You can install these licenses by using the vSphere Client.
1From a vSphere Client host that is connected to a vCenter Server system, select Home > Licensing.
2For the report view, select Asset.
3Right-click a vShield asset and select Change license key.
4Select Assign a new license key and click Enter Key.
5Enter the license key, enter an optional label for the key, and click OK.
6Click OK.
7Repeat these steps for each vShield component for which you have a license.
Install vShield App, vShield Endpoint, and Port Group Isolation
Services on an ESX Host
To shorten the time to deployment, you can install vShield App, vShield Endpoint, and Port Group Isolation
services on an ESX host by using a single REST call. You can do this by including VszInstallParams, PortgroupIsolationInstallParams, and EpsecInstallParams in the POST body.
VMware, Inc.15
vShield API Programming Guide
Port Group Isolation is a service used by a vShield Edge to isolate the virtual machines in a vDS port group
from the external network. When Port Group Isolation is enabled, traffic is not allowed access to the virtual
machines in the protected port group unless NAT rules or VLAN tags are configured.
NOTE Port Group Isolation is an optional feature that is not required for vShield Edge operation. Port Group
Isolation is available for vDS-based vShield Edge installations only.
You must specify the host ID of the target ESX host to install all services.
See “ESX Host Preparation and Uninstallation Schema” on page 68.
Example 3-1. Installing a vShield App, vShield Endpoint, and Port Group Isolation on an ESX Host
Request:
POST <vshield_manager-uri>/api/1.0/vshield/<host-id>
ESX host preparation requires the following elements:
DatastoreId: VC MOID of the datastore on which the vShield App and Port Group Isolation service
virtual machine files will be stored.
ManagementPortSwitchId: VC MOID of the port group that will host the management port of the
vShield App.
MgmtInterface
IpAddress: IP address to be assigned to the management port of the vShield App. This IP address
must be able to communicate with the vShield Manager.
NetworkMask: Subnet mask associated with the IP address assigned to the management interface of
the vShield App.
DefaultGw: IP address of the default gateway.
16VMware, Inc.
Chapter 3 ESX Host Preparation for vShield App, Endpoint, and Isolation
After installation of all components is complete, do the following:
vShield App: At this point, vShield App installation is complete. Each vShield App inherits global
firewall rules set in the vShield Manager. The default firewall rule set allows all traffic to pass. You must
configure blocking rules to explicitly block traffic. To configure App Firewall rules, see “Configuring
Firewall Rules for a vCenter Container” on page 51.
Port Group Isolation: You must enable the Port Group Isolation feature on each vDS. After enablement
is complete, install a vShield Edge on each port group. See “vNetwork Preparation and vShield Edge
Installation” on page 19.
vShield Endpoint: To complete installation, see “vShield Endpoint Management” on page 61.
You can install a single service by identifying only that service in the POST body. In Example 3-2, only vShield
App is installed, as identified by inclusion of the VszInstallParams element only.
Example 3-2. Installing a vShield App Only
Request:
POST <vshield_manager-uri>/api/1.0/vshield/<host-id>/vsz
Get the Installation Status of vShield Services on an ESX Host
You can retrieve the installation or uninstallation status of vShield services on an ESX host to track progress as
complete or not initiated. If neither of these operations is in progress, the response includes the list of installed
services on the ESX host.
Example 3-3. Getting vShield Service Installation Status on an ESX Host
Request:
GET <vshield_manager-uri>/api/1.0/vshield/<host-id>
VMware, Inc.17
vShield API Programming Guide
Uninstalling vShield Services from an ESX Host
You can uninstall vShield App, vShield Endpoint, and Port Group Isolation from an ESX host by using a single
request.
Before uninstalling these services, complete the following tasks:
vShield Endpoint: You must unregister SVMs before uninstalling vShield Endpoint from the ESX host. See
“Unregister an SVM from vShield Endpoint” on page 63.
Port Group Isolation: You must disable Port Group Isolation before uninstalling the service. See “Disable
Port Group Isolation on a vDS” on page 20.
CAUTION Uninstalling any of these vShield services places the ESX host in maintenance mode. After
uninstallation is complete, the ESX host reboots. If any of the virtual machines that are running on the target
ESX host cannot be migrated to another ESX host, these virtual machines must be powered off or migrated
manually before the uninstallation can continue. If the vShield Manager is on the same ESX host, the vShield
Manager must be migrated prior to uninstalling the vShield App.
Before uninstalling Port Group Isolation, disable the service on the host vDS. See “Disable Port Group Isolation
on a vDS” on page 20.
Example 3-4. Uninstalling All Three vShield Services from an ESX Host
vNetwork Preparation and vShield
Edge Installation
After ESX host preparation is complete, you can secure internal networks by installing a vShield Edge. If you
are installing vShield Edge instances on vDS port groups, you can isolate those port groups by enabling Port
Group Isolation on each vDS.
IMPORTANT If you intend to use the Port Group Isolation feature, you should install Port Group Isolation on
all ESX hosts in your vCenter environment before you install any vShield Edge virtual machines. If you do not
install Port Group Isolation and attempt to enable the feature during vShield Edge installation, Port Group
Isolation does not work. See “Install vShield App, vShield Endpoint, and Port Group Isolation Services on an
ESX Host” on page 15.
I
MPORTANTAll vShield REST requests require authorization. You can use the following basic authorization:
Authorization: Basic YWRtaW46ZGVmYXVsdA==
YWRtaW46ZGVmYXVsdA== represents the Base 64 encoding of the vShield Manager default login credentials
(admin:default).
This chapter includes the following topics:
“Enabling Port Group Isolation” on page 19
4
“Installing a vShield Edge” on page 21
Enabling Port Group Isolation
Port Group Isolation creates a barrier between the virtual machines protected by a vShield Edge and the
external network. When you enable Port Group Isolation and install a vShield Edge on a vDS port group, you
isolate each secured vDS port group from the external network. When Port Group Isolation is enabled, traffic
is not allowed access to the virtual machines in the secured port group unless NAT rules or VLAN tags are
configured
NOTE Port Group Isolation is an optional feature that is not required for vShield Edge operation. Port Group
Isolation is available for vDS-based vShield Edge installations only.
To enable Port Group Isolation on a vDS
1Enable Port Group Isolation on each vDS.
2Install a vShield Edge on each vDS port group you plan to secure.
3Move the virtual machines to secured vDS port groups.
VMware, Inc.19
vShield API Programming Guide
Enable Port Group Isolation on a vDS
After Port Group Isolation is installed on each ESX host, you must enable Port Group Isolation on each vDS
where you will install a vShield Edge.
Example 4-1. Enabling Port Group Isolation on a vDS
Request:
PUT <vshield_manager-uri>/api/1.0/network/portgroupIsolation/dvs/<dvs-Moid>
Get the Port Group Isolation Debug Statistics from an ESX Host
You can retrieve the statistics on Port Group Isolation activity from an ESX host for debug purposes.
The query returns XML with the path of the location of the statistics file on the vShield Manager. This path can
be used to download the file over HTTP.
See “Port Group Isolation Statistics Schema” on page 71.
Example 4-2. Getting the Port Group Isolation Debug Statistics from an ESX Host
Request:
GET <vshield_manager-uri>/api/1.0/network/portgroupIsolation/<host-Id>/statsLocation
Disable Port Group Isolation on a vDS
Before uninstalling Port Group Isolation, disable the service on the host vDS.
Example 4-3. Disabling Port Group Isolation on a vDS
You can install one vShield Edge per port group, vDS port group, or Cisco® Nexus 1000V. A vShield Edge
requires an external port group with a physical NIC and an internal port group that contains the virtual
machines to be secured. The vShield Edge sits inline between these port groups. If an internal port group does
not exist, you must create this port group before installing a vShield Edge.
The vShield Edge installation API copies the vShield Edge OVF from the vShield Manager to the specified
datastore and deploys a vShield Edge on the given port group. After the vShield Edge is installed, the virtual
machine powers on and initializes according to the given network configuration.
Installing a vShield Edge instance adds a virtual machine to the vCenter Server inventory, which is mirrored
in the vShield Manager user interface. You must name the vShield Edge instance and specify an IP address for
the management interface.
For the schema, see “vShield Edge Installation and Upgrade Schema” on page 72.
Example 4-4. Installing a vShield Edge
Request:
POST <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/vshieldedge
Example 4-5. Getting the Install Parameters of a vShield Edge
Request:
GET <vshield_manager-uri>/network/<internal-portgroup-vc-moref-id>/vshieldedge
Example:
GET /api/1.0/network/network-244/vshieldedge HTTP/1.1
Authorization: Basic YWRtaW46ZGVmYXVsdA==
Host: 10.112.196.169:9998
Uninstall a vShield Edge
CAUTION If you have enabled Port Group Isolation, you must migrate or power off the virtual machines on
the ESX host from which you want to uninstall a vShield Edge. Uninstalling Port Group Isolation places the
ESX host in maintenance mode. After uninstallation is complete, the ESX host reboots. If any of the virtual
machines that are running on the target ESX host cannot be migrated to another ESX host, these virtual
machines must be powered off or migrated manually before the uninstallation can continue. If the vShield
Manager is on the same ESX host, the vShield Manager must be migrated prior to uninstalling Port Group
Isolation.
If you did not install and enable Port Group Isolation on an ESX host, you do not have to migrate virtual
machines to uninstall a vShield Edge.
You can manage vShield Edge services and firewall policies by using REST API. By using REST call, you can
start or stop services, post and delete configurations, and get service status.
For each service, you can enable logging to view debug and audit messages. You must identify a syslog server
to receive the logs.
IMPORTANT All vShield REST requests require authorization. You can use the following basic authorization:
Authorization: Basic YWRtaW46ZGVmYXVsdA==
YWRtaW46ZGVmYXVsdA== represents the Base 64 encoding of the vShield Manager default login credentials
(admin:default).
This chapter includes the following topics:
“Upgrading a vShield Edge” on page 24
“Force a vShield Edge to Synchronize with the vShield Manager” on page 24
“Manage CLI Credentials on a vShield Edge” on page 25
“Managing DHCP” on page 25
5
“Managing NAT” on page 28
“Configuring the vShield Edge Firewall” on page 33
“Configuring VPNs” on page 37
“Load Balancer” on page 43
“Managing the MTU Threshold for a vShield Edge” on page 46
“View Traffic Statistics” on page 47
“Debug vShield Edge Services Using Service Statistics” on page 47
“Managing the Connection to a Syslog Server” on page 47
VMware, Inc.23
vShield API Programming Guide
Upgrading a vShield Edge
You can upgrade a vShield Edge via REST API when a new software version is available.
For the schema, see “vShield Edge Installation and Upgrade Schema” on page 72.
Example 5-1. Upgrading vShield Edge Software
Request:
PUT <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/vshieldedge/update
Force a vShield Edge to Synchronize with the vShield Manager
If the configuration of a vShield Edge is out of sync with what shows in the vShield Manager user interface,
you can force the vShield Manager to push the latest configuration to a vShield Edge.
Example 5-3. Forcing a vShield Edge to Sync with the vShield Manager
Request:
PUT <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/action/forcesync
Example:
PUT /api/1.0/network/network-244/action/forcesync HTTP/1.1
Authorization: Basic YWRtaW46ZGVmYXVsdA==
Host: localhost
24VMware, Inc.
Manage CLI Credentials on a vShield Edge
You can set and change login credentials for the CLI on a vShield Edge virtual appliance via REST.
You can change the default CLI login credentials (username admin and password default) on a vShield Edge
via REST.
You can use lower-case letters, numbers, and underscores in the CLI username. The username must start with
a letter and be between 1 and 33 characters in length. The password cannot have spaces and must be at least 1
character in length.
For the schema, see “vShield Edge CLI Login Credentials Schema” on page 74.
Example 5-4. Managing CLI Credentials on a vShield Edge
Request:
PUT <vshield_manager-uri>/api/1.0/network/<vdc-moref-id>/cli/credentials
Managing DHCP
vShield Edge provides DHCP service to bind assigned IP addresses to MAC addresses, preventing MAC
spoofing attacks. All virtual machines protected by a vShield Edge can obtain IP addresses dynamically from
the vShield Edge DHCP service.
Chapter 5 vShield Edge Management
vShield Edge supports IP address pooling and one-to-one static IP address allocation based on the vCenter
managed object ID (vmid) and interface ID (interfaceId) of the requesting client.
vShield Edge DHCP service adheres to the following rules:
Listens on the vShield Edge internal interface (InternalInterface) for DHCP discovery.
Uses the IP address of the internal interface on the vShield Edge as the default gateway address for all
clients, and the broadcast and subnetMask values of the internal interface for the container network.
All DHCP settings configured by using REST requests appear under the vShield Edge > DHCP tab for the
appropriate vShield Edge in the vShield Manager user interface and vSphere Client plug-in.
For the DHCP schema, see “DHCP Schema” on page 79.
Get the DHCP Server Status
Example 5-5. Getting the Status of the DHCP Service on a vShield Edge
Request:
GET <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/dhcp/service
Example:
GET /api/1.0/network/network-244/dhcp/service HTTP/1.1
Authorization: Basic YWRtaW46ZGVmYXVsdA==
Host: 10.112.196.213
Start, Stop, or Restart the DHCP Service
Example 5-6. Starting or Stopping the DHCP Service on a vShield Edge
Request:
PUT <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/dhcp/action/
{start | stop | restart}
VMware, Inc.25
vShield API Programming Guide
Example:
PUT /api/1.0/network/network-244/dhcp/action/start HTTP/1.1
Authorization: Basic YWRtaW46ZGVmYXVsdA==
Host: 10.112.196.213
Post a DHCP Configuration
You can add hosts and IP pools for DHCP service on a vShield Edge, The vShield Edge can allocate IP
addresses to protected virtual machines from configured IP pools.
The vShield Manager processes the posted XML file as a complete configuration for the specific vShield Edge.
The current configuration is replaced with this new configuration.
If you do not specify a value for the <leaseTime/> parameter, the default value of one day is used. A value of
infinite is supported.
Example 5-7. Adding IP Pool Ranges to a vShield Edge
Request:
POST <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/dhcp/config
Rules:
DHCPConfigParams and its elements are optional
leaseTime can be infinite or number of seconds. If not specified, the default lease time is 1 day.
Logging is disabled by default. To enable logging, add a <log /> element within <DHCPConfig />.
The vShield Edge provides network address translation (NAT) service to protect the IP addresses of internal,
private networks from the public network. You can configure NAT rules to provide access to services running
on privately addressed virtual machines. The NAT service configuration is separated into SNAT (Secure
Network Address Translation) and DNAT (Destination Network Address Translation) rules.
All SNAT and DNAT rules configured by using REST requests appear under the vShield Edge > NAT tab for
the appropriate vShield Edge in the vShield Manager user interface and vSphere Client plug-in.
For the NAT schema, see “NAT Schema” on page 77.
Managing SNAT Rules
The vShield Edge uses SNAT to map internal addresses to allocated public addresses. If you use Port Group
Isolation, you must configure SNAT rules to allow traffic from the internal network to the external network.
Get the SNAT Rule Set
Example 5-13. Get the SNAT rule set on a vShield Edge
Request:
GET <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/snat/rules
Example:
GET /api/1.0/network/network-244/snat/rules HTTP/1.1
Authorization: Basic YWRtaW46ZGVmYXVsdA==
Host: localhost
Post an SNAT Rule Set
You can post an SNAT rule set for a vShield Edge via REST. The vShield Manager processes the posted XML
file as a complete rule set for the specific vShield Edge. The current rule set is replaced with this new set of
rules.
Example 5-14. Post an SNAT Rule Set on a vShield Edge
Request:
POST <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/snat/rules
DNAT maps public addresses to internal addresses. If you use Port Group Isolation, you must configure
DNAT rules to allow traffic from the external network to the internal network.
The vShield Edge supports two forms of DNAT:
Traffic targeting a public address is forwarded to an internal host with the given internal IP address.
Traffic targeting a specific port of a public address is forwarded to an internal host with the given internal
IP address on the specified port.
Get the DNAT Rule Set
Example 5-19. Get the DNAT Rule Set on a vShield Edge
Request:
GET <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/dnat/rules
30VMware, Inc.
Chapter 5 vShield Edge Management
Example:
GET /api/1.0/network/network-244/dnat/rules HTTP/1.1
Authorization: Basic YWRtaW46ZGVmYXVsdA==
Host: localhost
Post a DNAT Rule Set
You can post a DNAT rule set for a vShield Edge.
The vShield Manager processes the posted XML file as a complete rule set for the specific vShield Edge. The
current rule set is replaced with this new set of rules.
Example 5-20. Post a DNAT Rule Set on a vShield Edge
Request:
POST <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/dnat/rules
The vShield Edge provides firewall protection for incoming and outgoing sessions. The default firewall policy
allows all traffic to pass. In addition to the default firewall policy, you can configure a set of rules to allow or
deny traffic sessions to and from specific sources and destinations. You manage the default firewall policy and
firewall rule set separately for each vShield Edge agent.
All firewall rules for a vShield Edge configured by using REST requests appear under the vShield Edge > Firewall tab for the appropriate vShield Edge in the vShield Manager user interface and vSphere Client plug-in.
For the vShield Edge firewall schema, see “vShield Edge Firewall Schema” on page 74.
Get the Firewall Rule Set for a vShield Edge
Example 5-25. Get the Entire Firewall Rule Set on a vShield Edge
Request:
GET <vShield_Manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/firewall/rules
VMware, Inc.33
vShield API Programming Guide
Example:
GET /api/1.0/network/network-244/firewall/rules HTTP/1.1
Authorization: Basic YWRtaW46ZGVmYXVsdA==
Host: 10.112.196.213
Post a Firewall Rule Set
You add all firewall rules as a set for each vShield Edge. The vShield Manager processes the posted XML file
as a complete rule set for the specified vShield Edge. The new rule set replaces the entire previous rule set.
Example 5-26. Post the Firewall Rule Set on a vShield Edge
Request:
POST <vShield_Manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/firewall/rules
vShield Edge agents support site-to-site IPSec VPN between a vShield Edge appliance and remote sites. On
both ends, static one-to-one NAT is required for the VPN address.
Figure 5-1. vShield Edge Providing VPN Access from a Remote Site to a Secured Port Group
Chapter 5 vShield Edge Management
At this time, vShield Edge agents support pre-shared key mode, IP unicast traffic, and no dynamic routing
protocol between the vShield Edge and remote VPN routers. Behind each remote VPN router, you can
configure multiple subnets to connect to the internal network behind a vShield Edge through IPSec tunnels.
These subnets and the internal network behind a vShield Edge must have non-overlapping address ranges.
You can deploy a vShield Edge agent behind a NAT device. In this deployment, the NAT device translates the
vShield Edge agent’s VPN address into a public accessible address facing the Internet; remote VPN routers use
this public address to access the vShield Edge.
Remote VPN routers can be located behind a NAT device as well. You must provide both the VPN native
address and the NAT public address to set up the tunnel.
All VPN settings configured by using REST requests appear under the vShield Edge > VPN tab for the
appropriate vShield Edge in the vShield Manager user interface and vSphere Client plug-in.
For the VPN schema, see “VPN Schema” on page 80.
VMware, Inc.37
vShield API Programming Guide
Get the Status of VPN Service
You can determine if the VPN service on a vShield Edge is running or stopped by requesting the service status.
Example 5-34. Getting the Status of VPN Service
Request:
GET <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/vpn/ipsec/service
Example:
GET /api/1.0/network/network-244/vpn/ipsec/service HTTP/1.1
Authorization: Basic YWRtaW46ZGVmYXVsdA==
Host: localhost:9998
Start or Stop the VPN Service on a vShield Edge
You enable or disable VPN service on a vShield Edge by updating the status to start or stop.
Example 5-35. Starting or Stopping VPN Service on a vShield Edge
Request:
PUT <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/
vpn/ipsec/action/{start | stop}
Example:
PUT /api/1.0/network/network-244/vpn/ipsec/action/start HTTP/1.1
Authorization: Basic YWRtaW46ZGVmYXVsdA==
Host: localhost:9998
PUT /api/1.0/network/network-244/vpn/ipsec/action/stop HTTP/1.1
Authorization: Basic YWRtaW46ZGVmYXVsdA==
Host: locahost
Configure VPN Parameters on a vShield Edge
You can provide configuration parameters on a vShield Edge agent to set a VPN tunnel to a remote VPN
router. The first time you configure VPN service for a vShield Edge, the configuration must contain the server
configuration and a minimum of one remote site with a tunnel. If these elements are not sent, the configuration
is rejected.
The IPSec parameters must be compatible on all IPSec end points.
Example 5-36. Configuring VPN Parameters
Request:
POST <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/vpn/ipsec/config
Rules:
Logging is disabled by default. To enable logging, add a <log /> element within <VPNServerConfig />.
VPN service requires encryption. You must specify the <encryptionAlgorithm /> element as either
3des or aes.
The natedPublicIpAddress element under VPNServerConfig is optional.
The siteName and tunnelName can contain only alphanumeric characters.
Get the Detailed IPSec Configurations for a Network
You can retrieve a detailed VPN configuration for a network that contains the VPN server configurations, site
configurations, tunnel configurations, and the detailed configuration of all tunnels in all sites.
Example 5-39. Getting the Detailed VPN Configuration for a Network
Request:
GET <vshield_manager-uri>/api/1.0/network/<vdc-moref-id>/vpn/ipsec/detailedconfig
Example:
GET /api/1.0/network/dvportgroup-1004/vpn/ipsec/detailedconfig HTTP/1.1
Host: localhost:9998
authorization: Basic YWRtaW46ZGVmYXVsdA==
40VMware, Inc.
Chapter 5 vShield Edge Management
Get the Detailed Configuration for a VPN Site
You can retrieve a detailed VPN configuration for a site that contains the VPN server configuration, site
configuration, tunnel configuration, and the detailed configuration of all tunnels for the site.
Example 5-40. Getting the Detailed Configuration for a VPN Site
Request:
GET <vshield_manager-uri>/api/1.0/network/<vdc-moref-id>/vpn/ipsec/<site-name>/detailedconfig
Example:
GET /api/1.0/network/resgroup-v107/vpn/ipsec/site01/detailedconfig HTTP/1.1
Host: localhost:9998
authorization: Basic YWRtaW46ZGVmYXVsdA==
Get the Detailed Tunnel Configuration
You can request the list of tunnels configured for a VPN site.
Example 5-41. Getting the Detailed Tunnel Configuration for a Site
Request:
GET <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/
Get the Current VPN Configuration on a vShield Edge
You can retrieve the current VPN configuration on a vShield Edge to view settings such as tunnels and sites,
as well as entity naming and addressing.
Example 5-44. Getting the Current VPN Configuration
Request:
GET <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/vpn/ipsec/config
VMware, Inc.41
vShield API Programming Guide
Example:
GET /api/1.0/network/network-244/vpn/ipsec/config HTTP/1.1
Authorization: Basic YWRtaW46ZGVmYXVsdA==
Host: localhost:9998
Get Timestamps of Last 10 VPN Configurations
You can retrieve a list of the last 10 VPN configuration changes. You can use the returned timestamps to review
the details of past configurations in a separate request.
Example 5-45. Getting Last 10 VPN Configurations by Timestamp
Request:
GET <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/vpn/snapshots
Get a VPN Configuration by Timestamp
You can retrieve and view a specific historical VPN configuration by specifying the timestamp when the
configuration was overwritten.
Example 5-46. Getting a VPN Configuration by Timestamp
Request
GET <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/
vpn/snapshot/<snapshot-timestamp>
Revert to a VPN Configuration by Timestamp
You can revert to a previous VPN configuration by specifying the timestamp of the previous configuration.
Example 5-47. Reverting to a VPN configuration by timestamp
Request:
PUT <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/
vpn/snapshot/<snapshot-timestamp>
Delete the VPN Configuration on a vShield Edge
You can delete the current VPN configuration to clear VPN settings from the vShield Edge running
configuration. The vShield Edge saves the deleted configuration by marking it with a timestamp.
Example 5-48. Deleting the VPN Configuration on a vShield Edge
The vShield Edge provides load balancing for HTTP traffic. Load balancing (up to Layer 7) enables Web
application auto-scaling.
Figure 5-2. vShield Edge Providing Load Balancing Service for Protected Virtual Machines
Chapter 5 vShield Edge Management
You map an external (or public) IP address to a set of internal servers for load balancing. The load balancer
accepts HTTP requests on the external IP address and decides which internal server to use. Port 80 is the
default listening port for load balancer service.
All Load Balancer settings configured by using REST requests appear under the vShield Edge > Load Balancer
tab for the appropriate vShield Edge in the vShield Manager user interface and vSphere Client plug-in.
For the load balancer schema, see “Load Balancer Schema” on page 83.
Get the Status of Load Balancer Service on a vShield Edge
Example 5-49. Getting the Status of Load Balancer Service on a vShield Edge
Request:
GET <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/
loadbalancer/service
Example:
GET /api/1.0/network/network-244/loadbalancer/service HTTP/1.1
Authorization: Basic YWRtaW46ZGVmYXVsdA==
Host: localhost:9998
VMware, Inc.43
vShield API Programming Guide
Start or Stop the Load Balancer Service on a vShield Edge
Example 5-50. Starting or Stopping the Load Balancer Service on a vShield Edge
Request:
PUT <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/
loadbalancer/action/{start | stop}
Example:
PUT /api/1.0/network/network-244/loadbalancer/action/start HTTP/1.1
Authorization: Basic YWRtaW46ZGVmYXVsdA==
Host: localhost:9998
Add a Listener for Load Balancing Service
You can map a global or public IP address with a set of internal servers for load balancing. The load balancer
accepts HTTP requests on this IP address. The internalIPlist is a comma-separated list of one or more
IP:Port instances that represents servers that can be used for load balancing. If a port is not specified, port 80
is the default port. The vShield Manager processes the posted XML file as a complete set of load balancing
servers for the specific network. The current set of load balancing servers for a network is replaced with this
new set of servers.
You can add multiple servers as listeners by entering multiple <Listener /> sections in the body.
You can configure the algorithm that is used to determine load balancing. The optional <algorithm />
element can be set to round-robin or ip-hash. By default, the load balancer algorithm is set to round-robin.
Example 5-51. Adding a Load Balancer Listener on a vShield Edge
Request:
POST <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/loadbalancer/
Rules:
Logging is disabled by default. To enable logging, add a <log /> element within <Listener />.
The backendServersinternalIPList element is a comma separated IP list. Port 80 is used by default.
You can specify custom IP:Port values in the internalIPList.
Example:
Basic load balancer configuration
POST /api/1.0/network/network-244/loadbalancer HTTP/1.1
Get the Current Load Balancer Configuration on a vShield Edge
You can retrieve the current Load Balancer configuration on a vShi eld Ed ge to v iew se tting s such as con figur ed
listeners.
Example 5-52. Getting All Load Balancer Servers on a vShield Edge
Request:
GET <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/loadbalancer
Example:
GET /api/1.0/network/network-244/loadbalancer HTTP/1.1
Authorization: Basic YWRtaW46ZGVmYXVsdA==
Host: localhost:80
Get the Configuration of a Specific Load Balancing Server
You can retrieve the current configuration of a single Load Balancer listener on a vShield Edge.
Example 5-53. Getting the Configuration of a Specific Load Balancing Server
Request:
GET <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/
loadbalancer/<loadbalancer-id>
Example:
GET /api/1.0/network/network-244/loadbalancer/3 HTTP/1.1
Authorization: Basic YWRtaW46ZGVmYXVsdA==
Host: localhost:80
Get Timestamps of Last 10 Load Balancer Configurations
You can retrieve a list of the last 10 Load Balancer configuration changes. You can use the returned timestamps
to review the details of past configurations in a separate request.
Example 5-54. Getting the Last 10 Load Balancer Configurations by Timestamp
Request:
GET <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/
loadbalancer/snapshots
VMware, Inc.45
vShield API Programming Guide
Get a Load Balancer Configuration by Timestamp
You can retrieve and view a specific historical Load Balancer configuration by specifying the timestamp when
the configuration was overwritten.
Example 5-55. Getting Load Balancer Configuration by Timestamp
Request:
GET <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/
loadbalancer/snapshot/<snapshot-timestamp>
Revert to a Load Balancer Configuration by Timestamp
You can revert to a previous Load Balancer configuration by specifying the timestamp of the previous
configuration.
Example 5-56. Reverting to a Previous Load Balancer Configuration by Timestamp
Request:
PUT <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/
loadbalancer/snapshot/<snapshot-timestamp>
Delete the Load Balancer Configuration on a vShield Edge
Example 5-57. Deleting the Load Balancer Configuration on a vShield Edge
Each vShield Edge agent offers a collection service for traffic statistics. Traffic statistics provide information on
the sessions in and out of your network.
For the traffic statistics schema, see “Traffic Stats Schema” on page 85.
Example 5-60. Getting Traffic Statistics for a vShield Edge
Request:
GET <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/trafficstats/all
Example:
Chapter 5 vShield Edge Management
GET /api/1.0/network/network-244/trafficstats/all HTTP/1.1
Authorization: Basic YWRtaW46ZGVmYXVsdA==
Host: localhost
Debug vShield Edge Services Using Service Statistics
You can retrieve the path to the service statistics file of a vShield Edge and use the statistics to debug service
issues.
Example 5-61. Debugging a vShield Edge by Using Service Statistics
Request:
GET <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/serviceStats
Response:
XML with path of vShield Edge service statistics file which can be downloaded over http
Managing the Connection to a Syslog Server
You can connect a vShield Edge to a syslog server for vShield Edge log management.
For the traffic statistics schema, see “Syslog Schema” on page 85.
Post a Syslog Server Configuration
Example 5-62. Posting a Syslog Server Configuration
Request:
POST <vshield_manager-uri>/api/1.0/network/<internal-portgroup-vc-moref-id>/syslog/config
You can configure vShield App firewall rules and syslog service by using REST API calls.
IMPORTANT All vShield REST requests require authorization. You can use the following basic authorization:
Authorization: Basic YWRtaW46ZGVmYXVsdA==
YWRtaW46ZGVmYXVsdA== represents the Base 64 encoding of the vShield Manager default login credentials
(admin:default).
This chapter includes the following topics:
“Configuring Firewall Rules for a vCenter Container” on page 51
“Managing Security Groups” on page 56
“Configuring Syslog Service for a vShield App” on page 59
Configuring Firewall Rules for a vCenter Container
The primary function of a vShield App is to provide firewall protection on an ESX host by inspecting each
session and returning details to the vShield Manager. Traffic details include sources, destinations, direction of
sessions, applications, and ports being used. Traffic details can be used to create firewall allow or deny rules.
6
In the vShield Manager user interface or vSphere Client plug-in, the App Firewall tab contains the firewall
rules enforced by vShield App instances. You can manage App Firewall rules at the datacenter, cluster, and
port group levels to provide a consistent set of rules across multiple vShield App instances under these
containers. As membership in these containers can change dynamically, App Firewall maintains the state of
existing sessions without requiring reconfiguration of firewall rules. In this way, App Firewall effectively has
a continuous footprint on each ESX host under the managed containers.
When creating App Firewall rules, you can create general rules based on incoming or outgoing traffic at the
container level. For example, you can create a rule to deny any traffic from outside of a datacenter that targets a
destination within the datacenter. You can create a rule to deny any incoming traffic that is not tagged with a
VLAN ID.
All firewall rules configured by using REST requests appear under the App Firewall tab for the appropriate
container in the vShield Manager user interface and vSphere Client plug-in.
For the complete firewall XML schema, see “vShield App Firewall Schema” on page 70.
View All Firewall Rules for a Container
You can view all of the firewall rules for a specific container—datacenter, cluster, or port group—and any child
containers by identifying the MOREF ID (container-moref-id) of the container. For example, if you request
the rule set at the datacenter level, the response includes the rules for the clusters and port groups within that
datacenter.
It is good practice to view the current firewall rule set before posting new or updated rules.
VMware, Inc.51
vShield API Programming Guide
Example 6-1. Viewing the Firewall Rule Set for a Container
Request:
GET <vshield_manager-uri>/api/1.0/zones/<container-moref-id>/firewall/rules
Example:
GET /api/1.0/zones/datacenter-4361/firewall/rules HTTP/1.1
Host: localhost
Authorization: Basic YWRtaW46ZGVmYXVsdA==
Post an App Firewall Rule Set for a Container
You can add an App Firewall rule set via REST for a datacenter, cluster, or port group container.
The vShield Manager processes the posted XML file as a complete rule set for the specified container. The
current container rule set is replaced with this new set of rules.
If you add a new rule to an existing rule set, the new rule must be identified as Rule ID 0:
<RuleSet><Rule><ID>0</ID>...</Rule></RuleSet>. If you are updating an existing rule set, you must
use the same Rule IDs as the current rule set to maintain current rules after the new rule set is posted.
Example 6-2. Post a Firewall Rule Set at the Datacenter Level
Request:
POST <vshield_manager-uri>/api/1.0/zones/<container-moref-id>/firewall/rules
View a List of Timestamps Identifying App Firewall Rule Set Changes
You can view a list of timestamps marking firewall rule set changes for a specific container. To view the rule
set according to a specific timestamp, see “View a Previous Firewall Rule Set by Timestamp” on page 55.
Example 6-6. View a List of Firewall Rule Sets by Timestamps
Request:
GET <vshield_manager-uri>/api/1.0/zones/<container-moref-id>/firewall/snapshots
Example:
GET /api/1.0/zones/datacenter-4361/firewall/snapshots HTTP/1.1
Host: localhost
Authorization: Basic YWRtaW46ZGVmYXVsdA==
View a Previous Firewall Rule Set by Timestamp
You can view a historical rule set by its timestamp. To view the list of timestamps, see “View a List of
Timestamps Identifying App Firewall Rule Set Changes” on page 55.
Example 6-7. View a Firewall Rule Set by Timestamp
Request:
GET <vshield_manager-uri>/api/1.0/zones/<container-moref-id>/firewall/
snapshot/<snapshot-timestamp>
Example:
GET /api/1.0/zones/datacenter-4361/firewall/snapshot/1274872770000 HTTP/1.1
Host: localhost
Authorization: Basic YWRtaW46ZGVmYXVsdA==
Revert to a Previous Firewall Rule Set
You can revert to a previous firewall rule set by specifying the appropriate container and timestamp.
Example 6-8. Revert to a Previous Firewall Rule Set
Request:
PUT <vshield_manager-uri>/api/1.0/zones/<container-moref-id>/firewall/snapshot/<timestamp>
Example:
PUT /api/1.0/zones/datacenter-4361/firewall/snapshot/1274872770000 HTTP/1.1
Host: localhost
Authorization: Basic YWRtaW46ZGVmYXVsdA==
Delete All Firewall Rules under a Container
You can delete the entire rule set for a datacenter, cluster, or port group container. When you delete the firewall
rule set at the datacenter or cluster level, the system reverts to the default rules for that container and all child
containers. If you delete rules at the cluster or port group level, any rules set at the datacenter remain enforced.
Example 6-9. Delete a Firewall Rule Set for a Container
A security group is a trust zone that you create and assign resources to for vShield App firewall protection.
Security groups are containers, like a vApp or a cluster. Typically, containers are created in the vCenter and
viewed in the vShield Manager user interface.
Security groups enables you to create custom containers from within vShield. You arbitrarily assign resources,
such as virtual machines and network adapters, to a security group. After the group is defined, you add the
group to an vShield App firewall rule for protection. See “Configuring Firewall Rules for a vCenter Container”
on page 51.
All security groups configured by using REST requests appear under the Security Groups tab for the
appropriate node in the vShield Manager user interface and vSphere Client plug-in.
For the security groups schema, see “Security Groups Schema” on page 67.
Add a Security Group
Example 6-10. Adding a Security Group
Request:
POST <vshield_manager-uri>/api/1.0/global/securityGroups/<base-node-moref-id>/groups
Example:
Adding a single security group
POST /api/1.0/global/securityGroups/datacenter-7/groups/ HTTP/1.1
You can add a virtual machine to a Security Group by specifying the node in which the Security Group resides.
You use the vNIC identifier to identify the virtual machine. To get the <NIC-ID> parameter, see “Get the
Properties from a Virtual Machine” on page 58.
Example 6-12. Adding a Virtual Machine to a Security Group
Request:
POST <vshield_manager-uri>/api/1.0/global/securityGroups/<base-node-moref-id>/nodes/<nic-id>
Get the List of All Security Groups under a Base Node
Example 6-13. Getting the List of All Security Groups under a Base Node
Request:
GET <vshield_manager-uri>/api/1.0/global/securityGroups/<base-node-moref-id>/groups
Example:
GET /api/1.0/global/securityGroups/datacenter-7/groups HTTP/1.1
authorization: Basic YWRtaW46ZGVmYXVsdA==
host: 10.112.196.127
VMware, Inc.57
vShield API Programming Guide
Get the Details for a Single Security Group under a Base Node
Example 6-14. Getting the Details of a Single Security Group
Request:
GET <vshield_manager-uri>/api/1.0/global/securityGroups/<BASE-NODE-MOREF-ID>/
groups/<securityGroupId>
Example:
GET /api/1.0/global/securityGroups/datacenter-2/groups/secgroup-6 HTTP/1.1
authorization: Basic YWRtaW46ZGVmYXVsdA==
host: 10.112.196.127
Get IP Addresses for the Virtual Machines in a Security Group
You can get the IP addresses for the virtual machines within a Security Group.
Example 6-15. Getting the IP Addresses of Virtual Machines in a Security Group
Request:
GET <vshield_manager-uri>/api/1.0/global/securityGroups/<base-node-moref-id>/
groups/<securityGroupId>/ipList
Get the Properties from a Virtual Machine
You can get the properties of a virtual machine so that you can use the NIC-ID to add the virtual machine to a
Security Group. See “Add a Virtual Machine to a Security Group” on page 57.
See “Virtual Machine Information Schema” on page 66.
Example 6-16. Getting the Properties of a Virtual Machine
Request:
GET <vshield_manager-uri>/api/1.0/global/vmInfo/<vm-moref-id>
Example:
GET /api/1.0/global/vmInfo/vm-570 HTTP/1.1
authorization: Basic YWRtaW46ZGVmYXVsdA==
host: 10.112.196.127
Delete a Virtual Machine from a Security Group
You can delete a virtual machine from a Security Group by specifying the node in which it resides.
Example 6-17. Deleting a Virtual Machine from a Security Group
You can configure all vShield App instances to send system events to up to two syslog servers. All vShield App
instances share the same syslog server configuration.
This request returns the list of syslog servers configured on the first vShield App instance that responds.
Example 6-20. Get the Syslog Server Configuration for All vShield App Instances
Request:
GET <vshield_manager-uri>/api/1.0/zones/syslogServers
This request configures all vShield App instances connected to the vShield Manager to send events to the
specified syslog servers.
Example 6-21. Post the Syslog Server Configuration across All vShield App Instances
Request:
POST <vshield_manager-uri>/api/1.0/zones/syslogServers
VMware, Inc.59
vShield API Programming Guide
This request deletes the syslog server configuration across all vShield App instances connected to the vShield
Manager.
Example 6-22. Delete the Syslog Server Configuration across all vShield App Instances
The VMware Endpoint system delivers an introspection-based antivirus solution that uses the hypervisor to
scan guest virtual machines from the outside with only a thin agent on each guest virtual machine.
You installed the vShield Endpoint service as part of ESX host preparation. You must perform the following
tasks in sequence to complete EPSec installation.
IMPORTANT All vShield REST requests require authorization. You can use the following basic authorization:
Authorization: Basic YWRtaW46ZGVmYXVsdA==
YWRtaW46ZGVmYXVsdA== represents the Base 64 encoding of the vShield Manager default login credentials
(admin:default).
7
Register an SVM with the vShield Endpoint Service on an ESX Host
You can register and unregister a third-party antivirus security virtual machine (SVM) with vShield Endpoint.
In the POST request, vmId is the 0-based index of the vNIC that the SVM uses to communicate with the vShield
Endpoint service. The vShield Manager connects the vNIC to the correct port group to enable communication
between the SVM and the vShield Endpoint service.
To register SVMs on multiple ESX hosts in a single REST call, include multiple <SvmRegister /> sections in
the request body.
Example 7-1. Registering an SVM with vShield Endpoint Service
Request:
POST <vshieldmanager-uri>/api/1.0/endpointsecurity/svm
HTTP 204 No Content: The Endpoint Security VM is successfully registered.
HTTP 401 Unauthorized: The username or password sent in Authorization header is wrong.
HTTP 400 Bad Request
40002=Acquiring data from VC failed for <>
40005=SVM with moid: <> failed to register
40006=SVM with moid: <> already registered
40009=Invalid SVM details
40010=Endpoint LKM not installed
40012=Endpoint LKM not installed due to bad ESX version
40015=vmId is malformatted or of incorrect length : <>
40020=Invalid vendorId for {0}
40022=Host: <> has a registered SVM with moid: <>
HTTP 401 Unauthorized : The username or password sent in Authorization header is wrong.
HTTP 405 Method Not Allowed : If the vmId is missed in the URI.
HTTP 400 Bad Request : Internal error codes. Please refer the Error Schema for more details.
40002=Acquiring 1. data from VC failed for <>
40007=SVM with moid: <> not registered
40015=vmId is malformatted or of incorrect length : <>
62VMware, Inc.
Chapter 7 vShield Endpoint Management
Retrieve vShield Endpoint Service Status on an ESX Host
You must specify the host ID of the ESX host.
Example 7-3. Retrieving vShield Endpoint Service Status from an ESX Host
Request:
GET <vshieldmanager-uri>/api/1.0/endpointsecurity/host/<hostId>
Example:
GET /api/1.0/endpointsecurity/host/host-1234 HTTP/1.1
host: 10.112.199.123:80
Authorization: Basic YWRtaW46ZGVmYXVsdA==
HTTP 401 Unauthorized : The username or password sent in Authorization header is wrong.
HTTP 404 Not Found : If the hostId is missing in the URI.
HTTP 400 Bad Request : Internal error codes. Please refer the Error Schema for more details.
40002=Acquiring 1. data from VC failed for <>
40017=hostId is malformatted or of incorrect length : <>
Uninstalling the vShield Endpoint Service from an ESX Host
Before you uninstall the vShield Endpoint from the vShield Manager and ESX host, you must unregister the
SVM from the vShield Endpoint service.
CAUTION If any of the virtual machines that are running on the target ESX host cannot be migrated to another
ESX host, these virtual machines must be powered off or migrated manually before the uninstallation can
continue.
Unregister an SVM from vShield Endpoint
You must specify the virtual machine ID of the SVM to unregister the SVM from the vShield Endpoint service.
Example 7-4. Unregistering an SVM from vShield Endpoint
HTTP 204 No Content: The Endpoint Security VM is successfully unregistered.
HTTP 401 Unauthorized: The username or password sent in Authorized header is wrong.
HTTP 405 Method Not Allowed: If the vmId is missed in the URI.
HTTP 400 Bad Request: Internal error codes. Please refer the Error Schema for more details.
40002=Acquiring data from VC failed for <>
40007=SVM with moid: <> not registered
40015=vmId is malformatted or of incorrect length : <>
VMware, Inc.63
vShield API Programming Guide
Uninstall vShield Endpoint from the vShield Manager
After the SVM is unregistered, you can uninstall the vShield Endpoint from the vShield Manager. See
“Uninstalling vShield Services from an ESX Host” on page 18.
If a REST API call results in an error, the HTTP reply contains the following information.
An XML error document as the response body
Content-Type: application/xml
An appropriate 2xx, 4xx, or 5xx HTTP status code
Tabl e A-1. Error Message Status Codes
CodeDescription
200 OKThe request was valid and has been completed. Generally, this response is accompanied
by a body document (XML).
204 No ContentSame as 200 OK, but the response body is empty (No XML).
400 Bad RequestThe request body contains an invalid representation or the representation of the entity is
missing information. The response is accompanied by Error Object (XML).
401 UnauthorizedAn authorization header was expected. Request with invalid or no vShield Manager
403 ForbiddenThe user does not have enough privileges to access the resource.
404 Not FoundThe resource was not found. The response is accompanied by Error Object (XML).
500 Internal Server
Error
503 Service
Unavailable
Tok en.
Unexpected error with the server. The response is accompanied by Error Object (XML).
Cannot proceed with the request, because some of the services are unavailable. Example:
vShield Edge is Unreachable. The response is accompanied by Error Object (XML).
86VMware, Inc.
Index
C
CLI, manage vShield Edge credentials 25
D
debug, Port Group Isolation 20
debugging a vShield Edge 47
DHCP
about 25
configuring 26
delete configuration 27
get configuration by timestamp 27
hosts and pools 26
last 10 configurations 27
revert to configuration by timestamp 27
server status 25
start, stop, or restart service 25
disabling Port Group Isolation 20
DNAT
about 30
delete configuration 33
get configuration by timestamp 33
get rule set 30
last 10 configurations 33
post rule set 31
revert to configuration by timestamp 33
E
enabling Port Group Isolation 19
ESX host preparation 15
post rule set 34
revert to configuration by timestamp 36
view a specific rule 36
forced synchronization 24
I
installation
Port Group Isolation 15
status 17
vShield App 15
vShield Edge 21
vShield Endpoint 15
installation parameters of vShield Edge 22
L
Load Balancer
about 43
add a listener 44
delete configuration 46
get configuration by timestamp 46
get current configuration 45
get current configuration of single server 45
last 10 configurations 45
revert to configuration by timestamp 46
server status 43
start or stop service 44
logs, tech support 14
M
MTU threshold 46
F
firewall
vShield App
about 51
delete configuration 55
get configuration by timestamp 55
last 10 configurations 55
post rule set 52
revert to configuration by timestamp 55
view rule set 51
vShield Edge
about 33
change the default policy action 35
default policy status 35
delete configuration 36
get configuration by timestamp 36
get rule set 33
last 10 configurations 36
VMware, Inc.87
N
NAT
DNAT
about 30
delete configuration 33
get configuration by timestamp 33
get rule set 30
last 10 configurations 33
post rule set 31
revert to configuration by timestamp 33
SNAT
about 28
delete configuration 30
get configuration by timestamp 30
get rule set 28
last 10 configurations 30
post rule set 28
revert to configuration by timestamp 30
about 56
adding 56
adding a virtual machine 57
deleting a security group 59
deleting a VM from a group 58
deleting all security group 59
get details 58
get IP address details 58
get list of 57
get properties of a VM 58
snapshots
DHCP 27
DNAT 33
get DHCP snapshot by timestamp 27
get DNAT snapshot by timestamp 33
get Load Balancer snapshot by timestamp 46
get SNAT snapshot by timestamp 30
get Syslog snapshot by timestamp 48
get VPN snapshot by timestamp 42
get vShield App firewall snapshot by
timestamp 55
get vShield Edge firewall snapshot by
timestamp 36
Load Balancer 45
revert to DHCP snapshot by timestamp 27
revert to DNAT snapshot by timestamp 33
revert to Load Balancer snapshot by
timestamp 46
revert to SNAT snapshot by timestamp 30
revert to Syslog snapshot by timestamp 48
revert to VPN snapshot by timestamp 42
revert to vShield App firewall snapshot by
timestamp 55
revert to vShield Edge firewall snapshot by
about 28
delete configuration 30
get configuration by timestamp 30
get rule set 28
last 10 configurations 30
post rule set 28
revert to configuration by timestamp 30
status
Port Group Isolation installation 17
vShield App installation 17
vShield Endpoint installation 17
SVM
get network info 62
registering with vShield Endpoint 61
retrieve status 63
unregistering 63
Syslog
about 47
vShield App 59
vShield Edge
delete configuration 49
get configuration by timestamp 48
get current configuration 48
last 10 configurations 48
post a configuration 47
revert to configuration by timestamp 48
T
tech support logs 14
traffic statistics for a vShield Edge 47
U
Uninstall vShield 17
uninstallation
Port Group Isolation 18
vShield App 18
vShield Edge 22
vShield Endpoint 18, 63
uninstalling a vShield 17
unregistering a vShield Endpoint SVM 63
upgrade a vShield Edge 24
V
VPN
about 37
add a site 39
add tunnels for a site 40
delete a site 41
delete a tunnel for a site 41
delete configuration 42
get configuration by timestamp 42
get current configuration 41
get the detailed configuration 40
88VMware, Inc.
Index
get the detailed configuration for a site 41
get the detailed configuration for a tunnel 41
last 10 configurations 42
post configuration 38
revert to configuration by timestamp 42
server status 38
start or stop service 38
vShield
about 9
uninstalling 17
vShield App
about 9
firewall
about 51
delete configuration 55
get configuration by timestamp 55
last 10 configurations 55
post rule set 52
revert to configuration by timestamp 55
view rule set 51
install 15
Security Groups
about 56
adding 56
adding a virtual machine 57
deleting a security group 59
deleting a VM from a group 58
deleting all security group 59
get details 58
get IP address details 58
get list of 57
get properties of a VM 58
Syslog 59
uninstall 18
vShield Edge
about 10
CLI credentials 25
debugging 47
DHCP
about 25
configuring 26
delete configuration 27
get all hosts and pools 26
get configuration by timestamp 27
last 10 configurations 27
revert to configuration by timestamp 27
start, stop, or restart 25
status 25
DNAT
about 30
delete configuration 33
get configuration by timestamp 33
get rule set 30
last 10 configurations 33
post rule set 31
revert to configuration by timestamp 33
firewall
about 33
change the default policy action 35
default policy status 35
delete configuration 36
get configuration by timestamp 36
get rule set 33
last 10 configurations 36
post rule set 34
revert to configuration by timestamp 36
view a specific rule 36
force sync with vShield Manager 24
get traffic statistics 47
installation 21
installation parameters 22
Load Balancer
about 43
add a listener 44
delete configuration 46
get configuration by timestamp 46
get current configuration 45
get current configuration of single
server 45
last 10 configurations 45
revert to configuration by timestamp 46
start or stop service 44
status 43
MTU threshold 46
NAT
about 28
SNAT
about 28
delete configuration 30
get configuration by timestamp 30
get rule set 28
last 10 configurations 30
post rule set 28
revert to configuration by timestamp 30
Syslog
about 47
delete configuration 49
get configuration by timestamp 48
get current configuration 48
last 10 configurations 48
post a configuration 47
revert to configuration by timestamp 48
tech support log 14
uninstallation 22
upgrading 24
VPN
about 37
add a site 39
add tunnels for a site 40
delete a site 41
delete a tunnel for a site 41
delete configuration 42
get configuration by timestamp 42
get current configuration 41
VMware, Inc.89
vShield API Programming Guide
get the detailed configuration 40
get the detailed configuration for a site 41
get the detailed configuration for a
last 10 configurations 42
post configuration 38
revert to configuration by timestamp 42
start or stop service 38
status 38
vShield Endpoint
about 10
error schema 64
get SVM network info 62
install 15
managing 61
registering an SVM 61
retrieve SVM status 63
uninstall 18
uninstalling 63
unregistering an SVM 63
vShield Manager
about 9
configure DNS 13
force sync with vShield Edge 24
sync with vCenter 13
tech support log 14
vShield Zones
vShield 9
vShield Manager 9
tunnel 41
90VMware, Inc.
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.