【发布时间】:2021-01-28 22:06:44
【问题描述】:
我有一个应用程序在 CentOS 7 上的 Apache 2.4.6 上的反向代理后面运行。我正在使用 Shibboleth 进行身份验证,目前正在使用 AuthGroupFile /path/to/authfile 和 Require group authGroup 通过白名单进行授权。这目前适用于我的设置。我正在尝试更改此过程以对存储在 SQL Server 数据库中的白名单进行授权,但事实证明这很困难。
目前在conf.d/shib.conf 我有以下内容:
DBDriver odbc
DBDParams "DATASOURCE=ODBCconn,USER=myUser,PASSWORD=myPwd"
<Location /authLocation>
AuthType shibboleth
ShibRequestSetting requireSession 1
Require dbd-group myApp
AuthzDBDQuery "SELECT appName FROM authTable WHERE UserLogin = %s"
</Location>
我的 DSM ODBCconn 我正在使用 ODBC Driver 17 for SQL Server,我可以使用该 DSM 通过 python 中的 pyodbc 使用这些凭据进行连接,所以我认为我的设置正确。在数据库中,appName 列将返回存储在authTable 中的用户被授权使用的应用程序的名称,或者本质上是用户所属的组。因此,如果用户有myApp 的行,他们将被授权使用myApp。我对文档 (https://httpd.apache.org/docs/trunk/mod/mod_authz_dbd.html) 的理解是我的查询应该如何用于定义组。
但是,在运行此程序时,我的 httpd/logs/error_log 中会出现一个 stack smashing error,它看起来像:
*** stack smashing detected ***: /usr/sbin/httpd terminated
======= Backtrace: =========
...
...
Long long list of files
...
...
[Thu Jan 28 09:36:53.306151 2021] [core:notice] [pid 10621] AH00052: child pid 24810 exit signal Aborted (6)
[Thu Jan 28 09:36:53.306215 2021] [core:notice] [pid 10621] AH00052: child pid 28192 exit signal Aborted (6)
[Thu Jan 28 09:36:53.306238 2021] [core:notice] [pid 10621] AH00052: child pid 31928 exit signal Aborted (6)
对于我的设置可能出现什么问题以这种方式阻止授权的任何帮助?
【问题讨论】:
标签: sql-server apache authorization httpd.conf