Skip to contentSkip to conversation

Time based rules ...

DISCUSSION Raymond Leach 5 participants 8 messages Nov 13, 2002 – Nov 14, 2002

lore
Share & tools
lore
#0 lore raw

Hi

Is there a way to put time restrictions on rules?
For eaxmple, something like:

iptables -A FORWARD -i eth0 -p tcp -sport 1024: -dport 1024: -time 0700:1700 -j DROP

It would be nice ...

Ray

#1 lore raw

Couldn't you just use a CRON job to add and remove that rule at the required times?

-- Chris

Quoted 12 lines · Raymond Leach

Hi

Is there a way to put time restrictions on rules?
For eaxmple, something like:

iptables -A FORWARD -i eth0 -p tcp -sport 1024: -dport 1024: -time 0700:1700 -j DROP

It would be nice ...

Ray

#2 lore raw
Quoted 3 lines · Chris Poupart

Couldn't you just use a CRON job to add and remove that rule at the required times?

Well that's what I'm doing, but it gets cumbersome when you have multiple timeslots for different days, e.g. Weekends.

Quoted 15 lines

-- Chris

Quoted 12 lines · Raymond Leach

Hi

Is there a way to put time restrictions on rules?
For eaxmple, something like:

iptables -A FORWARD -i eth0 -p tcp -sport 1024: -dport 1024: -time 0700:1700 -j DROP

It would be nice ...

Ray

#4 lore raw
In reply to Dharmendra.T

Hi

Yes, all my chains default policies are set to DROP.

I believe in taking the paranoid approach to security: assume everything is bad and then only allow what you know to go where you want it to. I'm sure you know the cliche by now :- 'where do you want to go today?'

On Linux we know where we want to go ...

Ray

Quoted 19 lines · Dharmendra.T

What is the default polic you have set for? I guess it is by dropping all the packets froom the forward chain and then you are allowing accordingly. Regards,
Dharmendra.T
Linux Security Expert
www.nsecure.net
[email protected]

Quoted 11 lines · Raymond Leach

Hi

Is there a way to put time restrictions on rules?
For eaxmple, something like:

iptables -A FORWARD -i eth0 -p tcp -sport 1024: -dport 1024: -time 0700:1700 -j DROP

It would be nice ...

Ray

#3 lore raw
In reply to Raymond Leach

What is the default polic you have set for? I guess it is by dropping all the packets froom the forward chain and then you are allowing accordingly. Regards,
Dharmendra.T
Linux Security Expert
www.nsecure.net
[email protected]

Quoted 11 lines · Raymond Leach

Hi

Is there a way to put time restrictions on rules?
For eaxmple, something like:

iptables -A FORWARD -i eth0 -p tcp -sport 1024: -dport 1024: -time 0700:1700 -j DROP

It would be nice ...

Ray

#5 lore raw
In reply to Raymond Leach

But I don't think we can specify the time option in iptables. If any modules are there using which we can specify the time let us know.

Regards,
Dharmendra.T
Linux Security Expert
www.nsecure.net
[email protected]

Quoted 33 lines · Raymond Leach

Hi

Yes, all my chains default policies are set to DROP.

I believe in taking the paranoid approach to security: assume everything is bad and then only allow what you know to go where you want it to. I'm sure you know the cliche by now :- 'where do you want to go today?'

On Linux we know where we want to go ...

Ray

Quoted 20 lines · Dharmendra.T

What is the default polic you have set for? I guess it is by dropping all the packets froom the forward chain and then you are allowing accordingly. Regards,
Dharmendra.T
Linux Security Expert
www.nsecure.net
[email protected]

Quoted 11 lines · Raymond Leach

Hi

Is there a way to put time restrictions on rules?
For eaxmple, something like:

iptables -A FORWARD -i eth0 -p tcp -sport 1024: -dport 1024: -time 0700:1700 -j DROP

It would be nice ...

Ray

#6 lore raw

Hi,

Quoted 3 lines · Dharmendra.T

But I don't think we can specify the time option in iptables. If any modules are there using which we can specify the time let us know. [...]

You can have a look at:
http://www.netfilter.org/documentation/HOWTO/netfilter-extensions-HOWTO.html
and particularly at :
http://www.netfilter.org/documentation/HOWTO/netfilter-extensions-HOWTO-3.html#ss3.17

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines · Raymond Leach
Quoted 7 lines

Hi
Is there a way to put time restrictions on rules?
For eaxmple, something like:
iptables -A FORWARD -i eth0 -p tcp -sport 1024: -dport 1024: -time 0700:1700 -j DROP
It would be nice ...
Ray

Have a nice day,

Fabrice.
--
Fabrice MARIE

"Silly hacker, root is for administrators"
-Unknown

#7 lore raw
In reply to Dharmendra.T

yes

P-O-m support the time module

please check the Netfilter

hare
----- Original Message -----
From: "Dharmendra.T" <[email protected]>
To: "Raymond Leach" <[email protected]>
Cc: "Netfilter Mailing List" <[email protected]>
Sent: Thursday, November 14, 2002 11:44 AM
Subject: Re: Time based rules ...

Quoted 1 line

But I don't think we can specify the time option in iptables. If any

modules

Quoted 22 lines

are there using which we can specify the time let us know.

Regards,
Dharmendra.T
Linux Security Expert
www.nsecure.net
[email protected]

Quoted 14 lines · Raymond Leach

Hi

Yes, all my chains default policies are set to DROP.

I believe in taking the paranoid approach to security: assume everything is bad and then only allow what you know to go where you want it to. I'm sure you know the cliche by now :- 'where do you want to go today?'

On Linux we know where we want to go ...

Ray

Quoted 1 line · Dharmendra.T

What is the default polic you have set for? I guess it is by dropping

all

Quoted 24 lines
Quoted 13 lines
Quoted 13 lines

the packets froom the forward chain and then you are allowing accordingly. Regards,
Dharmendra.T
Linux Security Expert
www.nsecure.net
[email protected]

Quoted 5 lines · Raymond Leach

Hi

Is there a way to put time restrictions on rules?
For eaxmple, something like:

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

iptables -A FORWARD -i eth0 -p tcp -sport 1024: -dport 1024: -time 0700:1700 -j DROP

It would be nice ...

Ray

--