Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

When using SQL for Confluence on sites with untrusted users, you may need to employ security measures to control use. This describes some of the techniques for doing this. In some cases, you may want to employ multiple techniques together depending on factors like database being accessed. For instance, macro security can be applied no matter what other technique you want to use. 

...

  • Enables trusted users to provide important content.
  • Controlled at the user, group, and database level.

...

  • Controls what database operations are allowed.
  • Ease concerns for database or security administrator.

...

Restrict access to query only.

...

Only pre-defined SQL can be run.

...

Data is shown based on user id and role.

...

Prevent SQL injection attacks by using parameter markers. This is only necessary when the SQL statements are partially constructed from user input - for example, using the RUN. See Wikipedia: SQL injection. Parameter markers are supported by SQL for Confluence.

...

Prevent SQL injection attacks when users are allowed to provide statement construction input.

Tip
titleConfluence database access

If Confluence database access is defined via an application server based data source, Confluence data can be accessed by the SQL macros using that data source unless other security techniques prevent access. This can be powerful in many circumstances but should be access controlled just like other databases. Direct access to a database circumvents application level security, so should always be considered. Even if you want to provide some level of access to the Confluence database, it is strongly recommended to create a separate data source for this access. Either duplicate the application server data source definition that Confluence uses and provide a different name (preferred) or create a profile defined data source. To prevent access to the Confluence defined data source, either use CMSP to disallow access or define a profile defined data source with the same name as the application data source and override the values or re-direct to some other data source.

...

Include Page
SUPPORT:How to use SQL macros securely
SUPPORT:How to use SQL macros securely