【问题标题】:Disable Authentication in OpenStack Swift在 OpenStack Swift 中禁用身份验证
【发布时间】:2017-01-15 17:07:39
【问题描述】:

我希望每个人(未经授权)都可以从我的测试 swift 服务器存储/读取对象。有没有办法完全禁用身份验证?我已获得以下用户 (proxy-server.conf) 的授权:

[filter:tempauth]
use = egg:swift#tempauth
user_test_tester = testing .admin

但希望非用户也可以向我的服务器发出请求。

【问题讨论】:

    标签: linux openstack openstack-swift object-storage


    【解决方案1】:

    这取决于您要使用什么样的请求以及您使用的身份验证中间件。如果您使用的是 keystone,您将无法使用容器级别的权限。您可以将容器的权限设置为公开。

    curl -X POST -i \
       -H "X-Auth-Token: abcdeftoken" \
       -H "X-Container-Read: .r:*" \
       -H "X-Container-Write: .r:*" \
       http://swift.example.com/v1/AUTH_testing/container
    

    【讨论】:

    • 好的。但是有没有办法在没有身份验证令牌的情况下创建容器?
    • 您需要在帐户级别设置权限,这需要身份验证令牌。将权限设置为公开后的所有操作都不需要身份验证。
    【解决方案2】:

    您可以使用no authentication middlewaretempauthkeystoneauth 配置您的代理服务器管道。在第一个解决方案中,您不需要提供任何密码。在第二种解决方案中,您可以在配置中设置用户、组和密码,最后一个联系 keystone 服务器进行识别。

    示例:

    [pipeline:main]
    ### no pass
    # pipeline = catch_errors gatekeeper healthcheck proxy-logging cache container_sync bulk tempurl ratelimit copy container-quotas account-quotas slo dlo versioned_writes proxy-logging proxy-server
    
    ### tempauth
    # pipeline = catch_errors gatekeeper healthcheck proxy-logging cache listing_formats container_sync bulk tempurl ratelimit tempauth copy container-quotas account-quotas slo dlo versioned_writes symlink proxy-logging proxy-server
    
    ### keystoneauth
    pipeline = catch_errors gatekeeper healthcheck proxy-logging cache container_sync bulk ratelimit authtoken keystoneauth container-quotas account-quotas slo dlo versioned_writes proxy-logging proxy-server
    
    
    [filter:keystoneauth]
    use = egg:swift#keystoneauth
    operator_roles = admin,user
    
    # https://docs.openstack.org/keystonemiddleware/latest/middlewarearchitecture.html
    [filter:authtoken]
    paste.filter_factory = keystonemiddleware.auth_token:filter_factory
    www_authenticate_uri = http://controller:5000/
    auth_url = http://controller:5000/
    memcached_servers = controller:11211
    auth_type = password
    project_domain_id = default
    user_domain_id = default
    project_name = service
    username = swift
    password = SWIFT_PASS # change this
    delay_auth_decision = True
    log_level = debug
    service_token_roles_required = True
    
    [filter:tempauth]
    use = egg:swift#tempauth
    user_admin_admin = admin .admin .reseller_admin
    user_test_tester = testing .admin
    user_test2_tester2 = testing2 .admin
    user_test_tester3 = testing3
    user_test5_tester5 = testing5 service
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多