【发布时间】:2010-10-01 08:27:17
【问题描述】:
问题在于通过 Apache Web 服务器提供的 Subversion 存储库的安全设置。
我使用基于路径的身份验证来保护一些公司信息免受外部合作者的影响。我需要一些东西来测试授权给了我想要的人,即我需要检查我没有在配置中犯错误。
有一个简单的测试方法:使用用户的用户名和密码模拟对资源的访问。但是这种方法需要知道用户的密码。
例如下面的 BASH 脚本测试每个用户在指定路径 ($url) 上的授权。注意:users-files.txt 包含用户的用户名和密码,格式为“username:password”。
url="http://my.company.com/svn/repo1/private-data/"
while read line; do
username="${line%:*}"
password="${line#*:}"
if wget --quiet --user="$username" --password="$password" -- "$url"; then
echo -e "$username:\tgranted"
else
echo -e "$username:\tdenied"
fi
done < users-list.txt
有一种方法可以在不知道用户密码而只知道用户名的情况下进行此检查?我是运行 HTTPD 和 Subversion 的机器的根。 HTTPD 是否提供了一些审计工具?
认证配置如下:
<Location /svn/>
DAV svn
SVNParentPath /var/svn/
AuthType Basic
AuthBasicProvider ldap
AuthName "Subversion repository"
AuthLDAPURL ldap://127.0.0.1:389/ou=People,o=mycompany.com?uid?sub?(objectClass=*)
Require valid-user
AuthzSVNAccessFile /var/svn/svn-access-file.conf
Options Indexes
SVNListParentPath on
</Location>
【问题讨论】: