This repository has been archived by the owner on Aug 29, 2018. It is now read-only.
forked from mojolingo/puppet-openshift
-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
183 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 65 additions & 18 deletions
83
templates/broker/plugins/auth/kerberos/openshift-origin-auth-remote-user-kerberos.conf.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,84 @@ | ||
# Provided by the mod_auth_kerb package | ||
LoadModule auth_basic_module modules/mod_auth_basic.so | ||
LoadModule authz_user_module modules/mod_authz_user.so | ||
LoadModule auth_kerb_module modules/mod_auth_kerb.so | ||
|
||
<Location /broker> | ||
AuthName "OpenShift" | ||
AuthType Kerberos | ||
KrbMethodNegotiate On | ||
KrbMethodK5Passwd On | ||
KrbServiceName HTTP/<%= scope.lookupvar('::openshift_origin::broker_krb_service_name') %> | ||
KrbAuthRealms <%= scope.lookupvar('::openshift_origin::broker_krb_auth_realms') %> | ||
Krb5KeyTab <%= scope.lookupvar('::openshift_origin::broker_krb_keytab') %> | ||
Require valid-user | ||
|
||
SetEnvIfNoCase Authorization Bearer passthrough | ||
|
||
# The node->broker auth is handled in the Ruby code | ||
BrowserMatch Openshift passthrough | ||
AuthName "OpenShift broker API" | ||
AuthType Kerberos | ||
KrbMethodNegotiate On | ||
KrbMethodK5Passwd On | ||
# The KrbLocalUserMapping enables conversion to local users, using | ||
# auth_to_local rules in /etc/krb5.conf. By default it strips the | ||
# @REALM part. See krb5.conf(5) for details how to set up specific rules. | ||
KrbLocalUserMapping On | ||
KrbServiceName HTTP/<%= scope.lookupvar('::openshift_origin::broker_krb_service_name') %> | ||
KrbAuthRealms <%= scope.lookupvar('::openshift_origin::broker_krb_auth_realms') %> | ||
Krb5KeyTab <%= scope.lookupvar('::openshift_origin::broker_krb_keytab') %> | ||
require valid-user | ||
|
||
SetEnvIfNoCase Authorization Bearer passthrough | ||
|
||
# The node->broker auth is handled in the Ruby code | ||
BrowserMatchNoCase ^OpenShift passthrough | ||
<IfVersion >= 2.4> | ||
Require env passthrough | ||
</IfVersion> | ||
<IfVersion < 2.4> | ||
Allow from env=passthrough | ||
</IfVersion> | ||
|
||
# Console traffic will hit the local port. mod_proxy will set this header automatically. | ||
SetEnvIf X-Forwarded-For "^$" local_traffic=1 | ||
# Turn the Console output header into the Apache environment variable for the broker remote-user plugin | ||
SetEnvIf X-Remote-User "(..*)" REMOTE_USER=$1 | ||
<IfVersion >= 2.4> | ||
Require env local_traffic | ||
</IfVersion> | ||
<IfVersion < 2.4> | ||
Allow from env=local_traffic | ||
</IfVersion> | ||
|
||
# Broker auth based on iv/token generated and verified by broker | ||
SetEnvIf broker_auth_key "^[A-Za-z0-9+/=]+$" BROKER_AUTH=1 | ||
|
||
<IfVersion >= 2.4> | ||
Require env BROKER_AUTH | ||
</IfVersion> | ||
<IfVersion < 2.4> | ||
Allow from env=BROKER_AUTH | ||
</IfVersion> | ||
|
||
<IfVersion < 2.4> | ||
Order Deny,Allow | ||
Deny from all | ||
Satisfy any | ||
</IfVersion> | ||
</Location> | ||
|
||
# The following APIs do not require auth: | ||
<Location /broker/rest/application_templates*> | ||
Allow from all | ||
</Location> | ||
|
||
<Location /broker/rest/cartridges*> | ||
<IfVersion >= 2.4> | ||
Require all granted | ||
</IfVersion> | ||
<IfVersion < 2.4> | ||
Allow from all | ||
</IfVersion> | ||
</Location> | ||
|
||
<Location /broker/rest/api*> | ||
<IfVersion >= 2.4> | ||
Require all granted | ||
</IfVersion> | ||
<IfVersion < 2.4> | ||
Allow from all | ||
</IfVersion> | ||
</Location> | ||
|
||
<Location /broker/rest/environment*> | ||
<IfVersion >= 2.4> | ||
Require all granted | ||
</IfVersion> | ||
<IfVersion < 2.4> | ||
Allow from all | ||
</IfVersion> | ||
</Location> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters