SlideShare a Scribd company logo
How to customize Zentyal
(hooks, templates and LDAP)

Zentyal Summit 2011

12th November
Carlos Pérez-Aradros <cperez@zentyal.com>

   Linux small business server
Linux small business server




Zentyal...
     Easy to use
     Good integration
     Versatile



...but sometimes you need
     Some specific customization
     Integration with external apps




       www.zentyal.com                      © eBox Technologies S.L. 2011
Linux small business server




Customization options
   Modify source code
      Add new logic or functionality
      Breaks on upgrade      Upstream!

   Templates
      Change configuration files written by Zentyal
   Hooks
      Define custom actions (scripts) on module events
   LDAP
      Integrate external applications



       www.zentyal.com                                      © eBox Technologies S.L. 2011
Linux small business server




Customization options
   Modify source code
      Add new logic or functionality
      Breaks on upgrade
   Templates
      Change configuration files written by Zentyal
   Hooks
      Define custom actions (scripts) on module events
   LDAP
      Integrate external applications



       www.zentyal.com                                      © eBox Technologies S.L. 2011
Linux small business server




Templates (I)


   Zentyal uses templates to write system configurations files



   Modify templates to:

      Adjust parameters to adapt Zentyal to your requirements

      Add/remove configuration options




       www.zentyal.com                                  © eBox Technologies S.L. 2011
Linux small business server




Templates (II)
   Mason as template processor




       www.zentyal.com                 © eBox Technologies S.L. 2011
Linux small business server




Templates (III)



   Default templates location:
      /usr/share/zentyal/stubs/<module>/<template>.mas
   Custom templates:
      /etc/zentyal/stubs/<module>/<template>.mas




       www.zentyal.com                             © eBox Technologies S.L. 2011
Linux small business server




Templates (IV)
Default stub
/usr/share/zentyal/stubs/network/resolv.conf.mas

        T


                                                         Conf file
                                                         /etc/resolv.conf
        T



Custom stub
/etc/zentyal/stubs/network/resolv.conf.mas


            www.zentyal.com                              © eBox Technologies S.L. 2011
Linux small business server




Templates example: Samba hidden folders
   We want to add a hidden folder in File Sharing module (samba)
   Zentyal GUI doesn't allow this:




       www.zentyal.com                                 © eBox Technologies S.L. 2011
Linux small business server




Templates example: Samba hidden folders
   Copy and edit default template:

   mkdir -p /etc/zentyal/stubs/samba/

   cp /usr/share/zentyal/stubs/samba/smb.conf.mas /etc/zentyal/stubs/samba/




   Write custom configuration



        www.zentyal.com                                         © eBox Technologies S.L. 2011
Linux small business server




Customization options
   Modify source code
      Add new logic or functionality
      Breaks on upgrade
   Templates
      Change configuration files written by Zentyal
   Hooks
      Define custom actions (scripts) on module events
   LDAP
      Integrate external applications



       www.zentyal.com                                      © eBox Technologies S.L. 2011
Linux small business server




Hooks (I)
   Execute actions (scripts) during Zentyal save changes process



   Create hook scripts to:

      Watch for changes in any module

      Add custom scripts before/after module actions




       www.zentyal.com                                  © eBox Technologies S.L. 2011
Linux small business server




Hooks (II): paths

   Before saving changes     /etc/zentyal/pre-save/


   After saving changes    /etc/zentyal/post-save/




   /etc/zentyal/hooks/

      Before saving module configuration <module>.presetconf
      After saving module configuration <module>.postsetconf
      Before restarting the service       <module>.preservice


      After restarting the service <module>.postservice



       www.zentyal.com                                                © eBox Technologies S.L. 2011
Linux small business server



                           one time     for each module
Hooks (III)
                           pre-save
                                             .presetconf

                                           Write conf files

                                             .postsetconf


                                             .preservice

                                         Restart daemons

                                             .postservice
       hook
                           post-save

   Zentyal action

         www.zentyal.com                     © eBox Technologies S.L. 2011
Linux small business server




Hooks Example: Firewall


   We want to block traffic from a specific country (using GeoIP)
   Zentyal GUI does not allow this kind of rules


   If we add the rule by hand:
      Firewall module restart will delete it


   Solution:
      Add the rule after firewall restart (postservice hook)


       www.zentyal.com                                   © eBox Technologies S.L. 2011
Linux small business server




Hooks Example: Firewall
   Setup GeoIP
   sudo apt-get install module-assistant

   sudo module-assistant a-i xtables-addons



   wget http://sourceforge.net/projects/xtables-
   addons/files/Xtables-addons/1.38/xtables-addons-1.38.tar.xz



   sudo ./xt_geoip_dl

   sudo ./xt_geoip_build *.csv

   sudo mkdir /var/geoip && sudo cp -r LE /var/geoip




       www.zentyal.com                                   © eBox Technologies S.L. 2011
Linux small business server




Hooks Example: Firewall
   Create the hook


                 /etc/zentyal/hooks/firewall.postservice
   #!/bin/sh
   sudo iptables -I INPUT -m geoip --src-cc KP -j ACCEPT




   Don't forget to make it executable!
      chmod +x /etc/zentyal/hooks/firewall.postservice




        www.zentyal.com                                 © eBox Technologies S.L. 2011
Linux small business server




Hooks: Future (3.0)
   Users operations hooks
      create
      modify
      delete


   Backup
      pre-backup
      post-backup




       www.zentyal.com            © eBox Technologies S.L. 2011
Linux small business server




Customization options
   Modify source code
      Add new logic or functionality
      Breaks on upgrade
   Templates
      Change configuration files written by Zentyal
   Hooks
      Define custom actions (scripts) on module events
   LDAP
      Integrate external applications



       www.zentyal.com                                      © eBox Technologies S.L. 2011
Linux small business server




LDAP Integration (I)

   Zentyal provides great Users and Groups management



   LDAP integration:

      Central point for users management

      Centralized authentication

      Distributed: master / slave architecture




       www.zentyal.com                                   © eBox Technologies S.L. 2011
Linux small business server




LDAP Integration (II)
   Integrate third apps with Zentyal Users and Groups




       www.zentyal.com                                        © eBox Technologies S.L. 2011
Linux small business server




LDAP Integration (II): settings
   Users and Groups → LDAP Settings




   Server: ldap://localhost:389/ (port 1389 in slaves)
   Users DN: ou=Users,<basedn>
   Groups DN: ou=Groups,<basedn>

        www.zentyal.com                                        © eBox Technologies S.L. 2011
Linux small business server




LDAP Integration (III): filters
uid=cperez,ou=Users,dc=zentyal,dc=com
uid: cperez
                                        Base DN: ou=Users,dc=zentyal,dc=com
loginShell: /usr/sbin/nologin
uidNumber: 2002
                                        Filter: (uid=*)
gidNumber: 1901
homeDirectory: /home/cperez
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: passwordHolder                cn=developers,ou=Groups,dc=zentyal,dc=com
givenName: Carlos                          cn: developers
userPassword: {SHA}...                     gidNumber: 2005
eboxSha1Password: {SHA}...                 objectClass: posixGroup

eboxMd5Password: {MD5}...                  memberUid: cperez

eboxDigestPassword: {MD5}...               memberUid: jsalamero

eboxRealmPassword: {MD5}...                memberUid: ejhernandez

cn:; Carlos Pérez-Aradros Herce            memberUid: jacalvo
                                           memberUid: jamor
sn:; Pérez-Aradros Herce
                                           ...

              www.zentyal.com                                           © eBox Technologies S.L. 2011
                                                                           c
Linux small business server




LDAP Integration example: Wordpress




      www.zentyal.com                   © eBox Technologies S.L. 2011
Linux small business server




LDAP Integration example: Wordpress
   Look for a LDAP Auth backend




       www.zentyal.com                  © eBox Technologies S.L. 2011
Linux small business server




LDAP Integration example: Wordpress




      www.zentyal.com                   © eBox Technologies S.L. 2011
Linux small business server




In summary
   Modify source code
      Add new logic or functionality
      Breaks on upgrade      Upstream!

   Templates
      Change configuration files written by Zentyal
   Hooks
      Define custom actions (scripts) on module events
   LDAP
      Integrate external applications



       www.zentyal.com                                      © eBox Technologies S.L. 2011
Linux small business server




Get help
  Zentyal Support Forum
        http://forum.zentyal.org
  Users and Developers mailing lists
        https://lists.zentyal.com/cgi-bin/mailman/listinfo/zentyal-devel
        https://lists.zentyal.com/cgi-bin/mailman/listinfo/zentyal-users
  IRC
        #zentyal at freenode.net
  Official support and training
        http://www.zentyal.com/en/services/              Contribute!


           www.zentyal.com                                      © eBox Technologies S.L. 2011
Linux small business server




Further reading...
   Zentyal Documentation - Advanced Service Customisation
      http://doc.zentyal.org/en/develop.html
   Mason Documentation (Templates)
      http://www.masonhq.com/docs/manual/Devel.html
   xtables addons
      http://xtables-addons.sourceforge.net/
   Openldap filters doc
      http://www.zytrax.com/books/ldap/apa/search.html




       www.zentyal.com                               © eBox Technologies S.L. 2011
Linux small business server




www.zentyal.com
                  ?         © eBox Technologies S.L. 2011

More Related Content

Similar to Zentyal Customization (templates, hooks, LDAP)

the NML project
the NML projectthe NML project
the NML projectLei Yang
 
How do I securely deploy Internet websites in PHP on my IBMi?
How do I securely deploy Internet websites in PHP on my IBMi?How do I securely deploy Internet websites in PHP on my IBMi?
How do I securely deploy Internet websites in PHP on my IBMi?
Zend by Rogue Wave Software
 
What's LUM Got To Do with It: Deployment Considerations for Linux User Manage...
What's LUM Got To Do with It: Deployment Considerations for Linux User Manage...What's LUM Got To Do with It: Deployment Considerations for Linux User Manage...
What's LUM Got To Do with It: Deployment Considerations for Linux User Manage...
Novell
 
Enea Linux and LWRT FTF China 2012
Enea Linux and LWRT FTF China 2012Enea Linux and LWRT FTF China 2012
Enea Linux and LWRT FTF China 2012EneaSoftware
 
OSSNA18: Xen Beginners Training
OSSNA18: Xen Beginners Training OSSNA18: Xen Beginners Training
OSSNA18: Xen Beginners Training
The Linux Foundation
 
Deploying Windows Apps to Kubernetes with Draft and Helm
Deploying Windows Apps to Kubernetes with Draft and HelmDeploying Windows Apps to Kubernetes with Draft and Helm
Deploying Windows Apps to Kubernetes with Draft and Helm
Jessica Deen
 
2011 04 zentyal_cork
2011 04 zentyal_cork2011 04 zentyal_cork
2011 04 zentyal_cork
OpenSourceLGMA
 
Moby and linux kit, what to expect - Lorenzo Fontana, DevOps Expert at Kiratech
Moby and linux kit, what to expect - Lorenzo Fontana, DevOps Expert at KiratechMoby and linux kit, what to expect - Lorenzo Fontana, DevOps Expert at Kiratech
Moby and linux kit, what to expect - Lorenzo Fontana, DevOps Expert at Kiratech
Kiratech
 
Building Hopsworks, a cloud-native managed feature store for machine learning
Building Hopsworks, a cloud-native managed feature store for machine learning Building Hopsworks, a cloud-native managed feature store for machine learning
Building Hopsworks, a cloud-native managed feature store for machine learning
Jim Dowling
 
Zarafa SummerCamp 2012 - Migrating from Windows Servers to Linux with Zentyal...
Zarafa SummerCamp 2012 - Migrating from Windows Servers to Linux with Zentyal...Zarafa SummerCamp 2012 - Migrating from Windows Servers to Linux with Zentyal...
Zarafa SummerCamp 2012 - Migrating from Windows Servers to Linux with Zentyal...Zarafa
 
DockerCon EU 2015: The Latest in Docker Engine
DockerCon EU 2015: The Latest in Docker EngineDockerCon EU 2015: The Latest in Docker Engine
DockerCon EU 2015: The Latest in Docker Engine
Docker, Inc.
 
CoreOS and cloud provider integration: simple cloud-init example at Exoscale
CoreOS and cloud provider integration: simple cloud-init example at ExoscaleCoreOS and cloud provider integration: simple cloud-init example at Exoscale
CoreOS and cloud provider integration: simple cloud-init example at Exoscale
Antoine COETSIER
 
Containerday17 Moby-linuxkit-DockerCon-2017-announcements
Containerday17 Moby-linuxkit-DockerCon-2017-announcementsContainerday17 Moby-linuxkit-DockerCon-2017-announcements
Containerday17 Moby-linuxkit-DockerCon-2017-announcements
Kiratech
 
Rhel7 vs rhel6
Rhel7 vs rhel6Rhel7 vs rhel6
Rhel7 vs rhel6
Arunvignesh Venkatesh
 
DockerCon EU 2015 - The Latest on Docker Engine
DockerCon EU 2015 - The Latest on Docker EngineDockerCon EU 2015 - The Latest on Docker Engine
DockerCon EU 2015 - The Latest on Docker Engine
Arnaud Porterie
 
Linux Containers and Docker SHARE.ORG Seattle 2015
Linux Containers and Docker SHARE.ORG Seattle 2015Linux Containers and Docker SHARE.ORG Seattle 2015
Linux Containers and Docker SHARE.ORG Seattle 2015
Filipe Miranda
 
Developing and Deploying Microservices to IBM Cloud Private
Developing and Deploying Microservices to IBM Cloud PrivateDeveloping and Deploying Microservices to IBM Cloud Private
Developing and Deploying Microservices to IBM Cloud Private
Shikha Srivastava
 
Hybrid Cloud Tutorial Linkedin 2
Hybrid Cloud Tutorial Linkedin 2Hybrid Cloud Tutorial Linkedin 2
Hybrid Cloud Tutorial Linkedin 2
David Rilett
 
What's New in RHEL 6 for Linux on System z?
What's New in RHEL 6 for Linux on System z?What's New in RHEL 6 for Linux on System z?
What's New in RHEL 6 for Linux on System z?
IBM India Smarter Computing
 

Similar to Zentyal Customization (templates, hooks, LDAP) (20)

the NML project
the NML projectthe NML project
the NML project
 
How do I securely deploy Internet websites in PHP on my IBMi?
How do I securely deploy Internet websites in PHP on my IBMi?How do I securely deploy Internet websites in PHP on my IBMi?
How do I securely deploy Internet websites in PHP on my IBMi?
 
What's LUM Got To Do with It: Deployment Considerations for Linux User Manage...
What's LUM Got To Do with It: Deployment Considerations for Linux User Manage...What's LUM Got To Do with It: Deployment Considerations for Linux User Manage...
What's LUM Got To Do with It: Deployment Considerations for Linux User Manage...
 
korot_haim_en
korot_haim_enkorot_haim_en
korot_haim_en
 
Enea Linux and LWRT FTF China 2012
Enea Linux and LWRT FTF China 2012Enea Linux and LWRT FTF China 2012
Enea Linux and LWRT FTF China 2012
 
OSSNA18: Xen Beginners Training
OSSNA18: Xen Beginners Training OSSNA18: Xen Beginners Training
OSSNA18: Xen Beginners Training
 
Deploying Windows Apps to Kubernetes with Draft and Helm
Deploying Windows Apps to Kubernetes with Draft and HelmDeploying Windows Apps to Kubernetes with Draft and Helm
Deploying Windows Apps to Kubernetes with Draft and Helm
 
2011 04 zentyal_cork
2011 04 zentyal_cork2011 04 zentyal_cork
2011 04 zentyal_cork
 
Moby and linux kit, what to expect - Lorenzo Fontana, DevOps Expert at Kiratech
Moby and linux kit, what to expect - Lorenzo Fontana, DevOps Expert at KiratechMoby and linux kit, what to expect - Lorenzo Fontana, DevOps Expert at Kiratech
Moby and linux kit, what to expect - Lorenzo Fontana, DevOps Expert at Kiratech
 
Building Hopsworks, a cloud-native managed feature store for machine learning
Building Hopsworks, a cloud-native managed feature store for machine learning Building Hopsworks, a cloud-native managed feature store for machine learning
Building Hopsworks, a cloud-native managed feature store for machine learning
 
Zarafa SummerCamp 2012 - Migrating from Windows Servers to Linux with Zentyal...
Zarafa SummerCamp 2012 - Migrating from Windows Servers to Linux with Zentyal...Zarafa SummerCamp 2012 - Migrating from Windows Servers to Linux with Zentyal...
Zarafa SummerCamp 2012 - Migrating from Windows Servers to Linux with Zentyal...
 
DockerCon EU 2015: The Latest in Docker Engine
DockerCon EU 2015: The Latest in Docker EngineDockerCon EU 2015: The Latest in Docker Engine
DockerCon EU 2015: The Latest in Docker Engine
 
CoreOS and cloud provider integration: simple cloud-init example at Exoscale
CoreOS and cloud provider integration: simple cloud-init example at ExoscaleCoreOS and cloud provider integration: simple cloud-init example at Exoscale
CoreOS and cloud provider integration: simple cloud-init example at Exoscale
 
Containerday17 Moby-linuxkit-DockerCon-2017-announcements
Containerday17 Moby-linuxkit-DockerCon-2017-announcementsContainerday17 Moby-linuxkit-DockerCon-2017-announcements
Containerday17 Moby-linuxkit-DockerCon-2017-announcements
 
Rhel7 vs rhel6
Rhel7 vs rhel6Rhel7 vs rhel6
Rhel7 vs rhel6
 
DockerCon EU 2015 - The Latest on Docker Engine
DockerCon EU 2015 - The Latest on Docker EngineDockerCon EU 2015 - The Latest on Docker Engine
DockerCon EU 2015 - The Latest on Docker Engine
 
Linux Containers and Docker SHARE.ORG Seattle 2015
Linux Containers and Docker SHARE.ORG Seattle 2015Linux Containers and Docker SHARE.ORG Seattle 2015
Linux Containers and Docker SHARE.ORG Seattle 2015
 
Developing and Deploying Microservices to IBM Cloud Private
Developing and Deploying Microservices to IBM Cloud PrivateDeveloping and Deploying Microservices to IBM Cloud Private
Developing and Deploying Microservices to IBM Cloud Private
 
Hybrid Cloud Tutorial Linkedin 2
Hybrid Cloud Tutorial Linkedin 2Hybrid Cloud Tutorial Linkedin 2
Hybrid Cloud Tutorial Linkedin 2
 
What's New in RHEL 6 for Linux on System z?
What's New in RHEL 6 for Linux on System z?What's New in RHEL 6 for Linux on System z?
What's New in RHEL 6 for Linux on System z?
 

Recently uploaded

FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 

Zentyal Customization (templates, hooks, LDAP)

  • 1. How to customize Zentyal (hooks, templates and LDAP) Zentyal Summit 2011 12th November Carlos Pérez-Aradros <cperez@zentyal.com> Linux small business server
  • 2. Linux small business server Zentyal... Easy to use Good integration Versatile ...but sometimes you need Some specific customization Integration with external apps www.zentyal.com © eBox Technologies S.L. 2011
  • 3. Linux small business server Customization options Modify source code Add new logic or functionality Breaks on upgrade Upstream! Templates Change configuration files written by Zentyal Hooks Define custom actions (scripts) on module events LDAP Integrate external applications www.zentyal.com © eBox Technologies S.L. 2011
  • 4. Linux small business server Customization options Modify source code Add new logic or functionality Breaks on upgrade Templates Change configuration files written by Zentyal Hooks Define custom actions (scripts) on module events LDAP Integrate external applications www.zentyal.com © eBox Technologies S.L. 2011
  • 5. Linux small business server Templates (I) Zentyal uses templates to write system configurations files Modify templates to: Adjust parameters to adapt Zentyal to your requirements Add/remove configuration options www.zentyal.com © eBox Technologies S.L. 2011
  • 6. Linux small business server Templates (II) Mason as template processor www.zentyal.com © eBox Technologies S.L. 2011
  • 7. Linux small business server Templates (III) Default templates location: /usr/share/zentyal/stubs/<module>/<template>.mas Custom templates: /etc/zentyal/stubs/<module>/<template>.mas www.zentyal.com © eBox Technologies S.L. 2011
  • 8. Linux small business server Templates (IV) Default stub /usr/share/zentyal/stubs/network/resolv.conf.mas T Conf file /etc/resolv.conf T Custom stub /etc/zentyal/stubs/network/resolv.conf.mas www.zentyal.com © eBox Technologies S.L. 2011
  • 9. Linux small business server Templates example: Samba hidden folders We want to add a hidden folder in File Sharing module (samba) Zentyal GUI doesn't allow this: www.zentyal.com © eBox Technologies S.L. 2011
  • 10. Linux small business server Templates example: Samba hidden folders Copy and edit default template: mkdir -p /etc/zentyal/stubs/samba/ cp /usr/share/zentyal/stubs/samba/smb.conf.mas /etc/zentyal/stubs/samba/ Write custom configuration www.zentyal.com © eBox Technologies S.L. 2011
  • 11. Linux small business server Customization options Modify source code Add new logic or functionality Breaks on upgrade Templates Change configuration files written by Zentyal Hooks Define custom actions (scripts) on module events LDAP Integrate external applications www.zentyal.com © eBox Technologies S.L. 2011
  • 12. Linux small business server Hooks (I) Execute actions (scripts) during Zentyal save changes process Create hook scripts to: Watch for changes in any module Add custom scripts before/after module actions www.zentyal.com © eBox Technologies S.L. 2011
  • 13. Linux small business server Hooks (II): paths Before saving changes /etc/zentyal/pre-save/ After saving changes /etc/zentyal/post-save/ /etc/zentyal/hooks/ Before saving module configuration <module>.presetconf After saving module configuration <module>.postsetconf Before restarting the service <module>.preservice After restarting the service <module>.postservice www.zentyal.com © eBox Technologies S.L. 2011
  • 14. Linux small business server one time for each module Hooks (III) pre-save .presetconf Write conf files .postsetconf .preservice Restart daemons .postservice hook post-save Zentyal action www.zentyal.com © eBox Technologies S.L. 2011
  • 15. Linux small business server Hooks Example: Firewall We want to block traffic from a specific country (using GeoIP) Zentyal GUI does not allow this kind of rules If we add the rule by hand: Firewall module restart will delete it Solution: Add the rule after firewall restart (postservice hook) www.zentyal.com © eBox Technologies S.L. 2011
  • 16. Linux small business server Hooks Example: Firewall Setup GeoIP sudo apt-get install module-assistant sudo module-assistant a-i xtables-addons wget http://sourceforge.net/projects/xtables- addons/files/Xtables-addons/1.38/xtables-addons-1.38.tar.xz sudo ./xt_geoip_dl sudo ./xt_geoip_build *.csv sudo mkdir /var/geoip && sudo cp -r LE /var/geoip www.zentyal.com © eBox Technologies S.L. 2011
  • 17. Linux small business server Hooks Example: Firewall Create the hook /etc/zentyal/hooks/firewall.postservice #!/bin/sh sudo iptables -I INPUT -m geoip --src-cc KP -j ACCEPT Don't forget to make it executable! chmod +x /etc/zentyal/hooks/firewall.postservice www.zentyal.com © eBox Technologies S.L. 2011
  • 18. Linux small business server Hooks: Future (3.0) Users operations hooks create modify delete Backup pre-backup post-backup www.zentyal.com © eBox Technologies S.L. 2011
  • 19. Linux small business server Customization options Modify source code Add new logic or functionality Breaks on upgrade Templates Change configuration files written by Zentyal Hooks Define custom actions (scripts) on module events LDAP Integrate external applications www.zentyal.com © eBox Technologies S.L. 2011
  • 20. Linux small business server LDAP Integration (I) Zentyal provides great Users and Groups management LDAP integration: Central point for users management Centralized authentication Distributed: master / slave architecture www.zentyal.com © eBox Technologies S.L. 2011
  • 21. Linux small business server LDAP Integration (II) Integrate third apps with Zentyal Users and Groups www.zentyal.com © eBox Technologies S.L. 2011
  • 22. Linux small business server LDAP Integration (II): settings Users and Groups → LDAP Settings Server: ldap://localhost:389/ (port 1389 in slaves) Users DN: ou=Users,<basedn> Groups DN: ou=Groups,<basedn> www.zentyal.com © eBox Technologies S.L. 2011
  • 23. Linux small business server LDAP Integration (III): filters uid=cperez,ou=Users,dc=zentyal,dc=com uid: cperez Base DN: ou=Users,dc=zentyal,dc=com loginShell: /usr/sbin/nologin uidNumber: 2002 Filter: (uid=*) gidNumber: 1901 homeDirectory: /home/cperez objectClass: inetOrgPerson objectClass: posixAccount objectClass: passwordHolder cn=developers,ou=Groups,dc=zentyal,dc=com givenName: Carlos cn: developers userPassword: {SHA}... gidNumber: 2005 eboxSha1Password: {SHA}... objectClass: posixGroup eboxMd5Password: {MD5}... memberUid: cperez eboxDigestPassword: {MD5}... memberUid: jsalamero eboxRealmPassword: {MD5}... memberUid: ejhernandez cn:; Carlos Pérez-Aradros Herce memberUid: jacalvo memberUid: jamor sn:; Pérez-Aradros Herce ... www.zentyal.com © eBox Technologies S.L. 2011 c
  • 24. Linux small business server LDAP Integration example: Wordpress www.zentyal.com © eBox Technologies S.L. 2011
  • 25. Linux small business server LDAP Integration example: Wordpress Look for a LDAP Auth backend www.zentyal.com © eBox Technologies S.L. 2011
  • 26. Linux small business server LDAP Integration example: Wordpress www.zentyal.com © eBox Technologies S.L. 2011
  • 27. Linux small business server In summary Modify source code Add new logic or functionality Breaks on upgrade Upstream! Templates Change configuration files written by Zentyal Hooks Define custom actions (scripts) on module events LDAP Integrate external applications www.zentyal.com © eBox Technologies S.L. 2011
  • 28. Linux small business server Get help Zentyal Support Forum http://forum.zentyal.org Users and Developers mailing lists https://lists.zentyal.com/cgi-bin/mailman/listinfo/zentyal-devel https://lists.zentyal.com/cgi-bin/mailman/listinfo/zentyal-users IRC #zentyal at freenode.net Official support and training http://www.zentyal.com/en/services/ Contribute! www.zentyal.com © eBox Technologies S.L. 2011
  • 29. Linux small business server Further reading... Zentyal Documentation - Advanced Service Customisation http://doc.zentyal.org/en/develop.html Mason Documentation (Templates) http://www.masonhq.com/docs/manual/Devel.html xtables addons http://xtables-addons.sourceforge.net/ Openldap filters doc http://www.zytrax.com/books/ldap/apa/search.html www.zentyal.com © eBox Technologies S.L. 2011
  • 30. Linux small business server www.zentyal.com ? © eBox Technologies S.L. 2011