
vShield API Programming Guide
54 VMware, Inc.
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 82.
Configuring the vShield App Firewall
Firewallprecedenceishierarchicalateachlevel.Atthedatacenterlevel,choicesareDEFAULT,HIGH,orLOW.
AttheclusteranddvPortgrouplevel,firewallprecedenceisoftensettoNONE.
EachvShieldAppenforcesthefirewallrulesintop‐to‐bottomordering.AvShieldAppcheckseachtraffic
sessionagainstthe
topruleinthefirewalltablebeforemovingdownthesubsequentrulesinthetable.Thefirst
ruleinthetablethatmatchesthetrafficparametersisenforced.SeethevShieldAdministrationGuideformore
informationaboutthehierarchyofvShieldAppfirewallrules.
Query the 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
<context>isthecontextIDofadatacenter,cluster,ordvPortGroup.
<L>isthelistingtype,oneofthefollowing:
statusforbriefcurrentstate
configforfirewallconfiguration(thedefault)
historyforconfigurationhistory
Comentários a estes Manuais