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