Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Squid Guard, immediately disable local account on visiting blocked sites?

    Scheduled Pinned Locked Moved pfSense Packages
    5 Posts 2 Posters 1.4k Views
    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
      danielupton
      last edited by

      Hi Everyone,

      We are in the process of deploying a wireless network in our church governed by an instance of pfSense.

      Our primary need is a content filter (for obvious reasons  :P).
      We also intend on using captive portal, authenticated via the local users directory.

      Is it possible using SquidGuard or any other content filter available on pfSense.. to immediately revoke a users access (disable their account or block their MAC address) as soon as they visit any blacklisted site?

      I have a hacky solution (getting SquidGuard to redirect to a custom PHP script).
      But its far from elegant!

      Thanks!

      • Daniel
      1 Reply Last reply Reply Quote 0
      • D
        dvserg
        last edited by

        Is it possible using SquidGuard or any other content filter available on pfSense.. to immediately revoke a users access

        For you situation this is the best way.

        SquidGuardDoc EN  RU Tutorial
        Localization ru_PFSense

        1 Reply Last reply Reply Quote 0
        • D
          danielupton
          last edited by

          Hi dvserg,

          Thanks for your prompt reply!
          Not quite sure I understand what you mean though  :P

          1 Reply Last reply Reply Quote 0
          • D
            dvserg
            last edited by

            I have a hacky solution (getting SquidGuard to redirect to a custom PHP script).

            You method very good as solution for  problem.

            SquidGuardDoc EN  RU Tutorial
            Localization ru_PFSense

            1 Reply Last reply Reply Quote 0
            • D
              danielupton
              last edited by

              Oh I see.. Thanks!  :D

              I've been doing a bit of digging around in the pfSense source code and I think locking the account using

              
              exec("/usr/sbin/pw lock {$user_name} -q");
              
              

              And setting the user's shell to "/sbin/nologin" should be sufficient.

              Does anyone know of an existing function / better way to do this? (guessing not as I stole my code from https://github.com/bsdperimeter/pfsense/blob/master/etc/inc/auth.inc#L457)

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.