• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    mysql open ports on FOG server

    Scheduled Pinned Locked Moved
    General
    3
    13
    1.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      DBCountMan @george1421
      last edited by DBCountMan

      @george1421 We dont have Storage Nodes (yet). But I do run a cronjob on my secondary FOG server that pulls mysql db from the primary, basic backup job. Will locking down the mysql port prevent this function?

      george1421G 1 Reply Last reply Reply Quote 0
      • george1421G
        george1421 Moderator @DBCountMan
        last edited by

        @brakcounty said in mysql open ports on FOG server:

        Will locking down the mysql port prevent this function?

        It depends on how you collect the info from the primary database? If you are using sqldump running on the primary server and then using scp to copy the information over to the secondary then it should be OK to lock down the port. If you are using sqldump on this server to push the info to the remote server using the mysql protocol then you will run into an issue.

        Having an open port 3306 allows external devices to communicate with the mysql database and your fog instance if a weak password was used. FOG doesn’t use weak passwords so this would have been someone you would have done.

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

        D 1 Reply Last reply Reply Quote 1
        • D
          DBCountMan @george1421
          last edited by

          @george1421 These are the commands that I run on my secondary to pull from the primary:

          mysqldump --defaults-file=/root/.my.cnf -h fogserver -u fogstorage fog hosts hostMAC moduleStatusByHost --single-transaction > /root/fog_hosts.sql
          mysqldump --defaults-file=/root/.my.cnf -h fogserver -u fogstorage fog images --single-transaction > /root/fog_images.sql
          
          
          george1421G 1 Reply Last reply Reply Quote 0
          • george1421G
            george1421 Moderator @DBCountMan
            last edited by george1421

            @brakcounty yes that uses port 3306. If you have a debian or ubuntu based fog server you can create a ufw rule to only allow fog server 2 to communicate with fog server 1 on port 3306

            something like

            ufw allow from <fog_server_2_ip> to any port 3306 proto tcp
            

            That command would be run on fog server #1 FOG server #2 doesn’t need port 3306 unless you are connecting to it from server 3.

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

            D 3 Replies Last reply Reply Quote 0
            • D
              DBCountMan @george1421
              last edited by DBCountMan

              @george1421 Oh ok perfect! I’d do that on the primary FOG server right?

              EDIT didnt see your example. Thanks!

              1 Reply Last reply Reply Quote 0
              • D
                DBCountMan @george1421
                last edited by

                @george1421 If I enable ufw, that means I would also have to define rules to allow other things such as ssh, nfs, and http right?

                Wayne WorkmanW 1 Reply Last reply Reply Quote 0
                • Wayne WorkmanW
                  Wayne Workman @DBCountMan
                  last edited by Wayne Workman

                  @brakcounty I’d suggest doing some internet searching before asking general linux questions.

                  https://duckduckgo.com/?q=ubuntu+ufw+default+rules&t=ffab&ia=web

                  First result and second result both have the answer.

                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!
                  Daily Clean Installation Results:
                  https://fogtesting.fogproject.us/
                  FOG Reporting:
                  https://fog-external-reporting-results.fogproject.us/

                  D 1 Reply Last reply Reply Quote 0
                  • D
                    DBCountMan @Wayne Workman
                    last edited by

                    @wayne-workman Thanks. Sorry about that.

                    1 Reply Last reply Reply Quote 0
                    • D
                      DBCountMan @george1421
                      last edited by DBCountMan

                      @george1421 Is there a document or list of ports/services that FOG requires to be allowed on a firewall?

                      george1421G 1 Reply Last reply Reply Quote 0
                      • george1421G
                        george1421 Moderator @DBCountMan
                        last edited by

                        @brakcounty Here is a list that one of the developers created a while ago. Its still relevant so you should be able to use it as a basis of your settings:
                        https://forums.fogproject.org/topic/6162/firewall-configuration

                        If you use multicast imaging then you will need to take some additional steps.

                        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                        D 1 Reply Last reply Reply Quote 0
                        • D
                          DBCountMan @george1421
                          last edited by DBCountMan

                          @george1421 Got it. I set up the rules using ufw with the ports from that list. I only tested a Full Reg and Inv so far. It hangs on Running Init Scripts for while then skips it, I think that is the script that pulls the serial number from the bios and auto-populates it as the hostname. I confirmed this when I disabled ufw and that step went right through without delay.

                          1 Reply Last reply Reply Quote 0
                          • 1 / 1
                          • First post
                            Last post

                          219

                          Online

                          12.0k

                          Users

                          17.3k

                          Topics

                          155.2k

                          Posts
                          Copyright © 2012-2024 FOG Project