Actions

Namigi za varno namestitev

From LimeSurvey Manual

Revision as of 10:50, 7 August 2013 by Dusan (talk | contribs) (Created page with "Na primer če je vaše uporabniško ime 'mojračun' in je uporabnik spletnega strežnika 'apache' v skupini 'apache', potem lahko iz ukazne lupine uporabite sledeč ukaz:")

Splošno

LimeSurvey se zanaša na svoj lasten varnostni sistem, ki je samodejno vključen. Avtorji tega programa ne prevzemajo nobene odgovornosti in ne dajejo nobenih izjav v zvezi z ustreznostjo ali varnostjo te opreme. Kljub temu jemljemo varnost zelo resno in hitro reagiramo. Če veste za kakršen koli varnostni problem z LimeSurvey-em, nas prosimo obvestite na naš portal za sledenje težavam (imejte v vednosti, da je zaseben).

Pravice na Linux-ovih datotekah

Če uporabljate Linux strežnik, so za zaščito vašega nameščenega LimeSurvay-a potrebne nastavitve ustreznih pravic na datotekah.

Osnovna dejstva o pravicah na Linux/*nix datotekah

Linux/*nix operacijski sistem je večuporabniški. To pomeni da poleg vašega osebnega računa lahko na sistemu obstajajo še drugi uporabniški računi in je potrebno paziti, kakšne pravice dajate ostalim uporabnikom.

Namig: Nastavljanje pravic na datotekah je še posebej pomembno pri zaščiti konfiguracijskih datotek, ki vsebujejo zelo kritične podatke kot so gesla.

Upoštevajte, da ima 'root' račun kot super skrbniški uporabnik vedno odobren dostop do vaših datotek (ne glede na to, kakšne pravice nad datotekami ste nastavili).

Spletni strežnik (na katerem teče LimeSurvey) teče pod točno določeno identiteto (uporabnikom). Na Linux-u je to običajno uporabnik 'www','www-data' (na Debian/Ubuntu), 'apache' ali 'nobody'. Nekateri ponudniki za gostovanja uporabljajo sisteme (kot je suexec), ki omogočajo zaganjanje LimeSurvey-evih zagonskih datotek z vašim osebnim uporabniškim računom. Seveda morajo imeti uporabniki na spletnih strežnikih pravico branja na LimeSurvey-evih datotekah. Le manjša skupina LimeSurvey-evih podmap mora biti zapisljivih s strani spletnih uporabnikov.

Namig: zelo pomembno je, da prekličete pravico pisanja za spletnega uporabnika nad tistimi podmapami, ki tega ne potrebujejo. Čeprav bi se morda našle ranljivosti v LimeSurvey-u, bi bile glavne datoteke še vedno zaščitene pred nedovoljenim spreminjanjem zahvaljujoč sistemskim pravicam nad datotekami.

Nastavljanje pravic nad datotekami na Linux-sistemu v lastnem upravljanju

Če upravljate lasten spletni strežnik in operacijski sistem (ste lastnik strežnika ali imate v najemu virtualni strežnik, na katerem imate korenski dostop), lahko upoštevate ta priporočila.

Najprej lahko nastavite lastnika in skupino vaših LimeSurvey-evih datotek, s čimer bo olajšano nastavljanje pravic nad datotekami.

Eden možnih pristopov je, da nastavite za lastnika LimeSurvey-evih datotek vaše osebno uporabniško ime in skupino LimeSurvey-ih datotek skupino spletnega strežnika. Običajno ta skupina spletnega strežnika vsebuje le račun spletnega strežnika (in najverjetneje še kakšen račun za spletnega skrbnika).

Na primer če je vaše uporabniško ime 'mojračun' in je uporabnik spletnega strežnika 'apache' v skupini 'apache', potem lahko iz ukazne lupine uporabite sledeč ukaz:

$ chown -R myaccount:apache limesurvey/

Then set the file and subdirectories permissions.

For the script to work properly it needs write access to some directories:

  • The "/limesurvey/tmp" directory and its subdirectories are used for imports/uploads and should be set to Read & Write for your webserver.
  • The upload/ directory and all its subdirectories must also have Read & Write for your webserver in order to enable picture and media files upload.
  • All other directories and files can be set to Read Only
Hint: Supposing you've followed the above recommendations on owner/group, these settings can be applied by the following commands:

$ chmod -R o-r-w-x limesurvey/

$ chmod -R -w limesurvey/

$ chmod -R 770 limesurvey/tmp

$ chmod -R 770 limesurvey/upload

Setting file permissions on a hosted webserver

Giving a standard procedure to secure a web application on a hosted environment is rather difficult because hosted environments differ in so many ways.

As in the managed server case, for the script to work properly it needs write access to some directories:

  • The "/limesurvey/tmp" directory is used for imports/uploads and should be set to Read & Write for your webserver.
  • The upload/ directory and all its sub directories must also have Read & Write for your webserver in order to enable picture and media files upload.
  • The other directories and files should be set to Read Only
Hint:
  • Depending on your webserver configuration you will have to chmod the rights on the writable folders to 755 or 777 to make it writable for the webserver. Try 755 first - if it does not work 'upgrade' to 777.
  • You can also try to remove read access to config.php to others by setting this file's permissions to 750 - if it does not work 'upgrade' to 755.

Windows file permissions

If you are using a windows server your should ensure that the admin folder allows the owner of the webserver process to write files to this directory, however all other files can be set to read-only and execute.

Other security issues

The following are recommendations only. LimeSurvey in general is very safe without these additional measure. If you however collect extremely sensitive data a little additional security can help:

The /application/config/config.php file contains a user name and password for your database server. This poses certain security issues, particularly if you are using a login that has high level administrative access to your database. In the event of some error returning the content of this PHP file to a user's browser, your database password and other details could be compromised (please note, that this is a very unlikely scenario). The best way to minimize risk is to set up a specific login that has specific rights only to your limesurvey database.

Another way to secure this information can be to put the certain information from the /application/config/config.php file in a non-web directory, i.e. for Apache users this is the directory above the htdocs (aka public_html or www) folder. So you will use config.php, but have one line in it - a line that includes the file with ACTUAL configuration information (ex: <?php return include("/home/hostfolder/safedata/configreal.php"); ?>). Remove all actual configuration information from /application/config/config.php, and paste it into the other file (configreal.php) that is included by /application/config/config.php. This other file should be located in a non-Web directory. Then /application/config/config.php will not contain database passwords, etc. - just the name of the file that DOES contain the database info. This avoids having to change all the other files that include /application/config/config.php, since they can still include it, and it will include the real config information. However you will need to edit configreal.php and change the follow parameters

'basePath' => dirname(dirname('''FILE''')),
'runtimePath' => dirname(dirname(dirname('''FILE'''))).DIRECTORY_SEPARATOR.'tmp'.DIRECTORY_SEPARATOR.'runtime',
[...]

'urlManager' => array(
   [...]
   'rules' => require('routes.php'),
   [...]
);

to use absolute directory paths to work properly. Example:

'basePath' => '/var/www/htdocs/limesurvey',
'runtimePath' => '/var/www/htdocs/limesurvey/tmp/runtime',
[...]

'urlManager' => array(
   [...]
   'rules' => require('/var/www/htdocs/limesurvey/config/routes.php'),
   [...]
);

Also don't use "admin" as the default user. Go to your MySQL database (or other one if you installed LimeSurvey on different database) and change default user name "admin" to whatever you prefer (e.g. "admin_xyz"). It will be now much harder to guess administrator's new user name. Remember, this is one of the two variables intruders can use to gain access. The admin password is the other variable. So choose it with extreme care.