Actions

Installation security hints/sl: Difference between revisions

From LimeSurvey Manual

(Updating to match new version of source page)
(Updating to match new version of source page)
Line 4: Line 4:
==Splošno==
==Splošno==


LimeSurvey relies on its own security, which is activated by default. The authors of this software take no responsibility and makes no claims regarding the appropriateness or security level of this software. However, we take security issues very seriously and react quickly. Therefore, if you know of any security problems within LimeSurvey, please let us know either by sending us an email to [mailto:info@limesurvey.org info@limesurvey.org] or by opening a bug report in our [http://bugs.limesurvey.org bug tracker] (please mark it as private).
<div class="mw-translate-fuzzy">
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š [http://bugs.limesurvey.org portal za sledenje težavam] (imejte v vednosti, da je zaseben).
</div>
 
==Web server restriction==
 
If you use apache, LimeSurvey include different htaccess file for restriction. verify you alow included htaccess with <code>AllowOverride</code>.
 
With other webserver or if you want to use <code>AllowOverride None</code> : you must
 
* (option) disable access to all files in application, protected, framework and themes/*/views
* disable access to file uploade by user /upload/surveys/.*/fu_[a-z0-9]
* (option) disable access on executable file in upload directory
 
You can find a sample for nginx on our [[General_FAQ#With_nginx_webserver|General Faq]]


==Pravice na Linux-ovih datotekah==
==Pravice na Linux-ovih datotekah==


If you are using a Linux server, setting file permissions accordingly is required to secure your LimeSurey installation.
<div class="mw-translate-fuzzy">
Če uporabljate Linux strežnik, so za zaščito vašega nameščenega LimeSurvay-a potrebne nastavitve ustreznih pravic na datotekah.
</div>


===Osnovna dejstva o pravicah na Linux/*nix datotekah===
===Osnovna dejstva o pravicah na Linux/*nix datotekah===
Line 14: Line 30:
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.
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.


<div class="simplebox">[[File:help.png]] '''Hint:''' setting file permissions is especially important in order to secure configuration files holding critical data such as passwords.</div>
<div class="mw-translate-fuzzy">
<div class="simplebox">[[File:help.png]] '''Namig:''' Nastavljanje pravic na datotekah je še posebej pomembno pri zaščiti konfiguracijskih datotek, ki vsebujejo zelo kritične podatke kot so gesla.</div>
</div>


'''Bear in mind that the 'root' account will always be granted permission to access your files (no matter what file permissions you set) as it is the super-admin user.'''
<div class="mw-translate-fuzzy">
''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).''
</div>


The web server (which runs LimeSurvey) is also running under a given identity (user). On Linux, this is usually the 'www', 'www-data' (on Debian/Ubuntu), 'apache' or 'nobody' user. However, some hosting companies use systems (such as suexec) that make it possible to run LimeSurvey scripts with your personal user. Of course, the web server user must have the right to read LimeSurvey files. However, only a small subset of LimeSurvey sub-directories must be writable by the web server user.
<div class="mw-translate-fuzzy">
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.
</div>


<div class="simplebox">[[File:help.png]] '''Hint''': it is very valuable to revoke write permission for the web server user to these LimeSurvey sub-directories that do not require it. Indeed, even if a LimeSurvey vulnerability might be discovered, the main files will still be protected from an illicit modification thanks to the file system permissions.</div>
<div class="mw-translate-fuzzy">
<div class="simplebox">[[File:help.png]] '''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.</div>
</div>


===Nastavljanje pravic nad datotekami na Linux-sistemu v lastnem upravljanju===
===Nastavljanje pravic nad datotekami na Linux-sistemu v lastnem upravljanju===


If you're managing your web server and operating system configuration (you are the owner of the physical server or are renting a virtual server on which you have root access), you may consider the following recommendations from below.
<div class="mw-translate-fuzzy">
Č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.
</div>


You can first set the owner and group of your LimeSurvey files so that it will ease the file permissions setup. A possible strategy is to set the owner of the LimeSurvey files to your personal username, and the group of the LimeSurvey files to the web server group. Usually, this web server group only contains the web server account (and possibly another webmaster account). For instance, if your username is 'myaccount' and the webserver user is 'apache' in the 'apache' group, then, from a shell access, you can use the following command: <code>$ chown -R myaccount:apache limesurvey/</code>. Subsequently, set the file and sub-directories permissions.
You can first set the owner and group of your LimeSurvey files so that it will ease the file permissions setup. A possible strategy is to set the owner of the LimeSurvey files to your personal username, and the group of the LimeSurvey files to the web server group. Usually, this web server group only contains the web server account (and possibly another webmaster account). For instance, if your username is 'myaccount' and the webserver user is 'apache' in the 'apache' group, then, from a shell access, you can use the following command: <code>$ chown -R myaccount:apache limesurvey/</code>. Subsequently, set the file and sub-directories permissions.


For the script to work properly, the write access to some directories is needed:
<div class="mw-translate-fuzzy">
*The /limesurvey/application/config directory requires ''Read & Write'' for saving the application configuration settings
Da bodoukazne datoteke (skripte) ustrezno delovale, potrebujejo pravico pisanja nad nekaterimi mapami:
*The /limesurvey/tmp directory and its sub-directories are used for imports/uploads and should be set to ''Read & Write'' for your web server
*"/limesurvey/tmp" mapi in njenih podmapah, ki se uporabljajo za uvažanje/nalaganje in morajo biti nastavljene na  ''branje in pisanje'' na vašem spletnem strežniku.
*The upload/directory and all its sub-directories must also have set ''Read & Write'' permissions in order to enable pictures and media files upload
*mapa upload/ in vse njene podmape prav tako potrebujejo pravico ''branja in pisanja'' na vašem spletnem strežniku, če želite omogočiti nalaganje slikam in medijskim datotekam.
* All other directories and files can be set to ''Read Only''
* vse ostale mape in datoteke so lahko nastavljeno na pravico ''samo za branje''
</div>


<div class="simplebox">[[File:help.png]] '''Hint:''' supposing you've followed the recommendations above on owner/group, these settings can be applied by the following commands:
<div class="mw-translate-fuzzy">
<div class="simplebox">[[File:help.png]] '''Namig:''' v kolikor boste upoštevali zgornja priporočila, lahko te nastavitve uveljavite z naslednjimi ukazi:
</div>


<code>$ chmod -R o-r-w-x limesurvey/</code>
<div class="mw-translate-fuzzy">
$ chmod -R o-r-w-x limesurvey/
</div>


<code>$ chmod -R -w limesurvey/</code>
<div class="mw-translate-fuzzy">
$ chmod -R -w limesurvey/
</div>


<code>$ chmod -R 770 limesurvey/application/config</code>
<div class="mw-translate-fuzzy">
$ chmod -R 770 limesurvey/tmp
</div>


<code>$ chmod -R 770 limesurvey/tmp</code>
<code>$ chmod -R 770 limesurvey/tmp</code>


<code>$ chmod -R 770 limesurvey/upload</code>
<div class="mw-translate-fuzzy">
$ chmod -R 770 limesurvey/upload
</div>


</div>
</div>


===Setting file permissions on a hosted web server===
<div class="mw-translate-fuzzy">
===Nastavljanje pravic nad datotekami na gostujočem spletnem strežniku===
</div>


Giving the difficulty of a standard procedure to secure a web application on a hosted environment, it is rather difficult because hosted environments differ in many ways.
<div class="mw-translate-fuzzy">
Posredovanje običajnega postopka za zaščito spletne aplikacije v gostujočih okoljih je težavno, saj se okolja za gostovanja med seboj razlikujejo na več načinov.
</div>


In the managed server case, the server needs write access to some directories in order for the script to work properly:
<div class="mw-translate-fuzzy">
*The /limesurvey/tmp directory is used for imports/uploads and should be set to ''Read & Write'' for your web server
Podobno kot v primeru strežnika v lastnem upravljanju je potrebna za pravilno delovanje zagonskih datotek (skript) pravica pisanja nad nekaterimi mapami:
*The upload/directory and all its sub-directories must also have ''Read & Write'' for your web server in order to enable pictures and media files upload
* "/limesurvey/tmp" mapi in njenih podmapah, ki se uporabljajo za uvažanje/nalaganje in morajo biti nastavljene na branje in pisanje na vašem spletnem strežniku.
* The other directories and files should be set to ''Read Only''
*mapa upload/ in vse njene podmape prav tako potrebujejo pravico ''branja in pisanja'' na vašem spletnem strežniku, če želite omogočiti nalaganje slikam in medijskim datotekam.
* vse ostale mape in datoteke so lahko nastavljeno na pravico ''samo za branje''
</div>


<div class="mw-translate-fuzzy">
<div class="simplebox">[[File:help.png]] '''Hint:'''
<div class="simplebox">[[File:help.png]] '''Hint:'''
* Depending on your web server configuration, you will have to chmod the rights on the writable folders to 755 or 777 to make it writable for the web server. Try 755 first, if it does not work, 'upgrade' to 777
* v odvisnosti od nastavitev vašega spletnega strežnika boste morali spremeniti pravico nad zapisljivimi mapami z ukazom ''chmode'' na 755 ali 777, da bodo postale zapisljive za spletni strežnik. Najprej poskušajte z 755 in če to ne bo delovalo 'povišajte' na 777.
* You can also try to remove other users' read access to config.php by setting this file's permissions to 750 - if it does not work, 'upgrade' to 755</div>
* prav tako lahko poskušate odstraniti pravico branja nad datoteko  config.php za ostale uporabnike z nastavitvijo pravice na 750 in če ne bo delovalo 'povišajte' na 755.</div>
</div>


==Pravice nad datotekami v okolju Windows==
==Pravice nad datotekami v okolju Windows==


If you are using a Windows server, your should ensure that the admin folder allows the owner of the web server process to write files to this directory, The rest of the files can be set to read-only and execute.
<div class="mw-translate-fuzzy">
Če uporabljate windows strežnik si morate zagotoviti, da skrbniške mape dovoljujejo lastniku procesov spletnega strežnika pisanje v datoteke v tem imeniku, sicer pa lahko imajo vse druge datoteke nastavljeno pravico samo za branje in izvajanje.
</div>


==Ostale varnostne zadeve==
==Ostale varnostne zadeve==


The following are recommendations only. LimeSurvey in general is very safe without these additional measures. If you however collect extremely sensitive data, a little additional security can help:
<div class="mw-translate-fuzzy">
V nadaljevanju so le priporočila. Na splošno je LimeSurvey zelo varen tudi brez teh dodatnih ukrepov. Če zbirate zelo občutljive podatke, lahko ti manjši dodatni varnostni ukrepi precej pomagajo:
</div>


===SSL usage===
===SSL usage===
We generally recommend the usage of SSL for sensitive survey data. You usually enable SSL by configuring your web server correctly and using a SSQL certificate. If you have enabled SSL, you should enforce SSL all the time from the [[Global_settings|global settings]] of LimeSurvey. Additionally, you could only set to use 'secure' cookies by editing the [[Optional_settings|respective option]] in config.php.
We generally recommend the usage of SSL for sensitive survey data. You usually enable SSL by configuring your web server correctly and using a SSQL certificate. If you have enabled SSL, you should enforce SSL all the time from the [[Global_settings|global settings]] of LimeSurvey. Additionally, you could only set to use 'secure' cookies by editing the [[Optional_settings|respective option]] in config.php.


=== The access to the config.php file ===
<div class="mw-translate-fuzzy">
Datoteka /application/config/config.php vsebuje uporabniško ime in geslo za podatkovno zbirko na vašem strežniku. To predstavlja določena varnostna vprašanja še posebej, če uporabljate vpis, ki ima precej visok nivo skrbniškega dostopa do vaše podatkovne baze. V primeru, da se vračajo na vsebino te PHP datoteke nekatere napake v uporabnikov brskalnik, bi lahko bile ogrožene vaše geslo podatkovne baze in druge podrobnosti (sicer je to zelo malo verjeten scenarij). Najboljši način zmanjšanja tega tveganja je nastavitev predvidenih vpisov, ki imajo določene pravice samo za vašo limesurvey-evo podatkovno zbirko.
</div>


{{Alert| You must update application/config/'''config.php''' only after the first installation is done and it works.}}  
{{Alert| You must update application/config/'''config.php''' only after the first installation is done and it works.}}  
Line 78: Line 129:
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 (however, 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.
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 (however, 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 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 (also known as public_html or www) folder. Basically, you will use config.php, but have one line in it - a line that includes the file with ACTUAL configuration information (ex: <code><?php return include("/home/hostfolder/safedata/configreal.php"); ?></code>). Remove all actual configuration information from /application/config/config.php and paste it into the other file (configreal.php) that is mentioned in the /application/config/'''config.php''' file. 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.  
<div class="mw-translate-fuzzy">
Drugi način za zavarovanje teh informacij je lahko prestavitev določenih podatkoviz datoteke /application/config/config.php file v mapo, ki ni v spletnem imeniku. Za Apache uporabnike je ta imenik znotraj mape htdocs (oziroma public_html ali www). Tako boste uporabljali datoteko config.php, vendar boste imeli v njej eno vrstico, ki vključuje datoteko z dejanskimi informacijami o nastavitvah (primer: <?php return include("/home/hostfolder/safedata/configreal.php"); ?>). Iz datoteke  /application/config/config.php odstranite vse aktualne informacije o nastavitvah in jih prilepite v drugo datoteko (configreal.php), ki je vključena v datoteki /application/config/config.php. Ta datoteka se mora nahajati izven spletnega imenika. V tem primeru datoteka /application/config/config.php ne bo vsebovala gesla podatkovne zbirke itd., pač pa samo ime datoteke, ki vsebuje informacije o podatkovni zbirki. S tem se izognete spremembam vseh drugih datotek vključenih v datoteki /application/config/config.php, glede na to da so še vedno vključene in bodo vsebovale realne informacije o nastavitvah. Boste pa morali urediti datoteko configreal.php in spremeniti naslednje parametre
</div>


This avoids having to change all the other files that include /application/config/config.php, since config.php 're-directs them' towards the configuration file that is located in a non-web directory which includes all the real configuration information. However, you will need to edit configreal.php and change the follow parameters to use absolute directory paths to work properly:
This avoids having to change all the other files that include /application/config/config.php, since config.php 're-directs them' towards the configuration file that is located in a non-web directory which includes all the real configuration information. However, you will need to edit configreal.php and change the follow parameters to use absolute directory paths to work properly:
Line 95: Line 148:
</syntaxhighlight>
</syntaxhighlight>


Example:
<div class="mw-translate-fuzzy">
da lahko uporabite absolutno pot do imenika, ki bo pravilno delovala. Primer:
</div>


<syntaxhighlight lang="php" enclose="div">
<syntaxhighlight lang="php" enclose="div">
Line 109: Line 164:
</syntaxhighlight>
</syntaxhighlight>


Also, '''don't use "admin" as the default user'''. Go to your MySQL database (or the one in which you installed LimeSurvey) and change default user name "admin" to whatever you prefer (e.g. "admin_xyz"). It will now be much harder to guess the 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 both of them with extreme caution.
<div class="mw-translate-fuzzy">
Prav tako ne uporabljajte "admin" uporabnika za privzetega uporabnika. Pojdite v vašo MySQL podatkovno zbirko (ali drugo, če ste namestili  LimeSurvey na drugi podatkovni zbirki) in zamenjajte privzeto uporabniško ime "admin" na karkoli drugega, ki vam ustreza (na primer "admin_xyz"). Tako bo veliko težje uganiti novo skrbniško uporabniško ime. Vedite da je to eden od dveh podatkov, ki ju vsiljivci potrebujejo za pridobitev dostopa. Drugi podatke je skrbniško geslo, zato ga izberite zelo pazljivo.
</div>
 
 
=== Content Security Policy (CSP) ===
 
'''DISCLAIMER - The CSP provided here is an example only and is not meant to used verbatim. It is meant as a starting point and you MUST adapt it to your needs and test it thoroughly.'''
<nowiki><IfModule mod_headers.c>
        Header always set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; base-uri 'none'; form-action 'self'; frame-ancestors 'self'; upgrade-insecure-requests" "expr=%{CONTENT_TYPE} =~ m#text\/(html|javascript)|application\/pdf|xml#i"
</IfModule></nowiki>

Revision as of 12:21, 9 March 2021

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).

Web server restriction

If you use apache, LimeSurvey include different htaccess file for restriction. verify you alow included htaccess with AllowOverride.

With other webserver or if you want to use AllowOverride None : you must

  • (option) disable access to all files in application, protected, framework and themes/*/views
  • disable access to file uploade by user /upload/surveys/.*/fu_[a-z0-9]
  • (option) disable access on executable file in upload directory

You can find a sample for nginx on our General Faq

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.

You can first set the owner and group of your LimeSurvey files so that it will ease the file permissions setup. A possible strategy is to set the owner of the LimeSurvey files to your personal username, and the group of the LimeSurvey files to the web server group. Usually, this web server group only contains the web server account (and possibly another webmaster account). For instance, if your username is 'myaccount' and the webserver user is 'apache' in the 'apache' group, then, from a shell access, you can use the following command: $ chown -R myaccount:apache limesurvey/. Subsequently, set the file and sub-directories permissions.

Da bodoukazne datoteke (skripte) ustrezno delovale, potrebujejo pravico pisanja nad nekaterimi mapami:

  • "/limesurvey/tmp" mapi in njenih podmapah, ki se uporabljajo za uvažanje/nalaganje in morajo biti nastavljene na branje in pisanje na vašem spletnem strežniku.
  • mapa upload/ in vse njene podmape prav tako potrebujejo pravico branja in pisanja na vašem spletnem strežniku, če želite omogočiti nalaganje slikam in medijskim datotekam.
  • vse ostale mape in datoteke so lahko nastavljeno na pravico samo za branje
Namig: v kolikor boste upoštevali zgornja priporočila, lahko te nastavitve uveljavite z naslednjimi ukazi:

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

$ chmod -R -w limesurvey/

$ chmod -R 770 limesurvey/tmp

$ chmod -R 770 limesurvey/tmp

$ chmod -R 770 limesurvey/upload

Nastavljanje pravic nad datotekami na gostujočem spletnem strežniku

Posredovanje običajnega postopka za zaščito spletne aplikacije v gostujočih okoljih je težavno, saj se okolja za gostovanja med seboj razlikujejo na več načinov.

Podobno kot v primeru strežnika v lastnem upravljanju je potrebna za pravilno delovanje zagonskih datotek (skript) pravica pisanja nad nekaterimi mapami:

  • "/limesurvey/tmp" mapi in njenih podmapah, ki se uporabljajo za uvažanje/nalaganje in morajo biti nastavljene na branje in pisanje na vašem spletnem strežniku.
  • mapa upload/ in vse njene podmape prav tako potrebujejo pravico branja in pisanja na vašem spletnem strežniku, če želite omogočiti nalaganje slikam in medijskim datotekam.
  • vse ostale mape in datoteke so lahko nastavljeno na pravico samo za branje
Hint:
  • v odvisnosti od nastavitev vašega spletnega strežnika boste morali spremeniti pravico nad zapisljivimi mapami z ukazom chmode na 755 ali 777, da bodo postale zapisljive za spletni strežnik. Najprej poskušajte z 755 in če to ne bo delovalo 'povišajte' na 777.
  • prav tako lahko poskušate odstraniti pravico branja nad datoteko config.php za ostale uporabnike z nastavitvijo pravice na 750 in če ne bo delovalo 'povišajte' na 755.

Pravice nad datotekami v okolju Windows

Če uporabljate windows strežnik si morate zagotoviti, da skrbniške mape dovoljujejo lastniku procesov spletnega strežnika pisanje v datoteke v tem imeniku, sicer pa lahko imajo vse druge datoteke nastavljeno pravico samo za branje in izvajanje.

Ostale varnostne zadeve

V nadaljevanju so le priporočila. Na splošno je LimeSurvey zelo varen tudi brez teh dodatnih ukrepov. Če zbirate zelo občutljive podatke, lahko ti manjši dodatni varnostni ukrepi precej pomagajo:

SSL usage

We generally recommend the usage of SSL for sensitive survey data. You usually enable SSL by configuring your web server correctly and using a SSQL certificate. If you have enabled SSL, you should enforce SSL all the time from the global settings of LimeSurvey. Additionally, you could only set to use 'secure' cookies by editing the respective option in config.php.

Datoteka /application/config/config.php vsebuje uporabniško ime in geslo za podatkovno zbirko na vašem strežniku. To predstavlja določena varnostna vprašanja še posebej, če uporabljate vpis, ki ima precej visok nivo skrbniškega dostopa do vaše podatkovne baze. V primeru, da se vračajo na vsebino te PHP datoteke nekatere napake v uporabnikov brskalnik, bi lahko bile ogrožene vaše geslo podatkovne baze in druge podrobnosti (sicer je to zelo malo verjeten scenarij). Najboljši način zmanjšanja tega tveganja je nastavitev predvidenih vpisov, ki imajo določene pravice samo za vašo limesurvey-evo podatkovno zbirko.

  You must update application/config/config.php only after the first installation is done and it works.


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 (however, 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.

Drugi način za zavarovanje teh informacij je lahko prestavitev določenih podatkoviz datoteke /application/config/config.php file v mapo, ki ni v spletnem imeniku. Za Apache uporabnike je ta imenik znotraj mape htdocs (oziroma public_html ali www). Tako boste uporabljali datoteko config.php, vendar boste imeli v njej eno vrstico, ki vključuje datoteko z dejanskimi informacijami o nastavitvah (primer: <?php return include("/home/hostfolder/safedata/configreal.php"); ?>). Iz datoteke /application/config/config.php odstranite vse aktualne informacije o nastavitvah in jih prilepite v drugo datoteko (configreal.php), ki je vključena v datoteki /application/config/config.php. Ta datoteka se mora nahajati izven spletnega imenika. V tem primeru datoteka /application/config/config.php ne bo vsebovala gesla podatkovne zbirke itd., pač pa samo ime datoteke, ki vsebuje informacije o podatkovni zbirki. S tem se izognete spremembam vseh drugih datotek vključenih v datoteki /application/config/config.php, glede na to da so še vedno vključene in bodo vsebovale realne informacije o nastavitvah. Boste pa morali urediti datoteko configreal.php in spremeniti naslednje parametre

This avoids having to change all the other files that include /application/config/config.php, since config.php 're-directs them' towards the configuration file that is located in a non-web directory which includes all the real configuration information. However, you will need to edit configreal.php and change the follow parameters to use absolute directory paths to work properly:

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

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

da lahko uporabite absolutno pot do imenika, ki bo pravilno delovala. Primer:

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

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

Prav tako ne uporabljajte "admin" uporabnika za privzetega uporabnika. Pojdite v vašo MySQL podatkovno zbirko (ali drugo, če ste namestili LimeSurvey na drugi podatkovni zbirki) in zamenjajte privzeto uporabniško ime "admin" na karkoli drugega, ki vam ustreza (na primer "admin_xyz"). Tako bo veliko težje uganiti novo skrbniško uporabniško ime. Vedite da je to eden od dveh podatkov, ki ju vsiljivci potrebujejo za pridobitev dostopa. Drugi podatke je skrbniško geslo, zato ga izberite zelo pazljivo.


Content Security Policy (CSP)

DISCLAIMER - The CSP provided here is an example only and is not meant to used verbatim. It is meant as a starting point and you MUST adapt it to your needs and test it thoroughly.

<IfModule mod_headers.c>
        Header always set Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; base-uri 'none'; form-action 'self'; frame-ancestors 'self'; upgrade-insecure-requests" "expr=%{CONTENT_TYPE} =~ m#text\/(html|javascript)|application\/pdf|xml#i"
</IfModule>