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

mysql open ports on FOG server

Scheduled Pinned Locked Moved
General
3
13
1.4k
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
    last edited by May 18, 2022, 8:10 PM

    Doing some routine security checkups on our FOG server. Noticed the mysql TCP 3306 is open. Does this need to be open for FOG to function properly?

    G 1 Reply Last reply May 18, 2022, 9:12 PM Reply Quote 0
    • G
      george1421 Moderator @DBCountMan
      last edited by May 18, 2022, 9:12 PM

      @brakcounty if you have storage nodes, yes. If you only have one fog server then no it doesn’t need to be open. If you need to clamp down on that port you can define firewall rules to limit who/what can connect to that port.

      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 May 19, 2022, 3:52 PM Reply Quote 0
      • D
        DBCountMan @george1421
        last edited by DBCountMan May 19, 2022, 10:20 AM May 19, 2022, 3:52 PM

        @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?

        G 1 Reply Last reply May 19, 2022, 4:46 PM Reply Quote 0
        • G
          george1421 Moderator @DBCountMan
          last edited by May 19, 2022, 4:46 PM

          @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 May 19, 2022, 5:10 PM Reply Quote 1
          • D
            DBCountMan @george1421
            last edited by May 19, 2022, 5:10 PM

            @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
            
            
            G 1 Reply Last reply May 19, 2022, 5:28 PM Reply Quote 0
            • G
              george1421 Moderator @DBCountMan
              last edited by george1421 May 19, 2022, 11:30 AM May 19, 2022, 5:28 PM

              @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 May 19, 2022, 5:30 PM Reply Quote 0
              • D
                DBCountMan @george1421
                last edited by DBCountMan May 19, 2022, 11:31 AM May 19, 2022, 5:30 PM

                @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 May 19, 2022, 7:47 PM

                  @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?

                  W 1 Reply Last reply May 20, 2022, 2:01 AM Reply Quote 0
                  • W
                    Wayne Workman @DBCountMan
                    last edited by Wayne Workman May 19, 2022, 8:03 PM May 20, 2022, 2:01 AM

                    @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 May 20, 2022, 1:37 PM Reply Quote 0
                    • D
                      DBCountMan @Wayne Workman
                      last edited by May 20, 2022, 1:37 PM

                      @wayne-workman Thanks. Sorry about that.

                      1 Reply Last reply Reply Quote 0
                      • D
                        DBCountMan @george1421
                        last edited by DBCountMan May 20, 2022, 8:04 AM May 20, 2022, 1:57 PM

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

                        G 1 Reply Last reply May 20, 2022, 2:42 PM Reply Quote 0
                        • G
                          george1421 Moderator @DBCountMan
                          last edited by May 20, 2022, 2:42 PM

                          @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 May 20, 2022, 7:55 PM Reply Quote 0
                          • D
                            DBCountMan @george1421
                            last edited by DBCountMan May 20, 2022, 2:00 PM May 20, 2022, 7:55 PM

                            @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
                            1 / 1
                            • First post
                              2/13
                              Last post

                            205

                            Online

                            12.0k

                            Users

                            17.3k

                            Topics

                            155.2k

                            Posts
                            Copyright © 2012-2024 FOG Project