Restrict database connection to application running from a network share using TNSNames - database

I have a somewhat unique(though probably not) situation. I have users that access a 3rd party application over a network share. This application connects to an Oracle database. The problem is, we have Production, QA, Test, and Dev databases and separate shares/applications for each, but the application doesn't care what database it connects to. So I have users launching the Test application for testing and they log into the Production database. This causes major issues.
Is there any way to restrict what database they log into by network share?
I tried using TNSNames on each server that houses each version of the application and that works great...if they are running it on the server, but since all users have Oracle installed on their local machines and they run the application from a network share, their Oracle takes over and allows them to connect to any database (using LDAP).

Related

Deployment of ASP.NET Core Web application

I am starting to write an open source application which is intended to be deployed on premises with MS SQL Server as backend. Now I was wondering how to go about deploying the application and the SQL Server backend.
For MSSQL there is a pretty clear installation path but I was wondering how I could create an easy installer for the web application. The idea is to copy the website to some location, start it and then call a special installation controller where the user could specify a database user with elevated privileges (such as the 'sa' user). The website should then create some database users, views and tables on that database and perform the initial setup. Additionally, it should also modify the configuration of the website to use the correct database user.
Of course, other ideas are welcome as well. How do you handle the deployment of a website for a small company which doesn't have dedicated IT staff.

Deploying a Microsoft Access application with SQL Azure

How can I deploy Access applications to multiple companies, with linked tables to SQL Azure servers?
I'm planning to deploy the Access programs with Microsoft Access runtime, and I'm assuming that I'll need to include the odbc drivers as well? Is there a way to automatically have Azure create a new server when a company signs into my website and downloads a program, and have the Access program link to it? And is there a way to get around the IP address settings in Azure as well? Because companies will be using the programs on multiple PCs. Or is it possible to utilise that and charge per PC?
If you distribute the application pre-linked, then the user should not have to do anything to consume the data.
When using Access with SQL server you can in general use the standard windows built in SQL driver. However in the case of Azure you do need to download + install the native 11 drivers (so I recommend you use that driver during development and setup).
You can also have code include to re-link to the sql server, but as noted, if your application is “already” linked, then you really don’t have to do anything on application startup. Such re-linking would not be required every time the application starts, but only a “one time” re-link is required say if you’re going to change the database, or perhaps the user logon. How to re-link (DSN less) is outlined here:
http://www.accessmvp.com/DJSteele/DSNLessLinks.html
As noted, you really don’t need the above.
As for IP restrictions, in the Azure setup you can turn off such restrictions if you need a connection that will occur from any location, but that does open up a security hole. (when you first create the SQL database you will be prompted for firewall rules).
All of the above assumes you been developing that Access application with SQL server as the back end (you can even use the free edition of SQL express for development on your local machine).
Last but not least:
Because your connection is occurring OVER the internet, then you speed will be MANY times slower then using a local server. Read the following article to get a “grasp” of this speed difference:
http://www.kallal.ca//Wan/Wans.html
So MUCH additional work is required in Access to obtain good performance when your connection is OVER the internet as opposed to SQL server running on your local network.

SSAS cube deployment to multiple machines

We have SQL server database setup on each client production machine. Now i want to deploy the cube created to all client's production machine. How this can be achieved without creating different cubes for each client? Is it possible to just change the connection string and deploy it on the client machine. All client machine has same database schema but database name is different.
Ignoring the fact that you have a SQL Server database set up on each client machine instead of a dedicated AS server that they all connect to (huge waste of money for licenses since you can't do AS on Express), in the AS Solution, go to Project on the menu bar and select Properties. You should see a dialog box with 3 options on the left: Build, Debugging, Deployment. Go to the Deployment tab. In there, you can select the Target Server (their computer name) and the database (their database name) that the cube will be deployed to.
Again, this is horrible practice and I assume there is some reason why you are deploying like this. I imagine there will be permission issues you have to sort out for this type of deployment.

Connect PhpMyAdmin to database in server

I have PhpMyAdmin and MySQL running in Windows 8.
I have installed them using Apache friends XAMPP v 3.1, so I didn’t do any configuration myself.
Currently if I go to localhost/phpmyadmin">http://localhost/phpmyadmin, then it automatically shows my local MySQL db and tables.
That I need is connect to remote server(it has MySQL) and runnig locally in my machine , for teh user of one app.
How can I connect to that server from phpmyadmin.
I’ve been trying to find if there any kind of connect panel in phpmyadmin, but no fruit yet.
For rather severe security reasons applicable servers to connect to are not configured at runtime but in the core configuration file config.inc.php. Otherwise a single hacked database account on an edge server could easily expose the entire network for brute force hacking, or tunneling into LAN-only unsecured databases.

Security model (deployment) for MS Access application with SQL Server Backend

We have an application, consisting of an MS Access frontend (2007, mdb format), a few .net libraries and an SQL Server (2008) backend. I am working on an installer, which automatically installs the MS Access Runtime, our application, our libraries, SQL Server Express and configures everything.
Clearly, the MS Access application and the libraries (running in a normal, non-admin user context) need access to the SQL Server database. What is the best way to grant access to the application?
This is what I came up with. Unfortunately, all of these seem to have drawbacks:
SQL Server Compact Edition: Does not support views.
Application Roles: This seems to be best practice. However, it requires executing a stored procedure before accessing the database (I cannot pass the app credentials in the connection string). Thus, I cannot use this to attach the SQL Server tables as a linked tables in the Access MDB, which is a requirement of our Access application.
SQL Server User Instance: To quote from MSDN: "This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work..."
SQL Authentication: Microsoft says: "When possible, use Windows Authentication."
Using Windows authentication and granting BUILTIN\USERS full access: This is by far the easiest solution, but somehow it "seems wrong" to do that...
The application is targeted at a non-technical audience, so asking the user to configure permissions is not an option.
EDIT: Some clarification: It's a "local" application, i.e., the SQL Server is located on the same machine as the application; SQL Server access from the network is neither necessary nor desired. The software (a regular business application for managing stocks, invoices, etc.) will be available to download for free, so it should run in a variety of environments (domain/non-domain, different operating systems, etc.), and IT knowledge should not be required to install it -- apart from the usual "click on setup.exe, confirm UAC prompt, acknowledge the installation directory, etc.". I expect the most common scenarios to be "Windows XP, local admin user" and "Windows Vista/7, local admin user with UAC enabled". Since we want to follow good practices, running the application should not require "Run as Administrator" in the latter case.
#Heinzi write:
Using Windows authentication and
granting BUILTIN\USERS full access:
This is by far the easiest solution,
but somehow it "seems wrong" to do
that...
The usual approach here is to add a custom user group (e.g., "db-users") and put the users in that group. That way you can control exactly who is allowed access.
How about:
Use an Access ADP project, pre-configured to connect to the locally installed SQL Server instance.
Connect using BuiltIn\Users group (or SQL authentication) but grant only the bare minimum credentials. Enough to logon and ...
Call sp_setappprole to "elevate" the client connection to your defined application role's identity.
If sound like you have only got the tie of the iceberg. When it comes to selling and deploying access SQL applications.
I have take a different route. I have virtual computers as standalone workstation and domain server and workstation all virtual.
I have write a scripts they are a combination of VBA and VBScript.
Ask
Is the DB and App to run on single computer or different computers.
If different computer what is the name of the computer the DB is located on.
Is the DB and App to in a workgroup, homegroup or domain environment
Is the DB computer already have SQL Express or above
Is the App computer already have Access or Access Runtime installed.
If yes which version.
Will all or only limited users have access.
If limited what is the user group name of user to be have access to the data.
Does this group already exist
If No List the Name of the Users that Should Be Added to the Group
Also questions about the Admin Users and Group
The script start the virtual machines and goes through a series of steps to rep the MDB and SQL DB for deployment. Then creates an MSI for the Server Install with include a custom script that sets up the environment. Finally packages MDB in a nice MSI.
I have since enhanced the process to allow some questions to be answered at the beginning of the server installation. This means the user groups and users can be selected from the lists in the workstation or domain depending on prior questions asked.
If user the app user is a member of the Admin Group of the Workstation or Domain. They get extra menu options. That allow them to add or remove members from the DB user group for the workstation or domain. This I find is helpful.
I am now moving to the next stage and looking at hosting my assess app as an SasS (Software as a Service) (Rental). So the app can be use in any HTML5 Browser, Windows or Mac as Virtual Desktop or Android and Apple device. Having said that Access is a bit ugly on mobile devices.
When I am up and running I will make the platform available to others.

Resources