Author Topic: block sites between 9:00-17:00  (Read 4175 times)

madhacker

  • Zen Apprentice
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
block sites between 9:00-17:00
« on: January 24, 2011, 01:11:47 pm »
Hi
Could someone please help me, I downloaded the latest version of Zentyal and have it running on my server in the office.

But what i would like to know if anyone could take through it step by step on how to block site between a time period"

At the monent i have the proxy in transparent mode, i dont know if thats could be an issue.

 ??? ??? ???

So if anyone could be so kind as to help me with is .

Regards
Brad

Evadido

  • Zen Apprentice
  • *
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: block sites between 9:00-17:00
« Reply #1 on: February 24, 2011, 05:32:22 pm »
Hi,

I have exactly the same problem. I have to configure two different set of proxy restrictions depending on the time.

Could someone give us a clue?

Thanks :)

Sam Graf

  • Guest
Re: block sites between 9:00-17:00
« Reply #2 on: February 24, 2011, 08:52:31 pm »
I'm not sure these are exactly the same problem. If I'm following right, there's one case where at least some sites have to be blocked for some Object during a specified period of time, and one case where two filters profiles have to be available to some Object at different times of the day. I'm not sure the latter case can be done from the Zentyal GUI.

Maybe I'm misunderstanding, though ...

Evadido

  • Zen Apprentice
  • *
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: block sites between 9:00-17:00
« Reply #3 on: February 25, 2011, 12:11:35 pm »
I'm not sure these are exactly the same problem. If I'm following right, there's one case where at least some sites have to be blocked for some Object during a specified period of time, and one case where two filters profiles have to be available to some Object at different times of the day. I'm not sure the latter case can be done from the Zentyal GUI.

Maybe I'm misunderstanding, though ...

I think both cases can be resolved with cron tasks, replacing some configuration files and restarting the service, but I would like to know which files to replace without breaking zentyal, as afaik, zentyal has its own configuration files that overwrites the os configuration.

Thank you! :)

Sam Graf

  • Guest
Re: block sites between 9:00-17:00
« Reply #4 on: February 25, 2011, 03:35:34 pm »
I think the OP's case can be done using stock Zentyal features, though it may depend on what's being blocked. Cases requiring slicing up 24 hours into more than two pieces look (to me) problematic.

Zentyal overwrites the configuration for only those services it manages, if I understand it right. Unmanaged services can run side-by-side with Zentyal and not be disturbed. If you come up with a solution, I'm guessing others in the community would benefit from knowing how you made it work. :)

Evadido

  • Zen Apprentice
  • *
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: block sites between 9:00-17:00
« Reply #5 on: October 14, 2011, 01:17:34 pm »
I tried it with backups:

- Configured the proxy in a restrictive way
- Got a configuration backup (system->backups->configuration)
- Configured the proxy "open"
- Got another configuration backup
- Then, I programmed two cron jobs:

/etc/init.d/ebox stop && /usr/share/ebox/ebox-restore-backup restrictive.tar && /etc/init.d/ebox start

/etc/init.d/ebox stop && /usr/share/ebox/ebox-restore-backup open.tar && /etc/init.d/ebox start

It simply wont work, some ideas???

christian

  • Guest
Re: block sites between 9:00-17:00
« Reply #6 on: October 14, 2011, 01:46:12 pm »
Can't you both define windows during which you want access to be authorized (because default is "deny")  ???

Evadido

  • Zen Apprentice
  • *
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: block sites between 9:00-17:00
« Reply #7 on: October 24, 2011, 09:23:09 pm »
I got it!!!!!!!!

Finally I found the solution:

- Configure your first ruleset and save changes
- Execute /usr/share/zentyal/make-backup
- Move the file created to, by example, /home/youruser/first.tar
- Configure your second ruleset and save changes again
- Execute /usr/share/zentyal/make-backup
- Move the file created to /home/youruser/second.tar
- Open your /etc/crontab and add these two tasks:

10 10 * * * root /usr/share/zentyal/restore-backup /home/youruser/first.tar && /usr/share/zentyal/global-action --action saveAllModules
20 20 * * * root /usr/share/zentyal/restore-backup /home/youruser/first.tar && /usr/share/zentyal/global-action --action saveAllModules

restart cron

And you're done! :)