Skip to content
This repository has been archived by the owner on Nov 2, 2022. It is now read-only.

No support for "allow hosts" #70

Open
breakid opened this issue Jun 8, 2021 · 0 comments
Open

No support for "allow hosts" #70

breakid opened this issue Jun 8, 2021 · 0 comments

Comments

@breakid
Copy link

breakid commented Jun 8, 2021

There is currently no way to restrict shares by host / subnet.

Basic functionality can be accomplished by adding the following to templates/smb.conf.j2. I recommend including it after "force directory mode = {{ share.force_directory_mode|default('0775') }}".

{% if share.allow_hosts is defined %}
  allow hosts = {% for entry in share.allow_hosts %}{{ entry }}{% if not loop.last %}, {% endif %}{% endfor %}
{% endif %}

Example Configuration:

samba_shares:
  - name: /srv/shares/test
    write_list: +users
    setype: public_content_rw_t
    allow_hosts:
      - 192.168.1.0/24
      - 172.16.10.0/255.255.255.0
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant