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

GetNetAddr fails if network definition has references to objects with only FQDN defined #354

Open
mngan opened this issue Oct 19, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@mngan
Copy link

mngan commented Oct 19, 2023

Trying to model some SRX policies, and we have situations where a objects in an Address-Set could be IP only, or FQDN only. When you model this like below, aclgen will fail to accept this network definition. If you put the address and the fqdn in the same definition, then it works just fine. But in this case, the two Address objects refer to unrelated hosts on the network. So it doesn't make sense to put them together as we may need to use them independently as well as together.

networks:
  SITE1_IP:
    values:
      - address: 1.2.3.4/32
  SITE2_FQDN:
    values:
      - fqdn: www.example.com
  MIXED_NETWORK_TEST:
    values:
      - name: SITE1_IP
      - name: SITE2_FQDN
filters:
  - header:
      targets:
        srx: from-zone trust to-zone untrust address-book-zone inet
    terms:
      - name: test-mixed-fqdn
        destination-address: MIXED_NETWORK_TEST
        logging: log-both
        action: accept
I1018 18:03:11.037912 140297583224640 aclgen.py:444] finding policies...
W1018 18:03:11.038985 140297583224640 aclgen.py:362] --> policies/pol (1 pol files found)
W1018 18:03:11.067573 140297583224640 aclgen.py:501] 

error encountered in rendering process:
Error parsing policy file policies/pol/test.yaml:
<class 'aerleon.lib.naming.EmptyDefinitionError'>No IP addresses found for network: SITE2_FQDN


I1018 18:03:11.068295 140297583224640 aclgen.py:379] no files changed, not writing to disk
W1018 18:03:11.068465 140297583224640 aclgen.py:507] done, with errors.
@ankenyr ankenyr added the bug Something isn't working label Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants