| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung |
| webserver [2016-04-13 13:30:26] – [Content Security Policy (CSP)] manfred | webserver [2022-02-20 14:54:34] (aktuell) – [beispielhafter Leistungsvergleich] manfred |
|---|
| | ====== Webserver ====== |
| | |
| | * [[::Apache]] - für vielen Verbindungen ungeeignet aber bei wenigen Verbindungen der schnellste |
| | * [[::Lighttpd]] - ist bei vielen Verbindungen der schnellste |
| | * [[::NGINX]] - verursacht bei vielen Verbindungen die geringste Last |
| | * [[https://deno.land/|Deno]] //ist der Nachfolger von [[https://nodejs.org/|NodeJS]]// |
| | |
| | * [[https://ssl-config.mozilla.org/|Konfigurationsgenerator für SSL-Unterstützung]] |
| | ==== beispielhafter Leistungsvergleich ==== |
| | |
| | Leistungswerte aus dem Test mit eine Referenz-VM (2x CPU-Kerne/6GB RAM => //alle Tests wurden auf dem selben Host durchgeführt//): |
| | * **Apache2**: |
| | - __Load: **~30**__ |
| | - __Transfers bei 300 gleichzeitigen Verbindungen: **~300 Aufrufe je Sekunde**__ |
| | * **Lighttpd**: |
| | - __Load: **~0,7**__ |
| | - __Transfers bei 300 gleichzeitigen Verbindungen: **~400 Aufrufe je Sekunde**__ |
| | * **NginX**: |
| | - __Load: **>0,5**__ |
| | - __Transfers bei 300 gleichzeitigen Verbindungen: **~250-400 Aufrufe je Sekunde** (stark schwankend)__ |
| | * //Der Home-Page nach zu urteilen, ist die kommerzielle Version [[http://nginx.com/products/content-caching-nginx-plus/|NGINX Plus]] für diese Aufgabe besser geeignet.// |
| | |
| | |
| | ===== Sicherheit ===== |
| | |
| | * [[https://raymii.org/s/tutorials/HTTP_Strict_Transport_Security_for_Apache_NGINX_and_Lighttpd.html]] |
| | * [[https://www.owasp.org/index.php/OWASP_Secure_Headers_Project#tab=Main]] |
| | * [[https://www.owasp.org/index.php/OWASP_Secure_Headers_Project#tab=Headers]] |
| | * [[https://www.perpetual-beta.org/weblog/security-headers.html]] |
| | |
| | |
| | ==== HTTP Strict Transport Security (HSTS) ==== |
| | |
| | * [[https://raymii.org/s/tutorials/HTTP_Strict_Transport_Security_for_Apache_NGINX_and_Lighttpd.html]] |
| | |
| | |
| | ==== Content Security Policy (CSP) ==== |
| | |
| | * [[http://www.html5rocks.com/en/tutorials/security/content-security-policy/]] |
| | |
| | **Standard-Direktive**: |
| | * **''script-src''** diese Direktive schränkt die erlaubten Quell-URLs ein |
| | * ''Content-Security-Policy: script-src 'self' https:/''''/apis.google.com'' - hier wird mit "'self'" der eigene Server und dann der "apis.google.com" erlaubt, sonst nichts |
| | * **''base-uri''** restricts the URLs that can appear in a page’s ''<base>'' element. |
| | * **''child-src''** lists the URLs for workers and embedded frame contents. For example: ''child-src https:/''''/youtube.com'' would enable embedding videos from YouTube but not from other origins. Use this in place of the deprecated ''frame-src'' directive. |
| | * **''connect-src''** limits the origins to which you can connect (via XHR, WebSockets, and EventSource). |
| | * **''font-src''** specifies the origins that can serve web fonts. Google’s Web Fonts could be enabled via ''font-src https:/''''/themes.googleusercontent.com'' |
| | * **''form-action''** lists valid endpoints for submission from ''<form>'' tags. |
| | * **''frame-ancestors''** specifies the sources that can embed the current page. This directive applies to ''<frame>'', ''<iframe>'', ''<embed>'', and ''<applet>'' tags. This directive cant be used in ''<meta>'' tags and applies only to non-HTML resources. |
| | * **''frame-src''** deprecated. Use ''child-src'' instead. |
| | * **''img-src''** defines the origins from which images can be loaded. |
| | * **''media-src''** restricts the origins allowed to deliver video and audio. |
| | * **''object-src''** allows control over Flash and other plugins. |
| | * **''plugin-types''** limits the kinds of plugins a page may invoke. |
| | * **''report-uri''** specifies a URL where a browser will send reports when a content security policy is violated. This directive cant be used in ''<meta>'' tags. |
| | * **''style-src''** is ''script-src''’s counterpart for stylesheets. |
| | * **''upgrade-insecure-requests''** Instructs user agents to rewrite URL schemes, changing HTTP to HTTPS. This directive is for web sites with large numbers of old URLs that need to be rewritten. |
| | |
| | **gefährliche Direktiven**: |
| | * **''base-uri''** |
| | * **''form-action''** |
| | * **''frame-ancestors''** |
| | * **''plugin-types''** |
| | * **''report-uri''** |
| | * **''sandbox''** |
| | |
| | Diese "gefährlichen" Direktiven haben keine ''default-src'' als fallback, das bedeutet, wenn man hier einen Fehler macht, dann ist das gleichbedeutend damit, dass man **alles** erlaubt! |
| | |
| | * [[https://www.w3.org/TR/upgrade-insecure-requests/]] |
| | * [[https://w3c.github.io/webappsec-upgrade-insecure-requests/#examples]] |
| | * [[http://www.cspplayground.com/usage]] |
| | * [[http://www.cspplayground.com/csp_validator]] |
| | * [[https://securityheaders.io/]] - testen |
| |