|1Security Considerations| |^ This section does not pretend to be a complete guide to keeping the "bad guys" out. It does provide a short guide to making a site more-or-less liberal in the way the server supplies information about the site and itself. The reader is also strongly recommended to a number of hard copy and Web based resources on this topic. |^ The WASD package had its genesis in making the VMS operating system and associated resources, in a development environment, available via Web technology. For this reason configurations can be made fairly liberal, providing information of use in a technical environment, but that may be superfluous or less-than-desirable in other, possibly commercial environments. For instance, directory listings can contain VMS file system META information, error reports can be generated with similar references along with reporting source code module and line information. |^ The example configuration files contain a fairly restrictive set of directives. When relaxing these recommendations keep in mind that the more information available about the underlying structure of the site the more potential for subversion. Do not enable functionality that contributes nothing to the fundamental usefulness of the site, or that has the real potential to compromise any given site. This section refers to configuration directives discussed in more detail in later chapters. |^ It is established wisdom that the only secure computing system is one with no users and no access, that system security is inversely proportional to system usability, and that making something idiot-proof results in only idiots using it. So there are some trade-offs but |...| |note| |0don't think it can't happen to you!| A systematic investigation of installed WASD packages by well-known IT professional Jean-loup Gailly during September 2002 revealed a couple of significant implementation flaws which compounded by notable instances of sloppy management practices on two public sites resulted in site compromise (one was mine). |^+ |link%|/wasd_root/doc/misc/wasd_advisory_020925.txt|\ WASD_ROOT:[WASDOC.MISC]WASD_ADVISORY_020925.TXT| |^- |link%|https://www.cvedetails.com/cve/CVE-2002-1825| |^ This research has resulted in these server flaws being closed and package security considerations being extensively reviewed. As a result WASD v8.1 was much more resistent to such penetration than previous releases (and slightly less easy to use, but that's one of those trade-offs). My assessment would be that if Gailly did not find it then it wasn't there to find! |^ Of course any given site's security is a function of the underlying package's security profile, with the site's implementation of that, AND other considerations such as local authorization and script implementations. Pay particular and ongoing attention to site security and integrity. |!note| |2Server and Site Testing| |^ This is the merest of mentions for a topic that literally encompasses volumes! |^ Each site is very-much an individual combination of configurations and applications. Each site therefore has specific potential vulnerabilities that should be known about and addressed where possible. Especially if you have an Internet-facing site then |*this mean you!|| |^ Many tools exist at the time of writing that didn't fifteen years before when WASD was investigated as described above. Some are on-line, "free" site health checks and penetration testing. Others are tools that can (often) be used from your platform of choice, many of which are free and open-source (FOSS). We are spoiled for choice. |^ In WASD's earlier years tools such as |/Apache Bench||, |/WASD Bench||, along with batched |/cURL| and |/wget| requests were used to exercise and, in some limited fashion, |/fuzz| the server (providing invalid, unexpected, or random request data) in an effort to discover flaws in server code and execution. |^ Currently the WASD development bench uses the OWASP ZAP tool to provide a much more comprehensive exercise and test environment. |note| |0OWASP ZAP| "Zed Attack Proxy (ZAP) is a free, open-source penetration testing tool being maintained under the umbrella of the Open Web Application Security Project (OWASP). ZAP is designed specifically for testing web applications and is both flexible and extensible. |^-|...||^- ZAP provides functionality for a range of skill levels from developers, to testers new to security testing, to security testing specialists. ZAP has versions for each major OS and Docker, so you are not tied to a single OS. Additional functionality is freely available from a variety of add-ons in the ZAP Marketplace, accessible from within the ZAP client." |^+ |link%|https://www.zaproxy.org| |!note| |^ ZAP is cross-platform (Linux, macOS, Windows, other), GUI-based, Java-implemented, and may be used effectively, though certainly not to its full capabilities, after fifteen minutes with the introductory documentation. |*ZAP is a highly recommended tool for site vulnerability assessment.|| |^ ZAP is used to exercise the in-development WASD, in particular the following aspects (not in any particular order). |bullet| |item| |*Traffic Loading |-| | server behaviour under load; continuing to process correctly while not exhibiting bottlenecks in performance, or worse, failing with soft (internal assertion checking) or hard (e.g. ACCVIO) bugchecks. Latency in AST-based processing often reveals subtle dependencies, race conditions, or other timing-related issues. ZAP allows a configurable number of concurrent requests when both spidering and vulnerability scanning. |item| |*Graded Alerts |-| | reports and counts of known attack vectors or general recommendations after spidering or penetration scans. These are flagged as high, medium or low risk, provide descriptions with references, and a quick overview of mitigation strategies. Each instance encountered during the scan has the request-response data available for analysis allowing specific cases to be identified and mitigated. |item| |*Directory Traversal |-| | (also known as path traversal) aims to access files and directories that are stored outside the server root, web root or web application folders. By manipulating data that reference files with |/dot-dot-slash| (../) sequences and its variations, or by using absolute file paths, it may be possible to access arbitrary files and directories stored in the server or general file system. |item| |*Data Injection |-| | covers a variety of attacks where request parameters are used to execute (CLI) commands, SQL queries, interpreted script code (e.g. JavaScript, PHP), or platform-executable binary code. Injecting encoded or obscured data into an HTTP request via the query-string or header field values is a common vector. Lack of appropriate data validation underlies injection vulnerability. |item| |*Buffer Overflow |-| | the overwriting of memory fragments of the process, which should never be modified intentionally or unintentionally. HTTP requests with unusually large or otherwise unintended header field values, or web application input fields designed for small, fixed-length, or specific type data are obvious targets. Fuzzing requests can often induce this. |item| |*Request Fuzzing |-| | where malformed or spurious data is automatically generated and injected into the processing in an effort to induce unexpected behaviour or failure. In web environments this can include the HTTP protocol itself, the specific implementation of some capability of the server, and any scripting environment or web application hosted on a server. |item| |*Cross Site Scripting |-| | where a malicious web element such as JavaScript, HTML, or other browser-side code is injected into otherwise benign and trusted web content from a non-same-origin, third-party source. |!bullet| |^ It should be noted that these are provided "out-of-the-box", is a subset of that |/out-of-the-box| functionality of particular interest in WASD development, and utilise only a tiny percentage of ZAP total capabilities. |0ZAP and HTTP/2| |^ At the time of writing, OWASP ZAP does not support the HTTP/2 protocol. The solution for exercising WASD is to use the |/nghttpx| proxy utility. |simple#| |& |%https://nghttp2.org/documentation/nghttpx.1.html| |& |%https://nghttp2.org/documentation/nghttpx-howto.html| |!simple| |^ It can be configured to accept HTTP and HTTPS connections at the front end (ZAP) and convert HTTP/1.1 requests to HTTP/2 requests at the back end (WASD). This introduces a proxy like this: |draw| +-----------+ +------------+ +------------+ | | | | | | | OWASP ZAP |<--HTTP/1\.1-->| nghttpx |<---HTTP/2--->| WASD | | | | | | | +-----------+ +------------+ +------------+ |!draw| |^ The ZAP and |/nghttpx| can be run on the same or independent systems. |^ On a suitable platform (Linux, macOS, MS Windows |-| not ported to VMS) use this at the command-line. |code| nghttpx --frontend '0.0.0.0,|/port||;no-tls' \\ --backend '|/WASD-server||,443;;tls;proto=h2' --insecure \\ --workers=|/integer| --backend-http2-max-concurrent-streams=|/integer| |!code| |^ Where 0.0.0.0 is any address on the |/nghttpx| platform and |/port| the IP port on that platform ZAP will connect to. The |/WASD-server| is the host name or address of the WASD system with port the usual 443. The workers integer is the number of threads used on the platform, with the maximum number of HTTP/2 back end connections maintained to the WASD system. The number of concurrent requests is determined by ZAP concurrency. |^ For example: |code| nghttpx --frontend '0.0.0.0,1280;no-tls' \\ --backend 'klaatu.private,443;;tls;proto=h2' --insecure \\ --workers=5 --backend-http2-max-concurrent-streams=5 |!code| |2Recommended Package Security| |^ The following table provides recommended file protection settings for package top-level directories. Subdirectories share their parents' settings. The package tree is owned by the SYSTEM account. Directories with world READ access have no ACLs. Other directories, not accessible to the world, but sometimes having other degress of access to one or more accounts always have rights identifiers (see below) and associated ACLs to control directory access, and to propagate required access to files created beneath them. The server selectively enables SYSPRV to provide access to some of these areas (e.g. for log creation). |^ Some pre-v8.1 directories are not included in this table. These are not significant in versions from 8.1 onwards and may be deleted. They can continue to exist however and the security procedures described below ensure that they comply to the general post-8.1 security model. The file access permissions indicated below are for directory contents. The directory files themselves have settings appropriate for content access. |0Package Access| |table| |~_ |: Directory|: Access|^-World|: Access|^-Other|: Description |~ |~#* |. |=.[AXP-BIN]| |. none |. script:RE |. Alpha executable script files |~ |. |=.[AXP]| |. none |. none |. Alpha build and utility area |~ |. |=.[CGI-BIN]| |. none |. script:RE |. architecture-neutral script files |~ |. |=.[EXAMPLE]| |. read |. (world) |. package examples |~ |. |=.[EXERCISE]| |. read |. (world) |. package test files |~ |. |=.[HTTP$NOBODY]| |. none |. script:RWED |. scripting account default home area |~ |. |=.[HTTP$SERVER]| |. none |. server:RWED |. server account default home area |~ |. |=.[IA64-BIN]| |. none |. script:RE |. Itanium executable script files |~ |. |=.[IA64]| |. none |. none |. Itanium build and utility area |~ |. |=.[INSTALL]| |. read |. (world) |. installation, update and secuity procedures |~ |. |=.[LOCAL]| |. none |. none |. site configuration files |~ |. |=.[LOG]| |. none |. none |. site access logs |~ |. |=.[LOG_SERVER]| |. none |. server:RWED |. server process (SYS$OUTPUT) logs |~ |. |=.[RUNTIME]| |. read |. (world) |. graphics, help files, etc. |~ |. |=.[SCRATCH]| |. none |. script:RWED |. working file space for scripts |~ |. |=.[SCRIPT]| |. none |. none |. example architecture-neutral scripts |~ |. |=.[SRC]| |. none |. (world) |. package source files |~ |. |=.[STARTUP]| |. none |. server:RE |. package startup procedures |~ |. |=.[X86_64-BIN]| |. none |. script:RE |. x86-64 executable script files |~ |. |=.[X86_64]| |. none |. none |. x86-64 build and utility area |~ |. |=.[WASDOC]| |. read |. (world) |. package documentation |!table| |^ It is recommended site-specific directories have settings applied appropriate to their function in comparison to similar package directories. See below for tools to assist in this. |^ Three rights identifiers provide selective access control to the directory tree. Identifiers were used to allow maximum flexibility for a site in allowing required accounts access to either execute the server or execute scripts. Non-default account names only need to be granted one of these identifiers to be provided with that role's access. Installation, update and/or security utilities create and maintain these identifiers appropriately. |0Rights Identifiers| |table| |~_ |: Identifier|: Description |~ |~ |. WASD_HTTP_SERVER |. Indicates the default server account. |~ |. WASD_HTTP_NOBODY |. Indicates the default scripting account. |~ |. WASD_IGNORE_THIS |. Looked for by the SECHAN utility to avoid it changing security on site-specific files. |!table| |^ These rights identifiers are applied to directories and files to provide the required level of access. The following example shows the security setting of the top-level CGI-BIN.DIR and one of it content files. |code| $ DIRECTORY /SECURITY CGI-BIN.DIR Directory WASD_ROOT:[000000] CGI-BIN.DIR;1 [SYSTEM] (RWED,RWED,,) (IDENTIFIER=WASD_HTTP_SERVER,ACCESS=EXECUTE) (IDENTIFIER=WASD_HTTP_NOBODY,ACCESS=EXECUTE) (IDENTIFIER=*,ACCESS=NONE) (IDENTIFIER=WASD_HTTP_NOBODY,OPTIONS=DEFAULT,ACCESS=READ+EXECUTE) (IDENTIFIER=*,OPTIONS=DEFAULT,ACCESS=NONE) (DEFAULT_PROTECTION,SYSTEM:RWED,OWNER:RWED,GROUP:,WORLD:) Total of 1 file. $ DIRECTORY /SECURITY [CGI-BIN]CGI_SYMBOLS.COM Directory WASD_ROOT:[CGI-BIN] CGI_SYMBOLS.COM;1 [SYSTEM] (RWED,RWED,,) (IDENTIFIER=WASD_HTTP_NOBODY,ACCESS=READ+EXECUTE) (IDENTIFIER=*,ACCESS=NONE) Total of 1 file. |!code| |2Maintaining Package Security| |^ As noted above, WASD version 8.1 and later is much more conservative in what it makes generally available from the package tree, and a site administrator now has to take extraordinary measures to open up certain sections, making it a much more difficult and deliberate action. The package installation, update and security procedures and their associated utilities should always be used to ensure that the installed package continues to conform to the security baseline. |^ Package security may be "refreshed" or reapplied at any time, and this should be done periodically to ensure that an installed package has not inadvertantly been opened to access where it shouldn't have. Of course this is not a guarantee that any given site is secure. Site security is a function of many factors; package vulnerabilities, site configuration, deployed scripts, cracker determination and expertise, etc., etc. What refreshing the security baseline does is provide a known secure (and WASD-community scrutinized) starting point. It should be used as part of a well considered site security maintenance program. |0SECURE.COM|| |^ The following DCL procedure resets the package security baseline. |code| $ @WASD_ROOT:[INSTALL]SECURE.COM |!code| |^ It guides the administrator through a number of stages |bullet#| |item| introductory notes |item| server account |item| scripting account |item| package tree security settings |!bullet| |^ of which each one may be declined. After all of these steps it searches for and executes if found the DCL procedure WASD_ROOT:[INSTALL]SECURE.COM. The intent of this file is to allow a site to automatically update any site-specific security settings (and of course modify any set by the main procedure). |0SECHAN Utility| |^ The SECHAN utility (pronounced "session") is used by SECURE.COM and the associated procedures to make file system security settings. It is also available for direct use by the site administrator. |^ One of the more useful functions of SECHAN is applied using the /IGNORE qualifier. |bullet| |item| |*IGNORE |-| | adds an ACE containing the rights identifier WASD_IGNORE_THIS to the target file(s) which results in security settings not being applied in the future. When applying settings the SECHAN utility first checks whether a file has this ACE and if so ignores the file. This is an effective method for isolating site-specific settings from changes by this utility. |code| $ SECHAN /IGNORE WASD_ROOT:[CGI-BIN]MY_SCRIPT.COM $ SECHAN /IGNORE WASD_ROOT:[LOCAL]*.DAT $ SECHAN /IGNORE WEB:[DATA...]*.* $ SECHAN /IGNORE WEB:[000000]DATA.DIR |!code| |^ This ACE can be removed from a file (leaving other entries of any ACL intact) using the /NOIGNORE qualifier. This returns the file(s) subject again to the SECHAN utility. |code| $ SECHAN /NOIGNORE WASD_ROOT:[CGI-BIN]MY_SCRIPT.COM $ SECHAN /NOIGNORE WASD_ROOT:[LOCAL]*.DAT |!code| |item| |*ALL |-| | overrides the default behaviour of ignoring files that have been tagged using the /IGNORE qualifier. It causes the setting to be applied to ALL files. |!bullet| |^ Other functionality may prove useful when applied to local parts of the package or web structure. |bullet| |item| |*PACKAGE |-| | used alone this qualifier results in the entire WASD_ROOT:[000000...] tree being traversed and the default package security settings applied to all package files. Top-level directories that the utility does not recognise as belonging to the package are ignored. |code| $ SECHAN /PACKAGE $ SECHAN /PACKAGE /ALL |!code| |item| |*ASIF= |-| | set the supplied file specification as if it was the specified, top-level WASD directory. This allows a site-specific directory to have the same security settings applied as the specified WASD package directory. |code| $ SECHAN /ASIF=LOCAL WEB:[DATA...]*.* $ SECHAN /ASIF=LOCAL WEB:[000000]DATA.DIR $ SECHAN /ASIF=CGI-BIN WEB:[SCRIPTS]*.* $ SECHAN /ASIF=CGI-BIN WEB:[000000]SCRIPTS.DIR $ SECHAN /ASIF=DOC WEB:[HTML...]*.* $ SECHAN /ASIF=DOC WEB:[000000]HTML.DIR |!code| |item| |*NOSCRIPT |-| | modifies the default behaviour of the /PACKAGE qualifier. This changes the default rights identifiers applied to ACEs on files in the [CGI-BIN] and [AXP-BIN]/[IA64-BIN]/[X86_64-BIN] directories to disallow scripting until manually changed by site administration. |code| $ SECHAN /PACKAGE /NOSCRIPT |!code| |!bullet| |^ This section provides only a basic description. More detail may be found in the prologue to the source code. |2Independent Package and Local Resources| |^ Not only does it make it easier to manage site content but is also good security practice to keep server package and site content completely separate (|link|Site Organisation||). |^ This can also be applied to scripts, both source and build areas. Keep your business logic out of the package source tree and potentially prying eyes. The script executables themselves |/can| be placed into the package scripting directories but should be built independently from these and copied using locally maintained DCL procedures from build into scripting areas (the WASD_ROOT:[INSTALL]SECURE.COM procedures described above may be useful here). |2Configuration| |^ Various configuration and mapping directives can be used to make the site environment more or less liberal in the information it implicitly can provide. |3Directory Listings| |^ Published guidelines for securing a Web site generally advise against automatic directory listing generation. Where a home page is not available this may leak information on other directory contents, provide parent and child directory access, etc. Compounding this is the WASD facility to |/force| a listing by providing a directory URL with file wildcards (not to decry the usefulness in some environments). |bullet| |item| |*.[DirAccess] |-| | make "disabled" to completely remove the ability to generate directory listings under any circumstances. Setting to "selective" means a directory listing is |*only| available if the directory contains a file named .WWW_BROWSABLE. When made "enabled" a directory listing may be produced anytime it contains no home (welcome) page. |item| |*.[DirWildcard] |-| | make "disabled" so that requests cannot |*force| a directory listing by supplying a URL containing a wildcard file part (when enabled this is provided regardless of whether a home page exists or not). |item| |*.[DirMetaInfo] |-| | make "disabled" to prevent directory listing pages contain as HTML tags information about the directory, most significantly the VMS file specification for the URL path! |!bullet| |^ The mapping rule "SET DIR=|/keyword||" can be used to change this on a per-path basis (|link|SET Rule||). |^ |*Conservative recommendation: | Set "[DirAccess] selective" allowing listing for directories containing a file named ".WWW_BROWSABLE", disable [DirMetaInfo] and [DirWildcard]. |3Server Reports| |^ Reports are pages generated by the server, usually to indicate an error or other non-success condition, but sometimes to indicate success (e.g. after a successful file upload). Reports provide either basic or detailed information about the situation. Sometimes the detailed information includes VMS file system details, system status codes etc. To limit this information to a minimum indication adjust the following directives. |bullet| |item| |*.[ReportBasicOnly] |-| | make "enabled" to limit the quantity of information to the minimum required to advise of the situation. Such reports give only the HTTP status code and brief explanation of the code's meaning. Note that this can also be done on a per-path basis using mapping rules. |item| |*.[ReportMetaInfo] |-| | make "disabled" to exclude information on the server software, source code module and line number initiating the report. META information may also contain VMS file or system specific information. |item| |*.[ServerSignature] |-| | make "disabled" to prevent the inclusion of server software, host and port information as a footer to a report. |!bullet| |^ The mapping rule "SET REPORT=|/keyword||" can be used to change some of these on a per-path basis (|link|SET Rule||). |^ |*Conservative recommendation: | Provide minimal error information by enabling [ReportBasicOnly] and disabling [ReportMetaInfo]. Enable [ServerSignature] to provide a slightly more friendly report (server software can easily be obtained from the response header anyway). |3Scripting| |^ If a static site is all that's required this source of compromise can simply be avoided. |bullet| |item| |*.[Scripting] |-| | setting this to "disabled" prevents all scripting entirely. This includes DCL CGI and CGIplus, DECnet-based OSU and CGI, and SSI DCL (<--#dcl -->, <--#exec -->, etc.). |!bullet| |^ |*Conservative recommendation: | Only deploy scripts your site will actually be using. Remove all the files associated with any other scripts. Do not allow obsolete script environments to remain active. Be proactive. |^ Also see |link|Securing Scripting)||. |3Server Side Includes| |^ SSI documents are pages containing special markup directives interpreted by the server and replaced with dynamic content. This can include detail about the server, the file or files making up the document, and can even include DCL commands and procedure activation for supplying content into the page. All this by anyone who can author on the site. |bullet| |item| |*.[SSI] |-| | setting this to "disabled" prevents all Server Side Include processing completely. |item| |*.[SSIexec] |-| | setting this to "disabled" disallows pages from invoking DCL to supply content for the page. WASD provides a number of levels of this and the reader is refered elsewhere in this and other documents for further information of what can and cannot be done, and by whom, in these processes. |!bullet| |^ The mapping rule "SET SSI=|/keyword||" can be used to change some of this on a per-path basis (|link|SET Rule||). |^ |*Conservative recommendation: | Disable [SsiExec]. |9Securing Scripting| |2Scripting| |^ Scripting has been a notorious source of server compromise, particularly within Unix environments where script process shell command-line issues require special attention. The WASD CGI scripting interface does not pass any arguments on the command line, and is careful not to allow substitution when constructing the CGI environment. Nevertheless, script behaviours cannot be guaranteed and care should be exercised in their deployment (ask me!) |^ It is strongly recommended to execute scripts in an account distinct from that executing the server. This should also mean that the accounts are not members of the same group nor should it be a member of any other group. This minimises the risk of both unintentional and malicious interference with server operation through either Inter-Process Communication (IPC) or scripts manipulating files used by the server. The PERSONA facility can be used to further differentiate script activities. See "Scripting Overview" for further detail. |^ The default WASD installation creates two such accounts, with distinct UICs, usernames and home directory space. Nothing should be assumed or read into the scripting account username - it's just a username. |0Default Accounts| |table| |~_ |: Username|: Description |~ |~ |. HTTP$SERVER |. Server Account |~ |. HTTP$NOBODY |. Scripting Account |!table| |^ During startup the server checks for the existence of the default scripting account and automatically configures itself to use this for scripting. If it is not present it falls-back to using the server account. Other account names can be used if the startup procedures are modified accordingly. The default scripting username may be overridden using the /SCRIPT=AS= qualifier (also see the "Scripting Overview"). |9Securing Authorisation| |2Authorization| |^ Authorization issues imply controlling access to various resources and actions and therefore require careful planning and implementation if compromise is to be avoided. WASD has a quite capable and versatile authorization and authentication environment, with a significant number of considerations. |^ WASD authorization cannot be enabled without the administrator configuring at least three resources, and so therefore cannot easily be "accidentally" activated. One of these is the addition of a startup qualifier controlling where authentication information may be sourced. Another the server configuration file. The third, mapping paths against authorization configuration. |^ For sites that may be particularly sensitive about inadvertant access to some resources it is possible to use the authorization configuration file as a type of |/cross-check| on the mapping configuration file. The server /AUTHORIZATION=ALL startup qualifier forces all access to be authorized (even if some are marked "none"). This means that if something "escapes" via the mapping file it will very likely be "caught" by an absence in the authorization file. |2Miscellaneous Issues| |^ Although it is of limited usefulness because server identity may be deduced from behaviour and other indicators the exact server and version may be obscured by using the otherwise undocumented /SOFTWARE= qualifier to change the server identification string to (basically) whatever the administrator desires. This identification is included as part of all HTTP response headers. |^ Historically and by default server configuration and authorization sources are contained within the server package tree. There is no reason why they cannot be located anywhere the site prefers. Generally all that is required is a change to logical name definition and server startup. |0Package Tree|| |^ Version 8.1 and later is much more conservative in what it makes available of the package tree via the server. The package installation, update and security procedures and their associated utilities should always be used to ensure that the installed package continues to conform to the security baseline. See |link|Maintaining Package Security||. |^ Furthermore, with many sites there may be little need to access the full, or any of the WASD package tree. A combination of mapping and/or authorization rules can relatively simply block or control access to it. These examples can be easily tailored to suit a site's specific requirements. |^ This example shows blocking all access to the /wasd_root/ tree, except for documentation, source code, examples and exercise (performance results) areas. |code| # WASD_CONFIG_MAP pass /wasd_root/doc/* pass /wasd_root/src/* pass /wasd_root/example/* pass /wasd_root/exercise/* fail /wasd_root/* |!code| |^ The next example forbids all access to the package tree unless authorized (the authorization detail would vary according to the site). It also allows modify access for the Server Administration page and to the /wasd_root/local/ area. |code| # WASD_CONFIG_MAP pass /wasd_root/* # WASD_CONFIG_AUTH [WASD_WEB_ADMIN=id] /httpd/-/admin/* r+w /wasd_root/local/* r+w /wasd_root/* r |!code| |note| |0Be careful!| There are often multiple paths to a single resource. For instance, it is of little significance blocking access to say /wasd_root/doc/ if it's also possible to access it via /doc/. |!note| |^ The following example shows how this might occur. |code| # WASD_CONFIG_MAP fail /wasd_root/doc/* pass /* /wasd_root/* |!code| |^ Authorization rules can be used to effectively block access to any VMS file specification (it cannot be done during mapping because the translation from path to file system is not performed until mapping is complete). |code| # WASD_CONFIG_AUTH if (path-translated:WASD_ROOT:[DOC]*) * none |!code| |^ or to selectively allow access |code| # WASD_CONFIG_AUTH [[WASD_VMS_RW=id]] if (path-translated:WASD_ROOT:[DOC]*) * read |!code| |2Site Attacks| |^ This is not a treatise on Web security and the author is not a security specialist. This is some general advice based on observation. There is little one can do at the server itself to reduce a concerted attack against a site. Common objectives of such attacks include the following (not an exhaustive list). |0Platform Vulnerabilities|| |^ Where a general attack is launched directed against a specific platform (a combination of operating system and Web server software). Often these can be due to wide-spread infection of systems, meaning many attacks are being launched from a large number of systems (often without the system owners' knowlege or cooperation). |^ WASD, and OpenVMS in particular, are generally immune to such attacks because they are not Microsoft or Unix based. The impact of the attack becomes one of the nuisance-value traffic as the site is probed by the (sometimes very large number of) source systems. |0Site Vulnerabilities|| |^ Where a specific attack is made against a site in an attempt to exploit a known vulnerability associated with that platform or environment. |^ These are perhaps the most worrying, although the |/security-by-obscurity| element works in favour of WASD and OpenVMS in this case. Neither are as common as other platforms and therefore do not receive as much attention. |0Denial of Service|| |^ (DOS) Usually comprise flooding a site with requests in an effort to consume all available network or server resources making it unavailable for legitimate use. |^ These can be insidious, flooding network equipment as well as systems. Attempts at control are best undertaken at the periphery of the network (routers) although concerted attacks can succeed against the best prepared network. |0Password Cracking|| |^ Where a systematic attempt to break into one or more accounts is undertaken. These are often repeated, dictionary-based password-guessing attacks. |^ WASD's authentication functionality notes successive password validation failures and after a reasonable number disables all access via the username for a constantly extended period. Passwords stop being checked and so a dictionary-based attack cannot succeed. Password validation failures can be recorded via OPCOM. |0Authorization Holes|| |^ Knowing of or searching for resources that should be controlled by authorization but are not. |^ WASD's /AUTHORIZATION=ALL functionality may assist here (|link|Securing Authorisation||). |0Strategies|| |^ There are a few strategies for reducing the load on a server experiencing a generalized attack or probing. These can also be used to "discourage" the source from considering the site an easy target. Unfortunately most require request acceptance and at least some processing before taking action. The general idea is to identify either the source site or some characteristic of the request that indicates it could not possibly be legitimate. Most platform-specific attacks have such a signature. For instance attacks against Microsoft platforms often involve probes for backdoors into non-server executables. These can be identified by the path containing strings such as "/winnt/", "/system32/", "/cmd.exe" or variations on them. This style will be used in examples below. |bullet| |item| If the source IP address is known then the [Reject] (and/or [Accept]) configuration directives can be used to reject the request connection very early in the processing. The source agent receives a message about access being rejected. |code| [Reject] 131.185.250.* the.host.name |!code| |item| Mapping rules in combination with conditionals may be used to redirect the request. This redirection could be to another, non-existent site, in the hope that the source agent will use the supplied URL and thus divert some activity away from the local site. |code| if (remote-host:the.host.name) redirect * http://the.host.name/* endif redirect **/winnt/** http://does.not.exist/ |!code| |item| Mapping rule redirection can also be used to just "drop" the connection without any further interaction or processing. The source agent receives no response, just a broken connection. |code| if (remote-addr:131.185.250.*) pass * "000 just drop it!" endif pass **/system32/** "000 just drop it!" |!code| |item| The |/hiss| facility returns a stream of random alpha-numeric characters (a sort of |/white-noise||). No response header is provided. Such a response might cause the source agent at best some distress (perhaps disabling it) or at least disuade it from continuing with more probes (as the target is obviously not a Web server ;-) |code| if (remote-addr:131.185.250.*) map * /hiss/* script /hiss/* /hiss/* map **/cmd.exe** /hiss/*/cmd.exe* script /hiss/* /hiss/* |!code| |!bullet| |2Content Security Policy (CSP)| |^ Content Security Policy (CSP) is an added layer of security that helps to detect and mitigate certain types of attacks, including Cross Site Scripting (XSS) and data injection attacks. |^+ |%https://en.wikipedia.org/wiki/Content_Security_Policy| |^- |%https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP| |note><| |0This section is not an explanation of CSP| The content of the above links and others like them must be understood to apply CSP to a WASD site. |!note| |^ WASD provides CSP support using mapping rules. See |link|Set Rule||. WASD allows configuration of policy using the |=set response=csp=|/policy||| rule and reporting only of policy violations using |=set response=cspro=|/policy||||. WASD includes a (basic) violation reporting utility. See |link%|../features/##CSPreport[er]| in |link%|../features/##|WASD Features and Facilities||.