From 2a8b8f8a9322d075d8a991829fbe7f5c4ebbba7d Mon Sep 17 00:00:00 2001 From: Thorsten Kukuk Date: Thu, 1 Jun 2006 18:51:15 +0000 Subject: Relevant BUGIDs: Purpose of commit: new feature Commit summary: --------------- 2006-06-01 Thorsten Kukuk * modules/pam_group/Makefile.am: Include Make.xml.rules. * modules/pam_group/group.conf.5.xml: New. * modules/pam_group/group.conf.5: New, generated from xml file. * modules/pam_group/pam_group.8.xml: New. * modules/pam_group/pam_group.8: New, generated from xml file. * modules/pam_group/README.xml: New. * modules/pam_group/README: Regenerated from xml file. --- ChangeLog | 8 ++ NEWS | 2 +- modules/pam_group/Makefile.am | 12 ++- modules/pam_group/README | 52 ++++++++---- modules/pam_group/README.xml | 34 ++++++++ modules/pam_group/group.conf.5 | 70 +++++++++++++++++ modules/pam_group/group.conf.5.xml | 130 ++++++++++++++++++++++++++++++ modules/pam_group/pam_group.8 | 72 +++++++++++++++++ modules/pam_group/pam_group.8.xml | 157 +++++++++++++++++++++++++++++++++++++ 9 files changed, 520 insertions(+), 17 deletions(-) create mode 100644 modules/pam_group/README.xml create mode 100644 modules/pam_group/group.conf.5 create mode 100644 modules/pam_group/group.conf.5.xml create mode 100644 modules/pam_group/pam_group.8 create mode 100644 modules/pam_group/pam_group.8.xml diff --git a/ChangeLog b/ChangeLog index a82a998f..a5d7834b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2006-06-01 Thorsten Kukuk + * modules/pam_group/Makefile.am: Include Make.xml.rules. + * modules/pam_group/group.conf.5.xml: New. + * modules/pam_group/group.conf.5: New, generated from xml file. + * modules/pam_group/pam_group.8.xml: New. + * modules/pam_group/pam_group.8: New, generated from xml file. + * modules/pam_group/README.xml: New. + * modules/pam_group/README: Regenerated from xml file. + * modules/pam_ftp/Makefile.am: Include Make.xml.rules. * modules/pam_ftp/pam_ftp.8.xml: New. * modules/pam_ftp/pam_ftp.8: New, generated from xml file. diff --git a/NEWS b/NEWS index 17c6aca3..1e5ff0a9 100644 --- a/NEWS +++ b/NEWS @@ -4,7 +4,7 @@ Linux-PAM NEWS -- history of user-visible changes. * pam_tally: Fix support for large UIDs * Fixed all problems found by Coverity * Add manual page for pam_mkhomedir, pam_umask, pam_filter, - pam_issue, pam_ftp + pam_issue, pam_ftp, pam_group Release 0.99.4.0 diff --git a/modules/pam_group/Makefile.am b/modules/pam_group/Makefile.am index e6a5e4ae..544fa12f 100644 --- a/modules/pam_group/Makefile.am +++ b/modules/pam_group/Makefile.am @@ -4,7 +4,10 @@ CLEANFILES = *~ -EXTRA_DIST = README group.conf tst-pam_group +EXTRA_DIST = README group.conf $(MANS) $(XMLS) tst-pam_group + +man_MANS = group.conf.5 pam_group.8 +XMLS = README.xml group.conf.5.xml pam_group.8.xml securelibdir = $(SECUREDIR) secureconfdir = $(SCONFIGDIR) @@ -22,3 +25,10 @@ securelib_LTLIBRARIES = pam_group.la secureconf_DATA = group.conf TESTS = tst-pam_group + +if ENABLE_REGENERATE_MAN +noinst_DATA = README +README: pam_group.8.xml group.conf.5.xml +-include $(top_srcdir)/Make.xml.rules +endif + diff --git a/modules/pam_group/README b/modules/pam_group/README index d579b858..71359bf1 100644 --- a/modules/pam_group/README +++ b/modules/pam_group/README @@ -1,23 +1,45 @@ +pam_group — PAM module for group access -This is a help file for the pam_group module. It explains the need for -pam_group and also the syntax of the /etc/security/group.conf file. +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ -1. Introduction -=============== +DESCRIPTION -It is desirable to give extra privileges to a user running a specific -PAM aware application at various times of the day and on specific days -or over various terminal lines by adding this user to extra groups. +The pam_group PAM module does not authenticate the user, but instead it grants +group memberships (in the credential setting phase of the authentication +module) to the user. Such memberships are based on the service they are +applying for. -The pam_group module is intended to offer a configurable module that -satisfies this purpose, within the context of Linux-PAM. +By default rules for group memberships are taken from config file /etc/security +/group.conf. -2. the /etc/security/group.conf file -=================================== +This module's usefulness relies on the file-systems accessible to the user. The +point being that once granted the membership of a group, the user may attempt +to create a setgid binary with a restricted group ownership. Later, when the +user is not given membership to this group, they can recover group membership +with the precompiled binary. The reason that the file-systems that the user has +access to are so significant, is the fact that when a system is mounted nosuid +the user is unable to create or execute such a binary file. For this module to +provide any level of security, all file-systems that the user has write access +to should be mounted nosuid. -Its syntax is described in the sample group.conf file. +The pam_group module fuctions in parallel with the /etc/group file. If the user +is granted any groups based on the behavior of this module, they are granted in +addition to those entries /etc/group (or equivalent). -unrecognised rules are ignored (but an error is logged to syslog(3)) +EXAMPLES + +These are some example lines which might be specified in /etc/security/ +group.conf. + +Running 'xsh' on tty* (any ttyXXX device), the user 'us' is given access to the +floppy (through membership of the floppy group) + +xsh;tty*&!ttyp*;us;Al0000-2400;floppy + +Running 'xsh' on tty* (any ttyXXX device), the user 'sword' is given access to +games (through membership of the floppy group) after work hours. + +xsh; tty* ;sword;!Wk0900-1800;games, sound + +xsh; tty* ;*;Al0900-1800;floppy --------------------- -Bugs to the list diff --git a/modules/pam_group/README.xml b/modules/pam_group/README.xml new file mode 100644 index 00000000..387d6987 --- /dev/null +++ b/modules/pam_group/README.xml @@ -0,0 +1,34 @@ + + +--> + +]> + +
+ + + + + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="pam_group.8.xml" xpointer='xpointer(//refnamediv[@id = "pam_group-name"]/*)'/> + + + + +
+ +
+ +
+ +
+ +
diff --git a/modules/pam_group/group.conf.5 b/modules/pam_group/group.conf.5 new file mode 100644 index 00000000..82f21e8e --- /dev/null +++ b/modules/pam_group/group.conf.5 @@ -0,0 +1,70 @@ +.\" ** You probably do not want to edit this file directly ** +.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1). +.\" Instead of manually editing it, you probably should edit the DocBook XML +.\" source for it and then use the DocBook XSL Stylesheets to regenerate it. +.TH "GROUP.CONF" "5" "06/01/2006" "Linux\-PAM Manual" "Linux\-PAM Manual" +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.SH "NAME" +group.conf \- configuration file for the pam_group module +.SH "DESCRIPTION" +.PP +The pam_group PAM module does not authenticate the user, but instead it grants group memberships (in the credential setting phase of the authentication module) to the user. Such memberships are based on the service they are applying for. +.PP +For this module to function correctly there must be a correctly formatted +\fI/etc/security/groups.conf\fR +file present. White spaces are ignored and lines maybe extended with '\\' (escaped newlines). Text following a '#' is ignored to the end of the line. +.PP +The syntax of the lines is as follows: +.PP +\fIservices\fR;\fIttys\fR;\fIusers\fR;\fItimes\fR;\fIgroups\fR +.PP +The first field, the +\fIservices\fR +field, is a logic list of PAM service names that the rule applies to. +.PP +The second field, the +\fItty\fR +field, is a logic list of terminal names that this rule applies to. +.PP +The third field, the +\fIusers\fR +field, is a logic list of users or a netgroup of users to whom this rule applies. +.PP +For these items the simple wildcard '*' may be used only once. With netgroups no wildcards or logic operators are allowed. +.PP +The +\fItimes\fR +field is used to indicate "when" these groups are to be given to the user. The format here is a logic list of day/time\-range entries the days are specified by a sequence of two character entries, MoTuSa for example is Monday Tuesday and Saturday. Note that repeated days are unset MoMo = no day, and MoWk = all weekdays bar Monday. The two character combinations accepted are Mo Tu We Th Fr Sa Su Wk Wd Al, the last two being week\-end days and all 7 days of the week respectively. As a final example, AlFr means all days except Friday. +.PP +Each day/time\-range can be prefixed with a '!' to indicate "anything but". The time\-range part is two 24\-hour times HHMM separated by a hyphen indicating the start and finish time (if the finish time is smaller than the start time it is deemed to apply on the following day). +.PP +The +\fIgroups\fR +field is a comma or space separated list of groups that the user inherits membership of. These groups are added if the previous fields are satisfied by the user's request. +.PP +For a rule to be active, ALL of service+ttys+users must be satisfied by the applying process. +.SH "EXAMPLES" +.PP +These are some example lines which might be specified in +\fI/etc/security/group.conf\fR. +.PP +Running 'xsh' on tty* (any ttyXXX device), the user 'us' is given access to the floppy (through membership of the floppy group) +.PP +xsh;tty*&!ttyp*;us;Al0000\-2400;floppy +.PP +Running 'xsh' on tty* (any ttyXXX device), the user 'sword' is given access to games (through membership of the floppy group) after work hours. +.PP +xsh; tty* ;sword;!Wk0900\-1800;games, sound +.PP +xsh; tty* ;*;Al0900\-1800;floppy +.SH "SEE ALSO" +.PP +\fBpam_group\fR(8), +\fBpam.d\fR(5), +\fBpam\fR(8) +.SH "AUTHORS" +.PP +pam_group was written by Andrew G. Morgan . diff --git a/modules/pam_group/group.conf.5.xml b/modules/pam_group/group.conf.5.xml new file mode 100644 index 00000000..036efb15 --- /dev/null +++ b/modules/pam_group/group.conf.5.xml @@ -0,0 +1,130 @@ + + + + + + + group.conf + 5 + Linux-PAM Manual + + + + group.conf + configuration file for the pam_group module + + + + DESCRIPTION + + + The pam_group PAM module does not authenticate the user, but instead + it grants group memberships (in the credential setting phase of the + authentication module) to the user. Such memberships are based on the + service they are applying for. + + + For this module to function correctly there must be a correctly + formatted /etc/security/groups.conf file present. + White spaces are ignored and lines maybe extended with '\' (escaped + newlines). Text following a '#' is ignored to the end of the line. + + + + The syntax of the lines is as follows: + + + + services;ttys;users;times;groups + + + + + The first field, the services field, is a logic list + of PAM service names that the rule applies to. + + + + The second field, the tty + field, is a logic list of terminal names that this rule applies to. + + + + The third field, the users + field, is a logic list of users or a netgroup of users to whom this + rule applies. + + + + For these items the simple wildcard '*' may be used only once. + With netgroups no wildcards or logic operators are allowed. + + + + The times field is used to indicate "when" + these groups are to be given to the user. The format here is a logic + list of day/time-range entries the days are specified by a sequence of + two character entries, MoTuSa for example is Monday Tuesday and Saturday. + Note that repeated days are unset MoMo = no day, and MoWk = all weekdays + bar Monday. The two character combinations accepted are Mo Tu We Th Fr Sa + Su Wk Wd Al, the last two being week-end days and all 7 days of the week + respectively. As a final example, AlFr means all days except Friday. + + + Each day/time-range can be prefixed with a '!' to indicate "anything but". + The time-range part is two 24-hour times HHMM separated by a hyphen + indicating the start and finish time (if the finish time is smaller + than the start time it is deemed to apply on the following day). + + + + The groups field is a comma or space + separated list of groups that the user inherits membership of. These + groups are added if the previous fields are satisfied by the user's request. + + + + For a rule to be active, ALL of service+ttys+users must be satisfied + by the applying process. + + + + + EXAMPLES + + These are some example lines which might be specified in + /etc/security/group.conf. + + + + Running 'xsh' on tty* (any ttyXXX device), the user 'us' is given access + to the floppy (through membership of the floppy group) + + xsh;tty*&!ttyp*;us;Al0000-2400;floppy + + + Running 'xsh' on tty* (any ttyXXX device), the user 'sword' is given access + to games (through membership of the floppy group) after work hours. + + xsh; tty* ;sword;!Wk0900-1800;games, sound + xsh; tty* ;*;Al0900-1800;floppy + + + + + SEE ALSO + + pam_group8, + pam.d5, + pam8 + + + + + AUTHORS + + pam_group was written by Andrew G. Morgan <morgan@kernel.org>. + + + diff --git a/modules/pam_group/pam_group.8 b/modules/pam_group/pam_group.8 new file mode 100644 index 00000000..b754dc4c --- /dev/null +++ b/modules/pam_group/pam_group.8 @@ -0,0 +1,72 @@ +.\" ** You probably do not want to edit this file directly ** +.\" It was generated using the DocBook XSL Stylesheets (version 1.69.1). +.\" Instead of manually editing it, you probably should edit the DocBook XML +.\" source for it and then use the DocBook XSL Stylesheets to regenerate it. +.TH "PAM_GROUP" "8" "06/01/2006" "Linux\-PAM Manual" "Linux\-PAM Manual" +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.SH "NAME" +pam_group \- PAM module for group access +.SH "SYNOPSIS" +.HP 13 +\fBpam_group.so\fR +.SH "DESCRIPTION" +.PP +The pam_group PAM module does not authenticate the user, but instead it grants group memberships (in the credential setting phase of the authentication module) to the user. Such memberships are based on the service they are applying for. +.PP +By default rules for group memberships are taken from config file +\fI/etc/security/group.conf\fR. +.PP +This module's usefulness relies on the file\-systems accessible to the user. The point being that once granted the membership of a group, the user may attempt to create a +\fBsetgid\fR +binary with a restricted group ownership. Later, when the user is not given membership to this group, they can recover group membership with the precompiled binary. The reason that the file\-systems that the user has access to are so significant, is the fact that when a system is mounted +\fInosuid\fR +the user is unable to create or execute such a binary file. For this module to provide any level of security, all file\-systems that the user has write access to should be mounted +\fInosuid\fR. +.PP +The pam_group module fuctions in parallel with the +\fI/etc/group\fR +file. If the user is granted any groups based on the behavior of this module, they are granted +\fIin addition\fR +to those entries +\fI/etc/group\fR +(or equivalent). +.SH "MODULE SERVICES PROVIDED" +.PP +Only the +\fBauth\fR +service is supported. +.SH "RETURN VALUES" +.TP +PAM_SUCCESS +group membership was granted. +.TP +PAM_ABORT +Not all relevant data could be gotten. +.TP +PAM_BUF_ERR +Memory buffer error. +.TP +PAM_CRED_ERR +Group membership was not granted. +.TP +PAM_IGNORE +\fBpam_sm_authenticate\fR +was called which does nothing. +.TP +PAM_USER_UNKNOWN +The user is not known to the system. +.SH "FILES" +.TP +\fI/etc/security/group.conf\fR +Default configuration file +.SH "SEE ALSO" +.PP +\fBgroup.conf\fR(5), +\fBpam.d\fR(8), +\fBpam\fR(8). +.SH "AUTHORS" +.PP +pam_group was written by Andrew G. Morgan . diff --git a/modules/pam_group/pam_group.8.xml b/modules/pam_group/pam_group.8.xml new file mode 100644 index 00000000..6e6c0498 --- /dev/null +++ b/modules/pam_group/pam_group.8.xml @@ -0,0 +1,157 @@ + + + + + + + pam_group + 8 + Linux-PAM Manual + + + + pam_group + + PAM module for group access + + + + + + + + pam_group.so + + + + + + DESCRIPTION + + The pam_group PAM module does not authenticate the user, but instead + it grants group memberships (in the credential setting phase of the + authentication module) to the user. Such memberships are based on the + service they are applying for. + + + By default rules for group memberships are taken from config file + /etc/security/group.conf. + + + This module's usefulness relies on the file-systems + accessible to the user. The point being that once granted the + membership of a group, the user may attempt to create a + setgid binary with a restricted group ownership. + Later, when the user is not given membership to this group, they can + recover group membership with the precompiled binary. The reason that + the file-systems that the user has access to are so significant, is the + fact that when a system is mounted nosuid the user + is unable to create or execute such a binary file. For this module to + provide any level of security, all file-systems that the user has write + access to should be mounted nosuid. + + + The pam_group module fuctions in parallel with the + /etc/group file. If the user is granted any groups + based on the behavior of this module, they are granted + in addition to those entries + /etc/group (or equivalent). + + + + + MODULE SERVICES PROVIDED + + Only the service is supported. + + + + + RETURN VALUES + + + PAM_SUCCESS + + + group membership was granted. + + + + + PAM_ABORT + + + Not all relevant data could be gotten. + + + + + PAM_BUF_ERR + + + Memory buffer error. + + + + + PAM_CRED_ERR + + + Group membership was not granted. + + + + + PAM_IGNORE + + + pam_sm_authenticate was called which does nothing. + + + + + PAM_USER_UNKNOWN + + + The user is not known to the system. + + + + + + + + FILES + + + /etc/security/group.conf + + Default configuration file + + + + + + + SEE ALSO + + + group.conf5 + , + + pam.d8 + , + + pam8 + . + + + + + AUTHORS + + pam_group was written by Andrew G. Morgan <morgan@kernel.org>. + + + -- cgit v1.2.3