Skip to content

Commit 61e3ae6

Browse files
authored
Merge pull request #67 from OWASP/Shruti-s-kulkarni-patch-3
Update 01-secure-environment.md
2 parents 4fdafa1 + 27d059a commit 61e3ae6

File tree

6 files changed

+59
-7
lines changed

6 files changed

+59
-7
lines changed

‎.wordlist.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,8 @@ OWTF
260260
WebGoat
261261
px
262262
ToC
263+
XML
264+
weightage
263265
Okta
264266
DNS
265267
WAF

‎draft/06-secure-design/02-secure-coding.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ order: 602
203203
Many technologies now come with data access layers that support input data validation.
204204
These layers are usually in the form of a library or a package. Ensure to add
205205
these libraries / dependencies / packages to the project file such that they are not missed out.
206-
* Use a security vetted library for input data validation. Try not to use hard coded whitelist of characters.
206+
* Use a security vetted library for input data validation. Try not to use hard coded allow-list of characters.
207207
Validate all data from a centralised function / routine.
208208
In order to add a variable to a HTML context safely, use HTML entity encoding
209209
for that variable as you add it to a web template.

‎draft/06-secure-design/05-content-security-policy.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ order: 605
1313

1414
### 6.5 Content Security policy
1515

16-
Content Security Policy (CSP) helps in whitelisting the sources that are allowed to be executed by clients.
16+
Content Security Policy (CSP) helps in allow-listing the sources that are allowed to be executed by clients.
1717

1818
To this effect CSP helps in addressing vulnerabilities that are the target of scripts getting executed
1919
from different domains (namely XSS, ClickJacking)
2020

2121
1. The policy elements listed below is restrictive.
22-
Third party libraries can be whitelisted as a part of `script-src`, `default-src`, `frame-src` or `frame-ancestors`.
22+
Third party libraries can be allow-listed as a part of `script-src`, `default-src`, `frame-src`
23+
or `frame-ancestors`.
2324

2425
2. I assume fonts / images / media / plugins are not loaded from any external sources.
2526

@@ -89,7 +90,7 @@ For display on other mobile devices that use HTML5: `meta http-equiv="Content-Se
8990

9091
#### iOS
9192

92-
iOS framework has capability to restrict connecting to sites that are not a part of the whitelist on the application,
93+
iOS framework has capability to restrict connecting to sites that are not a part of the allow-list on the application,
9394
which is the `NSExceptionDomains`. Use this setting to restrict the content that gets executed by the application
9495

9596
```text

‎draft/06-secure-design/07-file-management.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ order: 607
3939
* Implement safe uploading in UNIX by mounting the targeted file directory as a logical drive
4040
using the associated path or the chrooted environment
4141

42-
* When referencing existing files, use a white list of allowed file names and types.
42+
* When referencing existing files, use an allow list of allowed file names and types.
4343
Validate the value of the parameter being passed and if it does not match one of the expected values,
4444
either reject it or use a hard coded default file value for the content instead
4545

‎draft/09-secure-environment/01-secure-environment.md

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
title: Secure Environment Introduction
44
layout: col-document
55
tags: OWASP Developer Guide
6-
contributors:
6+
contributors:Shruti Kulkarni
77
document: OWASP Developer Guide
88
order: 901
99

@@ -23,4 +23,53 @@ and submit your content for review.
2323

2424
[contribute]: https://github.com/OWASP/www-project-developer-guide/blob/main/contributing.md
2525

26+
* The WEB-INF directory tree contains web application classes, pre-compiled JSP files, server side libraries,
27+
session information, and files such as `web.xml` and `webapp.properties`.
28+
So be sure the code base is identical to production.
29+
Ensuring that we have a “secure code environment” is also an important part of
30+
an application secure code inspection.
31+
32+
* Use a “deny all” rule to deny access and then grant access on need basis.
33+
34+
* In Apache HTTP server, ensure directories like WEB-INF and META-INF are protected.
35+
If permissions for a directory and subdirectories are specified in `.htaccess` file,
36+
ensure that it is protected using the “deny all” rule.
37+
38+
* While using Struts framework, ensure that JSP files are not accessible directly
39+
by denying access to `*.jsp` files in `web.xml`.
40+
41+
* Maintain a clean environment. remove files that contain source code but are not used by the application.
42+
43+
* Ensure production environment does not contain any source code / development tools
44+
and that the production environment contains only compiled code / executables.
45+
46+
* Remove test code / debug code (that might contain backdoors).
47+
Commented code can also be removed as at times, it might contain sensitive data. Remove file metadata e.g., .git
48+
49+
* Set “Deny All” in security constraints (for the roles being set up)
50+
while setting up the application on the web server.
51+
52+
* The listing of HTTP methods in security constraints works in a similar way to deny-listing.
53+
Any verb not explicitly listed is allowed for execution. Hence use “Deny All”
54+
and then allow the methods for the required roles.
55+
This setting carries weightage while using “Anonymous User” role.
56+
For example, in Java, remove all <http-method> elements from `web.xml` files.
57+
58+
* Configure web and application server to disallow HEAD requests entirely.
59+
60+
* Comments on code and Meta tags pertaining to the IDE used or technology used to develop the application
61+
should be removed. Some comments can divulge important information regarding bugs in code
62+
or pointers to functionality. This is particularly important with server side code such as JSP and ASP files.
63+
64+
* Search for any calls to the underlying operating system or file open calls and examine the error possibilities.
65+
66+
* Remove unused dependencies, unnecessary features, components, files, and documentation.
67+
68+
* Only obtain components from official sources over secure links.
69+
Prefer signed packages to reduce the chance of including a modified, malicious component
70+
71+
* Monitor for libraries and components that are unmaintained or do not create security patches for older versions.
72+
If patching is not possible, consider deploying a virtual patch to monitor, detect,
73+
or protect against the discovered issue.
74+
2675
\newpage

‎draft/09-secure-environment/02-system-hardening.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ order: 902
3030
Remove file metadata (e.g. `.git`)
3131
* Set “Deny All” in security constraints (for the roles being set up)
3232
while setting up the application on the web server.
33-
* The listing of HTTP methods in security constraints works in a similar way to blacklisting.
33+
* The listing of HTTP methods in security constraints works in a similar way to deny-listing.
3434
Any verb not explicitly listed is allowed for execution.
3535
Hence use “Deny All” and then allow the methods for the required roles.
3636
This setting is particularly important using “Anonymous User” role.

0 commit comments

Comments
 (0)