My FNZ Studio Version

Data & Integration

Latest Update: 30.05.2022 | Margherita Taffarel
Documentation
2024
2023
2022.2
2022.1
11
10
9

1 Problem

As an Appway Administrator, I want to make sure the information handled by the Business Data Storage is secured from unauthorized access and that I can trace all the Business Data Storage-related operations performed on the Database by Appway users for auditing purposes. Which tools can I use for this purpose?

2 Solution

The security of the information handled by the Business Data Storage (from now on, BDS) can be achieved at two levels:

  • Storage of data in the Database.
  • Network exchanges between Appway and the Database.

On the other hand, you can audit all BDS-related operations performed by logged-in Appway users on the Database.

Following is some information on how to achieve data security and data auditing for the currently supported Database vendors, PostgreSQL, Oracle, and Microsoft SQL Server.

2.1 Information Security for PostgreSQL

2.1.1 Storage of Data for PostgreSQL

To secure the BDS data persisted in the Database, if required, you are recommended to encrypt the disk where the information is stored.

As an example, complete information on the encryption of Amazon RDS can be found at the following links:

2.1.2 Network Exchanges for PostgreSQL

You can secure the communication between Appway BDS and the PostgreSQL Database to protect data while it is being transferred across the two systems.

For complete information, see the following sections of the PostgreSQL documentation:

The following section describes a sample procedure to set up such configuration (using OSX):

1_Generate keys:

{{openssl req -new -x509 -days 365 -nodes -text -out server.crt \ }}
> -keyout server.key -subj "/CN=localhost"

change permission on the server key:
sudo chmod 640 server.key

2_Move the server certificate in the postgresql data folder:
sudo cp /Users/usr/certificates/server.crt /Library/PostgreSQL/10dop/data

3_Add the self-signed certificate to JVM truststore:
sudo /Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/bin/keytool -import -v -trustcacerts -alias server-alias -file server.crt -keystore cacerts.jks -keypass <password> -storepass <password>

4_Change the server configuration in /Library/PostgreSQL/10dop/data/postgresql.conf:

from
#ssl = off
to
ssl = on

5_Restart the server:

{{sudo -u postgres bash
sudo ./pg_ctl -D /Library/PostgreSQL/10dop/data restart}}

6_In the Appway Studio (PostgreSQL Data Source), add ssl=true&sslmode=require as Connection Properties.

As an example, information regarding securing network exchanges with PostgreSQL on Amazon RDS can be found at Using SSL with a PostgreSQL DB Instance.

2.2 Information Security for Oracle

2.2.1 Storage of Data for Oracle

Similarly, Oracle provides two preventive measures to avoid unwanted access to information: Transparent Data Encryption, which encrypts data to prevent accessing sensitive information in storage, and Data Redaction, which reduces the exposure of sensitive information by redacting database query results according to defined policies.

For more information on security, see the following links:

2.2.2 Network Exchanges for Oracle

You can secure the communication between Appway BDS and the Oracle Database to protect the data while it is being transferred across the two systems.

See more details about the setup of such configuration in the Oracle documentation: Configuring Secure Sockets Layer Authentication.

2.3 Information Security for MsSQLServer

2.3.1 Storage of Data for MsSQLServer

MsSQLServer provides different preventive measures to avoid unwanted access to information. Similarly to what is suggested for Oracle, a suitable option is Transparent Data Encryption, which encrypts data to prevent accessing sensitive information in storage.

For more information on security, see the following links:

2.3.2 Network Exchanges for MsSQLServer

You can secure the communication between Appway BDS and the MsSQLServer Database to protect the data while it is being transferred across the two systems.

See more details about the setup of such configuration in the Microsoft documentation: Configuring Secure Sockets Layer Authentication.

2.4 Auditing Operations in PostgreSQL

Auditing is achieved through the logging feature of PostgreSQL (see the PostgreSQL Error Reporting and Logging documentation section).

The following paragraph describes a sample procedure to setup such configuration on PostgreSQL.

1_Set the BDS configuration property log.userids.enabled to true.

2_Change the PostgreSQL configuration file /Library/PostgreSQL/10dop/data/postgresql.conf setting so that:

  • the property log_line_prefix contains the application_name %a variable content:
    log_line_prefix = ' %a -> %m [%p] '
  • and the property _log_statement _ specifies which kinds of statements have to be logged.
    log_statement = 'all'

3_Restart the server as database bash user:

cd /Library/PostgreSQL/10dop/bin
./pg_ctl -D /Library/PostgreSQL/10dop/data restart

log files are saved in : /Library/PostgreSQL/10dop/data/log

The application_name is populated by the BDS in the format: 'Appway BDS [userID]'.

The following text file contains an example procedure: the first actions have been performed by the user NM while the following ones have been performed by the user AnotherUser.
Text File.

2.5 Auditing Operations in Oracle

An Application Context labeled with 'bds_user' and managed by a PL/SQL procedure is used as a mechanism to add the user information in auditing entries through the Unified Audit.

Prerequisites:

  • An Appway Data Source connected to an Oracle Database. The Database user used in the Data Source to connect to the Database is referred to as 'DataSourceUser' from now on.
  • SYS access to the Database (or an equivalent one with rights to perform listed actions).
  • Bash shell access on the Database host and a PL/SQL client.
  • The BusinessDataStorage configuration property userid.log.enabled set to true.

As a SYS user, follow these steps:
1_Instruct the database to include the values of 'namespace bds_namespace' and attribute 'bds_user' in all audit records for the Data Source user. See audit statement information.

AUDIT CONTEXT NAMESPACE bds_namespace
	ATTRIBUTES bds_user
	BY <DataSourceUser>

2_Grant the EXECUTE privilege for the DBMS_SESSION PL/SQL package and the CREATE PROCEDURE privilege.

3_Set some audit policies.

As DataSourceUser, follow these steps on the Database:

1_Create the required context.
CREATE CONTEXT bds_namespace USING bds_package;

2_Create the required package and package body.

CREATE OR REPLACE PACKAGE bds_package IS 
   PROCEDURE set_value (bds_user IN VARCHAR2); 
END; 
 /    
CREATE OR REPLACE PACKAGE BODY bds_package IS
   PROCEDURE set_value (bds_user IN VARCHAR2)
   IS
     BEGIN
        DBMS_SESSION.SET_CONTEXT('bds_namespace', 'bds_user', bds_user);
   END; 
END;
 /

2.6 Auditing Operations in MsSQLServer

A session context value labeled as "bds_user" is set through the execution of the set session context function to provide the user information for auditing purposes.

This value can be then accessed from a MsSQLServer customizable audit mechanism by performing this query:

SELECT SESSION_CONTEXT(N'bds_user');

3 Related Links

Business Data Storage article.

© 2026 Appway AG. All Rights Reserved