keys are signed as well. It is possible that a specific
key value is allowed in one report, but not allowed
for this user in another report. For example, it is al-
lowed to print all employees of a department (report
X with department ID as a parameter value), but not
their salaries (report Y with department ID). In order
to prevent “signed keys stealing” the server’s secret
include randomly generated report instance identifier.
Signing individual parameters may not be very
convenient if a reference to report containing a lot
of parameters has to be generated. It is possible to
publish a GET request on a web page using custom
Django template tag sign_url.
<a href="{% sign_url "/sqlreports/?..." %}">
...</a>
In this case the entire string is signed in an OAUTH-
like fashion: all report parameters are sorted by name
and then by value (it is allowed to insert additional
key/value pairs into request, e.g. session id, that will
not be included into signature) . If signed request ar-
rives to reports server then all it’s values are consid-
ered trusted.
In addition to parameter checking procedures,
role-based access control (Ferraiolo et al., 1999; Gior-
dano and Polese, 2013) may be used to prevent users
from executing arbitrary reports. Issues related to ac-
cess control lay out of the scope of this article.
Report inclusion command can be dangerous,
even in the simples from when all parameters are
just copied from top-level report. Indeed, if a re-
port defines an input parameter then report’s devel-
oper can pass arbitrary value. The main question here
is: Should we trust report’s developers, or they are
malicious by default? This question is especially rel-
evant if we allow users to share their reports. In this
work we assume that report’s developer are all trusted.
Nevertheless, if an underlying databases system pro-
vides methods for advanced access control, then ad-
ditional security checks may be implemented. For
example, a reasonable security policy may state that
a user is allowed to access any data from his own
department or institution, but should not be able to
access records form other departments. In Oracle
database system it is possible to enforce such con-
straints by calling one stored procedure before each
report. This procedure will setups effective id for
the session and all subsequent select queries will only
be able to select records related to that department.
Clearly, that such constraints are application-specific
and can not be realized in a general purpose reporting
server.
5 CONCLUSION
Many open source and commercial reporting systems
are available. These systems share common features
like parameterized SQL queries, formatting direc-
tives, data post-processing, cross-references between
reports. In this work we propose a minimalistic sys-
tem that aimed to rapid (one-click) development of in-
teractive reports with standard tabular representation
of report’s results. We believe that this approach may
be useful for solving both quick data analyzing and
data cleaning tasks.
It is not clear whether or not powerful construc-
tions should be added the template language. Param-
eters bindings and query inclusion, and cross-reports
links are simple concepts. It is not very difficult to
start using this concepts for someone familiar with
SQL. Conditional processing of SQL queries may
be quite powerful, provided that the parameterized
queries remain readable. More sophisticated means,
such as post-processing functions, loops over result-
ing rows, filtering constraints, variables, and arith-
metic operations push the language toward universal-
ity (if not Turing completeness), but by the cost of a
much more specific language. Some simple features
are definitely should be implemented. For example, it
seems that a boolean variables will be useful for elim-
ination of repeated constraints in if -clauses (one can
expect what the same condition might appear in SE-
LECT, FROM and WHERE parts of a query if some
tables should be joined only if condition holds). In
any case, further developments of template language
should be based on user’s feedback.
As it was mentioned in (Gjorgjevikj et al., 2011),
most of database users are not familiar with technol-
ogy basics. In an information system we are working
on no more then one percent out of 15 thousand users
are able and willing to develop SQL queries. From
the other hand, a report developed by one user may
be useful for other users. Apart from improvements
of template language, a possible direction of future
work may include the development of reports sharing
tools. This requires advertising/navigation/searching
tasks (how a user can discover what was already done
by others?) and some elements of version control: if
a report depends on a report of another user and that
report has changed, should we automatically update
the first report? It seems that there is no general solu-
tion that fits all needs and one should support at least
version freezing and “dynamic” links pointing to the
most recent version of a report. Finial decision about
“linking” strategy can be made by report developer
only.
SQLReports-YetAnotherRelationalDatabaseReportingSystem
533