Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ACE object-group as protocol support added #240

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

rulev
Copy link

@rulev rulev commented Jun 14, 2024

SUMMARY

Adds support for specifying an object-group as a protocol.
The issue is mentioned here #187

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

cisco.asa.asa_acls

ADDITIONAL INFORMATION

Modern ASA allows to specify object-group as a protocol in ACE like this:

access-list my_acl extended permit object-group my_service_object_group host 1.2.3.4 host 5.6.7.8

Furthermore this is the recommended way of using service object groups.
Currently cisco.asa.asa_acls module accepts that, it is possible to supply ACL config like this and ACE will be created.

"config": {
                "acls": [
                    {
                        "aces": [
                            {
                                "destination": {
                                    "host": "5.6.7.8"
                                },
                                "grant": "permit",
                                "line": 1,
                                "protocol": "object-group dns-svcg",
                                "source": {
                                    "host": "1.2.3.4"
                                },
                            }
                        ],
                        "acl_type": "extended",
                        "name": "testing",
                    }
                ]
            }

However existing ACEs are parsed incorrectly:

"aces": [
                    {
                        "destination": {
                            "host": "1.2.3.4"
                        },
                        "grant": "permit",
                        "line": 1,
                        "source": {
                            "object_group": "dns-svcg"
                        }
                    }
                ],

And if the module is going to remove this ACE, it fails:

fatal: [ciscoasa-test]: FAILED! => {
    "changed": false,
    "module_stderr": "no access-list testing line 1 extended permit object-group dns-svcg host 1.2.3.4\r\nERROR: % Incomplete command\r\n\rciscoasa-test/act(config)# ",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error"
}

This PR introduces support for specifying object-group as a protocol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant