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

Should ufw_outgoing_traffic also allow to specify the protocol? #803

Open
jdaln opened this issue Dec 10, 2024 · 1 comment
Open

Should ufw_outgoing_traffic also allow to specify the protocol? #803

jdaln opened this issue Dec 10, 2024 · 1 comment
Assignees

Comments

@jdaln
Copy link
Contributor

jdaln commented Dec 10, 2024

Hello!

For ufw_outgoing_traffic, should it allow to specify the protocol? For example, we would have:

ufw_outgoing_traffic:
  - 22/tcp
  - 53 # this means both, as is currently the case
  - 80/tcp
etc...

I can make the PR with the necessary edits to:

- name: Allow outgoing specified ports
community.general.ufw:
rule: allow
to_port: "{{ item | int }}"
direction: out
comment: ansible managed
loop: "{{ ufw_outgoing_traffic }}"

@konstruktoid
Copy link
Owner

konstruktoid commented Dec 10, 2024

yeah, that seems like a good addition.

something like, since 22/tcp doesn't work:

  vars:
    ufw_outgoing_traffic:
      - { port: 80, proto: 'tcp' }
      - 443
      - 53
      - 123
      - 22
      - { port: 1234, proto: 'udp' }
  tasks:
    - name: Allow outgoing specified ports
      become: true
      community.general.ufw:
        rule: allow
        to_port: "{{ item.port | default(item) }}"
        proto: "{{ item.proto | default('tcp') }}"
        direction: out
        comment: ansible managed
      loop: "{{ ufw_outgoing_traffic }}"

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

No branches or pull requests

2 participants