
vShield API Programming Guide
60 VMware, Inc.
Example 6-1. Retrieve the datacenter state
Example:
GET https://<vsm-ip>/api/2.0/app/firewall/datacenter-2/state
TheXMLresponserepresentstheDatacenterStateobject,containinganenumerationofdatacenterstatus.The
statecouldberegular,upgrading,migrating,backwardCompatible,orbackwardCompatibleReadyForSwitch.
Modify Datacenter State
YoucanchangethestateofadatacenteronlyifitisinthebackwardCompatibleReadyForSwitchstate.
Example 6-2. Change datacenter state to migrating
Example:
POST https://<vsm-ip>/api/2.0/app/firewall/datacenter-2/state
Configuring Firewall Rules for vCenter
TheprimaryfunctionofavShieldAppistoprovidefirewallprotectiononanESXhostbyinspectingeach
sessionandreturningdetailstothevShieldManager.Trafficdetailsincludesources,destinations,directionof
sessions,applications,andportsbeingused.Trafficdetailscanbeusedtocreatefirewallallowordeny
rules.
InthevShieldManageruserinterfaceorvSphereClientplug‐in,theAppFirewalltabcontainsthefirewall
rulesenforcedbyvShieldAppinstances.YoucanmanageAppFirewallrulesatthedatacenter,cluster,and
portgrouplevelstoprovideaconsistentsetofrulesacrossmultiplevShieldApp
instances.Asmembership
inthesecontainerscanchangedynamically,AppFirewallmaintainsthestateofexistingsessionswithout
requiringreconfigurationoffirewallrules.Inthisway,AppFirewalleffectivelyhasacontinuousfootprinton
eachESXhostunderthemanagedcontainers.
WhencreatingAppFirewallrules,youcancreategeneralrules
basedonincomingoroutgoingtrafficatthe
containerlev el.Forexample,youcancreatearuletodenyanytrafficfromout si de ofadatacenterthattargetsa
destinationwithinthedatacenter.Youcancreatearuletodenyanyincomingtrafficthatisnottaggedwitha
VLANID.
Allfirew allrulesconfiguredbyusingRESTrequestsappearundertheAppFirewalltabfortheapprop ria te
containerinthevShieldManageruserinterfaceandvSphereClientplug‐in.
ForthecompletefirewallXMLschema,see“vShieldAppFirewallSchema”onpage 110.
Configuring the vShield App Firewall
Firewallprecedenceishierarchicalateachlevel.Atthedatacenterlevel,choicesareDEFAULT,HIGH,orLOW.
AttheclusteranddvPortgrouplevel,firewallprecedenceisoftensettoNONE.
EachvShieldAppenforcesthefirewallrulesintop‐to‐bottomordering.AvShieldAppcheckseachtraffic
sessionagainstthe
topruleinthefirewalltablebeforemovingdownthesubsequentrulesinthetable.Thefirst
ruleinthetablethatmatchesthetrafficparametersisenforced.SeethevShieldAdministrationGuideformore
informationaboutthehierarchyofvShieldAppfirewallrules.
Query Firewall Configuration
Youcanretrievethefirewallconfigurationassociatedwithadatacenter,cluster,ordvPortGroup.Thetemplate
fortheAPIisasfollows:
GET
https://<vsm-ip>/api/2.0/app/firewall/<context>/config?list=<L>&precedence=<P>&rulesType=<R>
&configId=<C>
Where
Commentaires sur ces manuels