<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic ASA REST API ACE with Object Groups in Network Security</title>
    <link>https://community.cisco.com/t5/network-security/asa-rest-api-ace-with-object-groups/m-p/4037100#M25</link>
    <description>&lt;P&gt;I'm attempting to use the ASA REST API to programmatically configure a few hundred firewalls that already have ACL's configured on them. The ACL's are similar to the following:&lt;/P&gt;&lt;PRE&gt;access-list IN extended permit tcp any gt 1023 object-group internal eq ssh
access-list IN extended permit tcp any gt 1023 object-group internal object-group cpanel
access-list IN extended permit icmp any any time-exceeded
access-list IN extended permit ip object-group full-access object-group internal
access-list IN extended permit object-group tcp-udp any object-group internal eq domain
access-list IN extended permit tcp any gt 1023 object-group internal object-group web
access-list IN extended permit tcp any gt 1023 object-group internal object-group ftp&lt;/PRE&gt;&lt;P&gt;The problem is modifying or adding an ACE that's similar to the aforementioned list using the REST API:&lt;/P&gt;&lt;PRE&gt;POST to "{"url":"/api/objects/extendedacls/IN/aces"}"
{
  "permit": true,
  "sourceAddress": {
    "kind": "AnyIPAddress",
    "value": "any"
  },
  "destinationAddress": {
    "kind": "objectRef#NetworkObjGroup",
    "objectId": "internal"
  },
  "sourceService": {
    "kind": "TcpUdpService",
    "value": "&amp;gt;tcp/1023"
  },
  "destinationService": {
    "kind": "objectRef#TcpServiceGroup",
    "objectId": "ftp"
  },
  "active": true,
  "position": 8
}&lt;/PRE&gt;&lt;P&gt;This returns:&lt;/P&gt;&lt;PRE&gt;{
  "messages": [
    {
      "level": "Error",
      "code": "ACCESS-SRC-DST-SAME-IP-VER",
      "details": "Source and Destination addresses should be of the same IP version."
    }
  ]
}&lt;/PRE&gt;&lt;P&gt;If I change 'objectRef#NetworkObjGroup' to 'object#NetworkObjGroup' to match what I return when I lookup network object groups via the API:&lt;/P&gt;&lt;PRE&gt;{
  "kind": "object#NetworkObjGroup",
  "name": "internal",
  "description": "",
  "objectId": "internal"
}&lt;/PRE&gt;&lt;P&gt;I get this error:&lt;/P&gt;&lt;PRE&gt;{
  "messages": [
    {
      "level": "Error",
      "code": "JSON-MAPPING-ERROR",
      "context": "destinationAddress",
      "details": "object#NetworkObjGroup- object 'internal' not found"
    }
  ]
}&lt;/PRE&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;</description>
    <pubDate>Thu, 27 Feb 2020 20:00:07 GMT</pubDate>
    <dc:creator>ncappelletti</dc:creator>
    <dc:date>2020-02-27T20:00:07Z</dc:date>
    <item>
      <title>ASA REST API ACE with Object Groups</title>
      <link>https://community.cisco.com/t5/network-security/asa-rest-api-ace-with-object-groups/m-p/4037100#M25</link>
      <description>&lt;P&gt;I'm attempting to use the ASA REST API to programmatically configure a few hundred firewalls that already have ACL's configured on them. The ACL's are similar to the following:&lt;/P&gt;&lt;PRE&gt;access-list IN extended permit tcp any gt 1023 object-group internal eq ssh
access-list IN extended permit tcp any gt 1023 object-group internal object-group cpanel
access-list IN extended permit icmp any any time-exceeded
access-list IN extended permit ip object-group full-access object-group internal
access-list IN extended permit object-group tcp-udp any object-group internal eq domain
access-list IN extended permit tcp any gt 1023 object-group internal object-group web
access-list IN extended permit tcp any gt 1023 object-group internal object-group ftp&lt;/PRE&gt;&lt;P&gt;The problem is modifying or adding an ACE that's similar to the aforementioned list using the REST API:&lt;/P&gt;&lt;PRE&gt;POST to "{"url":"/api/objects/extendedacls/IN/aces"}"
{
  "permit": true,
  "sourceAddress": {
    "kind": "AnyIPAddress",
    "value": "any"
  },
  "destinationAddress": {
    "kind": "objectRef#NetworkObjGroup",
    "objectId": "internal"
  },
  "sourceService": {
    "kind": "TcpUdpService",
    "value": "&amp;gt;tcp/1023"
  },
  "destinationService": {
    "kind": "objectRef#TcpServiceGroup",
    "objectId": "ftp"
  },
  "active": true,
  "position": 8
}&lt;/PRE&gt;&lt;P&gt;This returns:&lt;/P&gt;&lt;PRE&gt;{
  "messages": [
    {
      "level": "Error",
      "code": "ACCESS-SRC-DST-SAME-IP-VER",
      "details": "Source and Destination addresses should be of the same IP version."
    }
  ]
}&lt;/PRE&gt;&lt;P&gt;If I change 'objectRef#NetworkObjGroup' to 'object#NetworkObjGroup' to match what I return when I lookup network object groups via the API:&lt;/P&gt;&lt;PRE&gt;{
  "kind": "object#NetworkObjGroup",
  "name": "internal",
  "description": "",
  "objectId": "internal"
}&lt;/PRE&gt;&lt;P&gt;I get this error:&lt;/P&gt;&lt;PRE&gt;{
  "messages": [
    {
      "level": "Error",
      "code": "JSON-MAPPING-ERROR",
      "context": "destinationAddress",
      "details": "object#NetworkObjGroup- object 'internal' not found"
    }
  ]
}&lt;/PRE&gt;&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2020 20:00:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/asa-rest-api-ace-with-object-groups/m-p/4037100#M25</guid>
      <dc:creator>ncappelletti</dc:creator>
      <dc:date>2020-02-27T20:00:07Z</dc:date>
    </item>
    <item>
      <title>Re: ASA REST API ACE with Object Groups</title>
      <link>https://community.cisco.com/t5/network-security/asa-rest-api-ace-with-object-groups/m-p/4067843#M26</link>
      <description>I dont have a setup ready right now, but can you quickly check what you see on the debugs when you push this config? &lt;BR /&gt;debug rest-api&lt;BR /&gt;Since the CLI command works, no reason why API doesnt. And if it doesnt, it has to be filed as a defect.</description>
      <pubDate>Fri, 17 Apr 2020 04:44:33 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/asa-rest-api-ace-with-object-groups/m-p/4067843#M26</guid>
      <dc:creator>Manoj Papisetty</dc:creator>
      <dc:date>2020-04-17T04:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: ASA REST API ACE with Object Groups</title>
      <link>https://community.cisco.com/t5/network-security/asa-rest-api-ace-with-object-groups/m-p/4076736#M27</link>
      <description>&lt;P&gt;Could this error be because you used "any", which means ipv4 or ipv6, rather than "any4" ?&lt;/P&gt;&lt;PRE&gt;"Source and Destination addresses should be of the same IP version."&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Apr 2020 22:13:47 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/asa-rest-api-ace-with-object-groups/m-p/4076736#M27</guid>
      <dc:creator>grant.maynard</dc:creator>
      <dc:date>2020-04-29T22:13:47Z</dc:date>
    </item>
  </channel>
</rss>

