I have a program that updates a DBM file owned by a service account to cache the result of an expensive query.

We now need user accounts to be able to run this program to query and cache. There is no risk of misuse by users and concurrency is not an issue, but we do want to prevent accidental deletion of the DBM, for example. A theoretical concern exists if an intruder obtained access to the user's shell account, the setuid approach might provide a vector to execute code as the service account that might not otherwise exist.

We have thought of three approaches to permitting access:

The setuid approach is somehow preceived as more risky by IT as it is a well-known risk. My own take is that the webserver opens up risks that are not obvious (and probably exposes some of the same risks as setuid -- namely code may be executed in the name of the service account if the attacker controls the code that updates the DBM). The database approach would be new for us -- and thus implies additional maintenance, infrastructure, and potentially, new authentication surfaces not already in place. However, the database is a well-understood security problem but we perhaps lack in-house experience to approach it correctly.

Wise Monks, my problem cannot be unique. Is there another approach not considered here? What is the best way?


In reply to Setuid vs. Web Server by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.