简体   繁体   English

如何在Jboss teiid中配置只读数据源

[英]How to configure Read Only Datasource in Jboss teiid

I have configured a Redshift Datasource in Jboss teiid. 我已经在Jboss teiid中配置了Redshift数据源。 I want to know how to make my Datasource Read Only. 我想知道如何使我的数据源为只读。 I know how make Read Only resources on VDB level using Dataroles (Ref:- https://github.com/teiid/teiid-quickstarts/blob/master/vdb-dataroles/src/vdb/portfolio-vdb.xml ). 我知道如何使用Dataroles在VDB级别上创建只读资源(参考:-https: //github.com/teiid/teiid-quickstarts/blob/master/vdb-dataroles/src/vdb/portfolio-vdb.xml )。 But this would allow to create new VDBs which are not Read Only which is a vulnerability in my case. 但是,这将允许创建非只读的新VDB,这对我来说是一个漏洞。 I want to do this in Datasource configuration level in domain.xml. 我想在domain.xml的数据源配置级别中执行此操作。 Is there any guidance on how to do this. 是否有关于如何执行此操作的指南。

I am not using teiid Designer and I configure Datasources editing the domain.xml file. 我没有使用teiid Designer,而是配置了编辑domain.xml文件的数据源。 I add the fallowing Datasource under the Datasources sub element in the domain.xml file 我在domain.xml文件的Datasources子元素下添加了休止的Datasource

            <datasource jndi-name="java:jboss/datasources/redshiftDS" pool-name="redshiftDS" enabled="true" use-java-context="true">
            <connection-url>jdbc:redshift://***********.com:5439/schema</connection-url>
            <driver>redshift</driver>
            <security>
                <user-name>${user_name}</user-name>
                <password>${pw}</password>
            </security>
            <pool>
                <!--min-pool-size>
                    10
                </min-pool-size-->
                <max-pool-size>
                    5
                </max-pool-size>
            </pool>
            </datasource> 

Is there any way I can configure the Datasource to be read only here. 有什么办法可以将数据源配置为此处只读。 For an example adding something like 例如添加类似

<access-permission>
   read-only
</access-permission>

Mark all your tables as non updatable. 将所有表标记为不可更新。 If you are using designer there is property on table or columns or you can do same using DDL too. 如果使用Designer,则表或列上都有属性,或者也可以使用DDL进行设置。

The simplest alternative from a Teiid perspective is to add a data role for any authenticated for all schemas that you don't users to have write access to: 从Teiid角度来看,最简单的替代方法是为所有您不具有写访问权限的模式授权的任何身份验证添加数据角色:

<data-role name="read-only" any-authenticated="true" allow-create-temporary-tables="true">
    <description>read only access</description>
    <permission>
        <resource-name>schema name</resource-name>
        <allow-read>true</allow-read>
        <allow-execute>true</allow-execute>
    </permission>
</data-role>

There was a flag on translators to set them as immutable - but support for that was removed. 转换器上有一个标记,用于将它们设置为不可变-但已删除了对该标记的支持。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM