首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >建立PEP代理

建立PEP代理
EN

Stack Overflow用户
提问于 2017-05-05 15:30:54
回答 2查看 204关注 0票数 3

我一直在研究Proxy Steelskin,这样我就可以为Orion上下文提供一些安全层,然而,也有一些问题阻碍了我的进展。

我想使用IDM和Keystone Global实例。

我已经按照各自的方向( pepProxy )成功地安装了https://github.com/telefonicaid/fiware-pep-steelskin,但是结果总是一样的:

代码语言:javascript
复制
{
"name": "KEYSTONE_AUTHENTICATION_ERROR",
  "message": "There was a connection error while authenticating to Keystone: 500"
}

config.js文件中使用的配置如下所示:

代码语言:javascript
复制
var config = {};

// Protected Resource configuration
//--------------------------------------------------
// Configures the address of the component that is being proxied and the address of the proxy itself.
config.resource = {
    original: {
        /**
         * Host that is being proxied.
         */
        host: 'account.lab.fiware.org',

        /**
         * Port where the proxied server is listening.
         */
        port: 10026
    },

    proxy: {
        /**
         * Port where the proxy is listening to redirect requests.
         */
        port: 1026,

        /**
         * Administration port for the proxy.
         */
        adminPort: 11211
    }
};

// Access Control configuration
//--------------------------------------------------
/**
 * This options can be used to configure the address and options of the Access Control, responsible of the request
 * validation.
 */
config.access = {
    /**
     * Indicates whether the access control validation should be enabled. Defaults to false.
     */
    disable: false,

    /**
     * Protocol to use to access the Access Control.
     */
    protocol: 'http',
    /**
     * Host where the Access Control is located.
     */
    host: 'account.lab.fiware.org',
    /**
     * Port where the Access Control is listening.
     */
    port: 7070,
    /**
     * Path of the authentication action.
     */
    path: '/pdp/v3'
}

// User identity configuration
//--------------------------------------------------
/**
 * Information about the Identity Manager server from where the information about a user will be drawn.
 */
config.authentication = {
    checkHeaders: false,
    module: 'keystone',
    user: 'pep_proxy_99c595...',
    password: 'e3025a2...',
    domainName: 'matest',
    retries: 3,
    cacheTTLs: {
        users: 1000,
        projectIds: 1000,
        roles: 60,
        validation: 120
    },
    options: {
        protocol: 'http',
        host: 'cloud.lab.fiware.org',
        port: 5000,
        path: '/v3/role_assignments',
        authPath: '/v3/auth/tokens'
    }
};


// Security configuration
//--------------------------------------------------
config.ssl = {
    /**
     * This flag activates the HTTPS protocol in the server. The endpoint always listen to the indicated port
     * independently of the chosen protocol.
     */
    active: false,

    /**
     * Key file to use for codifying the HTTPS requests. Only mandatory when the flag active is true.
     */
    keyFile: '',

    /**
     * SSL Certificate to present to the clients. Only mandatory when the flag active is true.
     */
    certFile: ''
}

/**
 * Default log level. Can be one of: 'DEBUG', 'INFO', 'WARN', 'ERROR', 'FATAL'
 */
config.logLevel = 'FATAL';

// List of component middlewares
//-------------------------------------------------
/**
 * To validate the request, the proxy needs some information that is dependant of the component: the action that a
 * request is going to execute. How to detect the action given the request is component-specific logic, that can be
 * codified in a middleware-like function that will be executed before the user validation. This logic must populate
 * the 'action' parameter of the request.
 */
config.middlewares = {
    /**
     * Indicates the module from where the middlewares will be loaded.
     */
    require: 'lib/plugins/orionPlugin',

    /**
     * Indicates the list of middlewares to load.
     */
    functions: [
        'extractCBAction'
    ]
};

/**
 * If this flag is activated, whenever the pepProxy is not able to redirect a request, instead of returning a 501 error
 * (that is the default functionality) the PEP Proxy process will exit with a -2 code.
 */
config.dieOnRedirectError = false;

/**
 * Name of the component. It will be used in the generation of the FRN.
 */
config.componentName = 'orion';

/**
 * Prefix to use in the FRN (Not to change, usually).
 */
config.resourceNamePrefix = 'fiware:';

/**
 * Indicates whether this PEP should have an admin bypass or not. If it does, whenever a user request arrives to the
 * PEP from a user that has the role defined in the "adminRoleId" property, that request is not validated against the
 * Access Control, but it is automatically proxied instead.
 */
config.bypass = false;

/**
 * ID of the admin user if it exists. Only effective if the "bypass" property is true.
 */
config.bypassRoleId = '';

/**
 * Configures the maximum number of clients that can be simultaneously queued while waiting for the PEP to
 * authenticate itself against Keystone (due to an expired token).
 */
config.maxQueuedClients = 1000;

module.exports = config;

在这方面:

  1. 使用account.lab.fiware.org作为资源和访问主机是正确的,还是应该使用不同的主机?
  2. 使用cloud.lab.fiware.org作为身份验证主机正确吗?
  3. 用户和密码由我的IDM全局实例自动创建。角色和特权是通过同一个全局实例分配的。这个程序是被占用的还是我应该遵循另一个程序?
  4. 我是不是遗漏了什么?

有人对我的问题有任何提示吗?

注:我已经成功地尝试过不同的职位。部分原因是因为这些解决方案中有许多已经安装了自己的keystone,例如:https://stackoverflow.com/questions/30888451/pep-proxy-steelskin-log-configurationhttps://stackoverflow.com/questions/32092430/pep-proxy-config-file-for-integration-of-idm-ge-pep-proxy-and-cosmos-big-datahttps://stackoverflow.com/questions/30888451/pep-proxy-steelskin-log-configuration。这个与我一直在做的事情更相关,但是,我相信它并不是最新的:https://stackoverflow.com/questions/29561163/fiware-orion-pepproxy

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-05-09 09:54:43

我@netzahdzc很抱歉,如果这不是您希望的答复,但我现在没有使用Fiware技术,所以我不记得所有的事情,但我会尽力帮助。

使用account.lab.fiware.org作为资源和访问主机是正确的,还是应该使用不同的主机?

我认为您使用的是正确的,请参考我的项目在GitHub的配置文件,这个项目是“旧的”,所以有些事情可能已经从Fiware方面改变了……正如您在PepProxy - config.js中看到的那样,我使用的实例与您使用的实例相同:

代码语言:javascript
复制
    config.account_host = 'https://account.lab.fiware.org';
    config.keystone_host = 'cloud.lab.fiware.org';
    config.keystone_port = 4730;

使用cloud.lab.fiware.org作为身份验证主机正确吗?

在我使用的配置(上面)中,您可以看到account.lab.fiware.orgaccount_host,而cloud.lab.fiware.org,是cloud.lab.fiware.org,,所以我认为您是对的。

用户和密码由我的IDM全局实例自动创建。角色和特权是通过同一个全局实例分配的。这个程序是被占用的还是我应该遵循另一个程序?

我不太了解这一点,但如果你是对的,角色和权限应该由Keystone Global实例来处理,但我不知道自从我处理这个事件以来,事情是否发生了变化。

对不起,如果我不能帮助更多,试着看看你是否可以使用我的一些配置,或至少它可以帮助你。你也可以试着和丹尼尔·莫兰·希门尼斯谈谈,我相信他能更好地帮助你。

票数 0
EN

Stack Overflow用户

发布于 2017-06-28 20:25:02

你的提议成功了吗?

我认为,如果您想使用IdM的全局实例作为身份验证提供程序,您必须填充config.js值​​,如下面的片段所示,但我不确定它是否会起作用。

代码语言:javascript
复制
// User identity configuration
//--------------------------------------------------
/**
 * Information about the Identity Manager server from where the information about a user will be drawn.
 */
config.authentication = {
    checkHeaders: true,
    module: 'keystone',
    user: 'pep_proxy_1234...',
    password: 'my-autogenerated-password',
    domainName: 'Default',
    retries: 3,
    cacheTTLs: {
        users: 1000,
        projectIds: 1000,
        roles: 60,
        validation: 120
    },
    options: {
        protocol: 'http',
        host: 'cloud.lab.fiware.org',
        port: 4730,
        path: '/v3/role_assignments',
        authPath: '/v3/auth/tokens'
    }
};

当然,将用户密码字段替换为您的IDM实例自动创建的值。

但是,我认为您应该使用PEP代理GE (Wilma PEP代理)的参考实现,以防您仍然希望使用Fiware的全局实例。

您使用的是该GE的Telefonica实现,从我的角度来看,它与Wilma有一些不同,我不能100%确定它是否可以与使用Fiware云全局实例的IdM关键岩授权PDP授权的引用实现集成。

一种完全不同的方法,可能是使用您自己的IdM实例、PDP授权和PEP代理泛型启用器(GEs)。在这种情况下,您仍然可以使用这三个组件的引用实现,也可以使用Steelskin代理。如果您遵循Steelskin路径,我鼓励您使用关键字-spassword凯帕斯,这是Telefonica的IdM和Authorization的实现。这里您可以一步一步地找到关于安装和配置这些GEs的优秀步骤。

最后,如果您想要遵循“参考”GE路径,您可以在这个幻灯片中找到一些光明。

致以敬意,

埃米利亚诺

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43808743

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档