Passwordless connection string to SQL Server?

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Passwordless connection string to SQL Server?

    Hi,

    Crossing over from the Unix world, I am quite stumped at this: how can
    I specify a DB connection string to SQL Server without 1) putting
    username/password into the string, and 2) without giving the user the
    right to access the database directly?

    Looks like there are two ways, basically, to specify a connection
    string, either with ODBC or OLEDB: the username and password are
    either included into the string itself, or the Windows crendentials
    are used to let the browser access the page, and then *the same
    credentials* are passed to the SQL Server. But what if I don't want
    this user to be able to access the database directly, but only through
    the web page?

    In Unix, I could do two other things - 1)make the web page readable to
    the web server, but not to the user who logs in, so that he could
    never look at the file itself. Does not work in Windows, as the file
    is by definition readable by the user via file sharing if it's
    executable by him through the web. Or 2) hide the connection string in
    the ODBC definition and have a *different* account access the
    database.

    Or am I missing something?

    Thanks,
    Simon
    Simon Guest

  2. Similar Questions and Discussions

    1. Server.MapPath connection string question.
      I have two sites: www.site_A.com & www.site_A_news.com Site_A is in d:\webs\site_a & uses an Access DB in d:\webs\site_a\data\db.mdb ...
    2. encrypting SQL server connection string in web.config
      In my web.config I am storing a connection string to SQL server, along with password and user name. My goal is to somehow encrypt the string so it...
    3. SQL Server connection string works with IIS 5.1 but not IIS 6 in ASP.NET
      Hello, I have a very simple aspx file that runs on WinXP Pro IIS 5.1 and connects to a SQL Server 2k DB running on a Win2003 Server box. It works...
    4. Appication name in SQL Server connection string
      Hi group, Does anyone know how I can pass an application name in my connection string and have it be recognized by SQL Server? I have this...
    5. Connection String to connect to SQL Server Database
      http://www.able-consulting.com/ADO_Conn.htm Brian Staff
  3. #2

    Default Re: Passwordless connection string to SQL Server?

    You could set the password to the IUSR_ account yourself, and use windows
    authentication to connect to the database... your end users won't be able to
    log on as IUSR_machinename and connect. However, if they can create an ASP
    page on the file system, they can easily write SQL statements like "TRUNCATE
    TABLE x" or "SELECT username, password, salary FROM users"

    (Note that executing a file through IIS is not the same as reading/writing
    the file in the file system.)





    "Simon" <simonf@simonf.com> wrote in message
    news:3226c4d3.0308111306.2b9ef850@posting.google.c om...
    > Hi,
    >
    > Crossing over from the Unix world, I am quite stumped at this: how can
    > I specify a DB connection string to SQL Server without 1) putting
    > username/password into the string, and 2) without giving the user the
    > right to access the database directly?
    >
    > Looks like there are two ways, basically, to specify a connection
    > string, either with ODBC or OLEDB: the username and password are
    > either included into the string itself, or the Windows crendentials
    > are used to let the browser access the page, and then *the same
    > credentials* are passed to the SQL Server. But what if I don't want
    > this user to be able to access the database directly, but only through
    > the web page?
    >
    > In Unix, I could do two other things - 1)make the web page readable to
    > the web server, but not to the user who logs in, so that he could
    > never look at the file itself. Does not work in Windows, as the file
    > is by definition readable by the user via file sharing if it's
    > executable by him through the web. Or 2) hide the connection string in
    > the ODBC definition and have a *different* account access the
    > database.
    >
    > Or am I missing something?
    >
    > Thanks,
    > Simon

    Aaron Bertrand [MVP] Guest

  4. #3

    Default Re: Passwordless connection string to SQL Server?

    You could also embed the connection in a COM object, use the
    global.asa, or just put the username/password combo in the string,
    since it's not actually sent to the end user. Stored Procedures,
    Views, App Roles and SQL permissions for the connecting account can
    all define security restrictions further.

    Jeff

    On Mon, 11 Aug 2003 18:16:36 -0400, "Aaron Bertrand [MVP]"
    <aaron@TRASHaspfaq.com> wrote:
    >You could set the password to the IUSR_ account yourself, and use windows
    >authentication to connect to the database... your end users won't be able to
    >log on as IUSR_machinename and connect. However, if they can create an ASP
    >page on the file system, they can easily write SQL statements like "TRUNCATE
    >TABLE x" or "SELECT username, password, salary FROM users"
    >
    >(Note that executing a file through IIS is not the same as reading/writing
    >the file in the file system.)
    >
    >
    >
    >
    >
    >"Simon" <simonf@simonf.com> wrote in message
    >news:3226c4d3.0308111306.2b9ef850@posting.google. com...
    >> Hi,
    >>
    >> Crossing over from the Unix world, I am quite stumped at this: how can
    >> I specify a DB connection string to SQL Server without 1) putting
    >> username/password into the string, and 2) without giving the user the
    >> right to access the database directly?
    >>
    >> Looks like there are two ways, basically, to specify a connection
    >> string, either with ODBC or OLEDB: the username and password are
    >> either included into the string itself, or the Windows crendentials
    >> are used to let the browser access the page, and then *the same
    >> credentials* are passed to the SQL Server. But what if I don't want
    >> this user to be able to access the database directly, but only through
    >> the web page?
    >>
    >> In Unix, I could do two other things - 1)make the web page readable to
    >> the web server, but not to the user who logs in, so that he could
    >> never look at the file itself. Does not work in Windows, as the file
    >> is by definition readable by the user via file sharing if it's
    >> executable by him through the web. Or 2) hide the connection string in
    >> the ODBC definition and have a *different* account access the
    >> database.
    >>
    >> Or am I missing something?
    >>
    >> Thanks,
    >> Simon
    >
    Jeff Cochran Guest

  5. #4

    Default Re: Passwordless connection string to SQL Server?

    Simon,

    You could potentially use a COM+, dummy object, that takes queries from ASP
    page and merely executes them on the database server. You could run this
    COM+ object under a certain user (impersonate, basically), and use a trusted
    connection to SQL server. That way, you:

    1. Hide password to SQL Server (in fact, you don't use it anywhere)
    2. Execute statements on the web user's behalf

    You can get very creative in terms of security.

    --
    Manohar Kamath
    Editor, .netBooks
    [url]www.dotnetbooks.com[/url]


    "Simon" <simonf@simonf.com> wrote in message
    news:3226c4d3.0308111306.2b9ef850@posting.google.c om...
    > Hi,
    >
    > Crossing over from the Unix world, I am quite stumped at this: how can
    > I specify a DB connection string to SQL Server without 1) putting
    > username/password into the string, and 2) without giving the user the
    > right to access the database directly?
    >
    > Looks like there are two ways, basically, to specify a connection
    > string, either with ODBC or OLEDB: the username and password are
    > either included into the string itself, or the Windows crendentials
    > are used to let the browser access the page, and then *the same
    > credentials* are passed to the SQL Server. But what if I don't want
    > this user to be able to access the database directly, but only through
    > the web page?
    >
    > In Unix, I could do two other things - 1)make the web page readable to
    > the web server, but not to the user who logs in, so that he could
    > never look at the file itself. Does not work in Windows, as the file
    > is by definition readable by the user via file sharing if it's
    > executable by him through the web. Or 2) hide the connection string in
    > the ODBC definition and have a *different* account access the
    > database.
    >
    > Or am I missing something?
    >
    > Thanks,
    > Simon

    Manohar Kamath [MVP] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139