1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
Secure Core Utilities
=====================
Secure Core Utilities is a re-implmentation of some coreutils programs
which are intended to be used with sudo in an attempt to provide secure
access to files without allowing unrestricted read access to any file.
Contents
--------
1. Disclaimer
2. Maintainers
3. Background
4. Source Code
5. Package Maintence Notes
Disclaimer
==========
This software is provided by the copyright holders and contributors "as
is" and any express or implied warranties, including, but not limited to,
the implied warranties of merchantability and fitness for a particular
purpose are disclaimed. In no event shall David M. Syzdek be liable for
any direct, indirect, incidental, special, exemplary, or consequential
damages (including, but not limited to, procurement of substitute goods or
services; loss of use, data, or profits; or business interruption) however
caused and on any theory of liability, whether in contract, strict
liability, or tort (including negligence or otherwise) arising in any way
out of the use of this software, even if advised of the possibility of
such damage.
Maintainers
===========
David M. Syzdek
david@syzdek.net
Background
==========
In some circumstances it may be useful to provide read access to files
within a particular directory, for example granting support staff the
ability to view log files. This can be accomplished using sudo, however
sudo's use of glob() instead of regexec() forces the administrator to
enumerate each individual allowed file as a sudo command. Otherwise using
a wild card in the sudoers file may allow users to read additional files.
Consider the following configuration excerpt from a sudoers file:
%support ALL=(ALL) /usr/bin/cat /var/log/*
The above configuration would allow a member of the support group to read
the /etc/shadow file using either of the following commands:
$ sudo cat /var/log/ /etc/shadow
$ sudo cat /var/log/../../etc/shadow
Secure Core Utilities attempts to mitigate this by placing the restrictions
on file paths. If a file path violates one of the restrictions, the utility
will fail with an error. The following file path restrictions are enforced:
* The period (‘.’) character and/or the forward slash (‘/‘) character are
considered special characters. A special character may not be adjacent
to another special character within the file path. The following table
demonstrates valid and invalid paths:
/var/log/messages (valid)
/var/log/file.txt (valid)
/var/log/file..txt (invalid)
/var/log//file.txt (invalid)
/var/log/../../etc/shadow (invalid)
/var/log/.someHiddenFile (invalid)
/var/log./file.txt (invalid)
* All file paths must be anchored with a leading slash. The following
table demonstrates valid and invalid paths:
/var/log/messages (valid)
./var/log/message (invalid)
var/log/messages (invalid)
* Only one file may be specified on the command line unlike cat, grep,
tail, head, etc which accept multiple input files on the command line.
* No part of the the file path may be a symbolic link.
An administrator is able to use secure core utilities without changing
user's behavior by modifing the secure_path within the sudoers file and
creating a symlink.
Create the symlink for the secure core utilities:
mkdir -p /usr/libexec/securecoreutils
ln -s /usr/bin/securecoreutils /usr/libexec/securecoreutils/cat
The following is an example sudoers file:
Defaults env_reset, \
secure_path=/usr/libexec/securecoreutils:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
%support ALL=(ALL) /usr/libexec/securecoreutils/cat /var/log/*
Source Code
===========
The source code for this project is maintained using git
(http://git-scm.com). The following contains information to checkout the
source code from the git repository.
Browse Source:
https://github.com/bindle/securecoreutils
Git URLs:
git://github.com/bindle/securecoreutils.git
https://github.com/bindle/bindleadmin.git
git@github.com:bindle/bindleadmin.git
Downloading Source:
$ git clone git://github.com/bindle/securecoreutils.git
Preparing Source:
$ cd securecoreutils
$ ./autogen.sh
Git Branches:
master - Current release of packages.
next - changes staged for next release
pu - proposed updates for next release
xx/yy+ - branch for testing new changes before merging to 'pu' branch
Package Maintence Notes
=======================
This is a collection of notes for developers to use when maintaining this
package.
New Release Checklist:
- Switch to 'master' branch in Git repository.
- Update version in configure.ac.
- Update date and version in ChangeLog.
- Commit configure.ac and ChangeLog changes to repository.
- Create tag in git repository:
$ git tag -s v${MAJOR}.${MINOR}
- Push repository to publishing server:
$ git push --tags origin master:master next:next pu:pu
Creating Source Distribution Archives:
$ ./configure
$ make update
$ make distcheck
$ make dist-bzip2
|