Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to limit conf t to only interface
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  11 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
rthl  
View profile  
 More options Nov 8 2012, 1:15 am
From: rthl <robert.hamm...@gmx.de>
Date: Wed, 7 Nov 2012 22:15:02 -0800 (PST)
Local: Thurs, Nov 8 2012 1:15 am
Subject: How to limit conf t to only interface

Hello Marc,

first thanks for the software!

Is it possible to limit a tacacs-group to only configure interfaces and
prohibit the rest of the configure options?

bw

Robert


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marc Huber  
View profile  
 More options Nov 8 2012, 1:30 am
From: Marc Huber <marc.j.hu...@googlemail.com>
Date: Thu, 08 Nov 2012 07:30:46 +0100
Local: Thurs, Nov 8 2012 1:30 am
Subject: Re: How to limit conf t to only interface
Hi Robert,

On 08.11.12 07:15, rthl wrote:

> Is it possible to limit a tacacs-group to only configure interfaces
> and prohibit the rest of the configure options?

yes, it is -- with certain restrictions (the most important being that
the "single-connection" flag needs to be set in your router's TACACS+
server definition).

Please have a look at the "CLI Contexts" chapter in the documentation.
The example given there should cover your use case.

Cheers,

Marc


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rthl  
View profile  
 More options Nov 8 2012, 2:11 am
From: rthl <robert.hamm...@gmx.de>
Date: Wed, 7 Nov 2012 23:11:26 -0800 (PST)
Local: Thurs, Nov 8 2012 2:11 am
Subject: Re: How to limit conf t to only interface

Hi Marc,

i defined already single-connection, also in the tac_plus.cfg. But I didn't
understand how to put the configure-command in the context - I can
configure as cmd - and then?

Thanks
Robert

Am Donnerstag, 8. November 2012 07:30:50 UTC+1 schrieb Marc Huber:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marc Huber  
View profile  
 More options Nov 8 2012, 2:35 am
From: Marc Huber <marc.j.hu...@googlemail.com>
Date: Thu, 08 Nov 2012 08:35:18 +0100
Local: Thurs, Nov 8 2012 2:35 am
Subject: Re: How to limit conf t to only interface
Hi Robert,

On 08.11.12 08:11, rthl wrote:

> i defined already single-connection, also in the tac_plus.cfg. But I
> didn't understand how to put the configure-command in the context - I
> can configure as cmd - and then?

the TACACS+ protocol itself doesn't know or care about the CLI context
on the router. The daemon just sees the command sequence entered by the
user and sets the context variable accordingly, using the build-in
minimalistic scripting language. To quote the example from the docs:

     service = shell {
         default cmd = permit
         set priv-lvl = 15
         script = {
             if (cmd == "") permit # shell startup

             if (cmd =~ /^interface FastEthernet 0\/1 /) {
                 message = "Context has been set. \"[no] shut\" should
work for you."
                 context = FE
                 permit
             } else if (cmd =~ /^interface/){
                 message = "Context has been reset."
                 context = ""
                 permit
             }
             if (context == FE) {
                 if (cmd =~ /^shutdown/) permit
                 if (cmd =~ /^no shutdown/) permit
                 deny
             }
         }
         cmd = shutdown { deny . }
         cmd = no { deny /^shutdown/ }
     }

This service definition sets the current CLI session context to "FE" if
Fa0/1 interface context is entered via the CLI ("interface FastEthernet
0/1") and resets context if a different interface gets selected. "(no)
shut" is permitted only if context is set to "FE". The generic "cmd =
shutdown..."/"cmd = no ..." statements are just there to cover the case
where single-connection isn't active.

Cheers,

Marc


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rthl  
View profile  
 More options Nov 8 2012, 3:43 am
From: rthl <robert.hamm...@gmx.de>
Date: Thu, 8 Nov 2012 00:43:45 -0800 (PST)
Local: Thurs, Nov 8 2012 3:43 am
Subject: Re: How to limit conf t to only interface

> Hi Marc,

I don't get it. The problem is, how can I set the context for the conf t
command? my config looks like

group = admins{
#default service = permit
service = shell{
set priv-lvl = 15
default cmd = deny
cmd = show {
permit .*

}

script = {
if (cmd == "") permit # shell startup
 if (cmd == configure) {
if (cmd == terminal) permit
deny
}

 if (cmd =~ /^interface/) {
message = "Context interface gesetzt - Konfig moeglich"
context = FE
permit
} else {

message = "Context zurueckgesetzt"
context = ""
deny
}

if (context == FE){
 permit
}
} # end Script
} # end Shell
} # end group tk-admins

 }

I had the "configure" command already out of the script, but either I can
use "configure t" and then I can configure everything, or I don't get
configure at all.
But how can I permit "configure t" and then set the context to
"interface"???

bw
Robert


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marc Huber  
View profile  
 More options Nov 8 2012, 4:04 am
From: Marc Huber <marc.j.hu...@googlemail.com>
Date: Thu, 08 Nov 2012 10:04:31 +0100
Local: Thurs, Nov 8 2012 4:04 am
Subject: Re: How to limit conf t to only interface
Hi Robert,

On 08.11.12 09:43, rthl wrote:

> But how can I permit "configure t" and then set the context to
> "interface"???

you can't. The TACACS+ protocol simply doesn't provide that option. You
can permit "configure terminal" and use the embedded scripting language
to permit/deny commands based on context (which is based on previous
authorization requests matching the CLI session). CLI commands need to
be entered by the user. Very simple (single-line) commands (show ...)
can be set using the "autocmd" attribute, but that won't be sufficient.

Cheers,

Marc


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rthl  
View profile  
 More options Nov 8 2012, 9:57 am
From: rthl <robert.hamm...@gmx.de>
Date: Thu, 8 Nov 2012 06:57:00 -0800 (PST)
Subject: Re: How to limit conf t to only interface

OK, I keep trying, you don't have a working example?

One other question: with trying on and on, I noticed that the configured
banners are completely ignored.

Config:
 host = 0.0.0.0/0 {
  key = cisco
  prompt = "Hallo"
  motd banner = "Hallo"
  welcome banner = "Hallo %%u from %%c/n"
  }

Using SSHv2, logging in the NAS only the preconfigured standard motd banner
is displayed.

any ideas

Robert

Am Donnerstag, 8. November 2012 10:04:35 UTC+1 schrieb Marc Huber:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marc Huber  
View profile  
 More options Nov 8 2012, 10:18 am
From: Marc Huber <marc.j.hu...@googlemail.com>
Date: Thu, 08 Nov 2012 16:18:54 +0100
Local: Thurs, Nov 8 2012 10:18 am
Subject: Re: How to limit conf t to only interface
Hi Robert,

On 08.11.12 15:57, rthl wrote:

> OK, I keep trying, you don't have a working example?

sure, the one I've sent in my previous mail.

> Using SSHv2, logging in the NAS only the preconfigured standard motd
> banner is displayed.

The banners work for telnet to stock IOS devices. Everything else (ssh,
or non-IOS systems) may or may not work as expected. This pretty much
depends on the client code on the router, but I've serious doubts that
opening a case would help.

Cheers,

Marc


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rthl  
View profile  
 More options Nov 8 2012, 10:32 am
From: rthl <robert.hamm...@gmx.de>
Date: Thu, 8 Nov 2012 07:32:31 -0800 (PST)
Local: Thurs, Nov 8 2012 10:32 am
Subject: Re: How to limit conf t to only interface

Ok, thanks, searching the web makes me think that cisco has some problems
with banners and ssh.

Robert

Am Donnerstag, 8. November 2012 16:18:58 UTC+1 schrieb Marc Huber:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
rthl  
View profile  
 More options Nov 9 2012, 8:52 am
From: rthl <robert.hamm...@gmx.de>
Date: Fri, 9 Nov 2012 05:52:33 -0800 (PST)
Local: Fri, Nov 9 2012 8:52 am
Subject: Re: How to limit conf t to only interface

Hallo Marc,

one more thing: right now I even can't get the examples to work. It get's
more difficult, as the changes in the config aren't active at once, also I
have no idea why (posted it already).
It already has problems with the regexes. I tried to compile with PCRE, but
seems not to work. It complains already at the configure-statement, when I
try to give the pcre-options.

How can I check the compiled program, which regex it uses?

Thanks Robert

Am Donnerstag, 8. November 2012 07:15:02 UTC+1 schrieb rthl:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marc Huber  
View profile  
 More options Nov 9 2012, 12:00 pm
From: Marc Huber <marc.j.hu...@googlemail.com>
Date: Fri, 09 Nov 2012 18:00:39 +0100
Local: Fri, Nov 9 2012 12:00 pm
Subject: Re: How to limit conf t to only interface
Hi Robert,

On 09.11.12 14:52, rthl wrote:

> It already has problems with the regexes. I tried to compile with
> PCRE, but seems not to work. It complains already at the
> configure-statement, when I try to give the pcre-options.

> How can I check the compiled program, which regex it uses?

POSIX regular expressions will be always available. Whether PCRE support
is compiled in can be checked via

   tac_plus 2>&1 | grep ^Version:

which should print something like

   Version: 201210030903/PCRE/DES/LWRES/CURL

Both regex variants may be used in parallel.

Cheers,

Marc


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »