You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
-21Lines changed: 0 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -10,44 +10,27 @@ Second, before starting on a project that you intend to contribute to the unity-
10
10
### Document Style
11
11
#### Basics
12
12
- All contributions will be received as PRs - just read the recommendation below first please! 😁
13
-
<<<<<<< HEAD
14
-
- This is intended to be a technical reference for other collegeaues in the security community, so the language and style should reflect that.
15
-
- You'll notice that our language if fairly casual for this type of content, but keep the language civil/mild and avoid using too much lingo when writing, and when using an abbreviation, please provide he definition upon its first use. Also refer to our our official [Code of Conduct](./CODE-OF-CONDUCT.md).
16
-
=======
17
13
- This is intended to be a technical reference for other colleagues in the security community, so the language and style should reflect that.
18
14
- You'll notice that our language is fairly casual for this type of content, but keep the language civil/mild and avoid using too much lingo when writing, and when using an abbreviation, please provide he definition upon its first use. Also refer to our our official [Code of Conduct](./CODE-OF-CONDUCT.md).
19
-
>>>>>>> 2910d0b35380405a483e2fd4eb9636ac62a937e1
20
15
- Given the nature of this content, it's ultimately meant for developers writing the code, not just security folks looking at it - it's not productive to write an article that not everyone can understand. Keep things simple, but accurate.
21
16
22
17
#### Article Updates
23
18
##### Spelling and Grammar changes
24
19
Simply update the spelling of the article and do a PR. For simple changes like this, we won't be updating the Authorship or contributor section in the article itself, but your PR will be in the changelog.
25
20
26
21
##### New Content and Substantial Changes
27
-
<<<<<<< HEAD
28
-
If you want to contribute new security recommendations or research to an additional article, provide the PR ensuring that you're maintaning the original articles style and template as closely as reasonable.
29
-
=======
30
22
If you want to contribute new security recommendations or research to an additional article, provide the PR ensuring that you're maintaining the original articles style and template as closely as reasonable.
31
-
>>>>>>> 2910d0b35380405a483e2fd4eb9636ac62a937e1
32
23
33
24
If mutliple people contributed to the content, please include their names in the *Contributors* section at the end of the article.
34
25
35
26
#### New Articles and the Template
36
27
If creating a new article, we'd recommend taking a look at the [Contribution_Template](./Contribution_Template.md) that we have to help improve consistency in the article formatting.
37
-
<<<<<<< HEAD
38
-
We're open to article in differing format, but variance from the template will necessicate a review of the articles layout to ensure it's readable and logical.
39
-
=======
40
28
We're open to article in differing format, but variance from the template will necessitate a review of the articles layout to ensure it's readable and logical.
41
-
>>>>>>> 2910d0b35380405a483e2fd4eb9636ac62a937e1
42
29
43
30
For new articles, please ensure everyone who has substantially contributed to the article is appropriately credited as an author.
44
31
45
32
### Attribution and Credit
46
-
<<<<<<< HEAD
47
-
An importact aspect of this body of work is that contributors are recognized for their work. As such, authors and contributors will be recognized in the content of the Markdown file, not just by their names in the Git changelogs. Above this is discused a bit, but we'll repeat it here for clarity:
48
-
=======
49
33
An important aspect of this body of work is that contributors are recognized for their work. As such, authors and contributors will be recognized in the content of the Markdown file, not just by their names in the Git changelogs. Above this is discussed a bit, but we'll repeat it here for clarity:
50
-
>>>>>>> 2910d0b35380405a483e2fd4eb9636ac62a937e1
51
34
- Authors: Original Authors of an article will be given credit at the top of the article. This will include the month and year the content was originally written.
52
35
- Contributors: People who have provided new research or recommendations to an article will be added as a Contributor in the appropriate section at the bottom of the page, along with the month and year their contribution was made.
53
36
- Minor changes: Minor changes (spelling, grammar, etc.), will be accepted directly as PRs, with the contributors account logged in the changelog for that PR.
@@ -66,8 +49,4 @@ We'd love to see industry specific versions, or flavors, of this SSDLC being dev
66
49
---
67
50
68
51
69
-
<<<<<<< HEAD
70
-
## All contributions are governed by the [Apache 2.0 license](./LICENSE.md).
71
-
=======
72
52
## All contributions are governed by the [Apache 2.0 license](./LICENSE.md).
Copy file name to clipboardExpand all lines: Coding Practice/API-Best-Practices.md
-28Lines changed: 0 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -17,11 +17,7 @@ This document covers general security guidelines for API endpoints within Unity.
17
17
API endpoints should follow the principle of least privilege. Services with protected information should serve to the smallest group possible.
18
18
###### Why We Care
19
19
20
-
<<<<<<< HEAD
21
-
APIs with misconfigured access controls can lead to unintentional information leaks, or unauthorized and malicious state changing actions on sensitive data.
22
-
=======
23
20
APIs with misconfigured access controls can lead to unintentional information leaks, or unauthorized and malicious state-changing actions on sensitive data.
24
-
>>>>>>> 2910d0b35380405a483e2fd4eb9636ac62a937e1
25
21
###### Example of Issue (Optional)
26
22
27
23
A POST that allows the user to modify information on an account without checking if the user owns the account being modified.
@@ -52,11 +48,7 @@ Incorrect access controls can range from High to Low Severity.
52
48
Incoming data can be malformed or crafted to cause unintended behavior when it is parsed.
53
49
###### Why We Care
54
50
55
-
<<<<<<< HEAD
56
-
Depending on how input is parsed, it is possible unvalidated input can contain command injections, or other harmful actions.
57
-
=======
58
51
Depending on how input is parsed, it is possible for unvalidated input to contain command injections, or other harmful actions.
59
-
>>>>>>> 2910d0b35380405a483e2fd4eb9636ac62a937e1
60
52
###### Example of Issue (Optional)
61
53
*TBD*
62
54
@@ -73,13 +65,7 @@ Restrict http methods
73
65
Parsing - Third party parsers should be kept up to date, changes to internal parsers should be carefully reviewed.
74
66
###### Risk Rating
75
67
76
-
<<<<<<< HEAD
77
-
Input Validation issues could range from Low to High depending on what how the error can be leveraged.
78
-
###### References (Optional)
79
-
*TBD - List external references for more detailed guidance*
80
-
=======
81
68
Input Validation issues could range from Low to High depending on how the error can be leveraged.
82
-
>>>>>>> 2910d0b35380405a483e2fd4eb9636ac62a937e1
83
69
84
70
---
85
71
### Request Integrity
@@ -98,11 +84,7 @@ An attacker sends a previous, genuine request to cause an action to happen again
98
84
Modified requests in-transit: An attacker modifies data in the genuine request as it is sent.
99
85
###### How to Fix?
100
86
101
-
<<<<<<< HEAD
102
-
Generate signatures or HMACs for each request containing sensitive data or actions. Check the signature of the request to determine if it is genuine. Sign requests that include timestamps, and deny all requests that are relatively too old.
103
-
=======
104
87
Generate signatures or HMACs (Hashed Message Authentication Codes) for each request containing sensitive data or actions. Check the signature of the request to determine if it is genuine. Sign requests that include timestamps, and deny all requests that are relatively too old.
105
-
>>>>>>> 2910d0b35380405a483e2fd4eb9636ac62a937e1
106
88
###### Risk Rating
107
89
108
90
Depending on what actions the request can take, severity could range from High to Low.
@@ -126,19 +108,9 @@ Returning stack traces or other descriptive information of the service backend
126
108
127
109
Log and monitor API activity. Detecting anomalies can assist in finding malicious activity that isn’t apparent anywhere else.
128
110
129
-
<<<<<<< HEAD
130
-
Disable CORS if not needed, or scope it down as small as possible to prevent forged requests or data leakage.
131
-
=======
132
111
Disable CORS (Cross-Origin Resource Sharing) if not needed, or scope it down as small as possible to prevent forged requests or data leakage.
133
-
>>>>>>> 2910d0b35380405a483e2fd4eb9636ac62a937e1
134
112
135
113
Return vague error responses. Put as little information as possible when returning an error to the user. Do not return any information about the server environment or debug information like stack traces.
136
114
###### Risk Rating
137
115
138
116
Ranging from Low to High depending on context.
139
-
<<<<<<< HEAD
140
-
###### References (Optional)
141
-
142
-
*TBD - List external references for more detailed guidance*
Copy file name to clipboardExpand all lines: Coding Practice/AuthZ-AuthN-Guidelines.md
-52Lines changed: 0 additions & 52 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,5 @@
1
1
# Authorization and Authentication Guidelines [Coding Practice]
2
-
<<<<<<< HEAD
3
-
<fontsize="-1">_Author: Carlo Valentien - Dec. 2018_</font>
4
-
=======
5
2
<fontsize="-1">_Author: Carlo Valentin - Dec. 2018_</font>
6
-
>>>>>>> 2910d0b35380405a483e2fd4eb9636ac62a937e1
7
3
8
4
## Overview
9
5
@@ -19,26 +15,6 @@ This document provides guidelines for how to implement authentication and author
19
15
20
16
**Authorization** is the process of ensuring a user can only access resources they are supposed to, usually based on some role or Risk Rating that is defined according to business logic.
21
17
## Recommendations
22
-
<<<<<<< HEAD
23
-
### Use a Trusted Identity Provider
24
-
###### Description
25
-
26
-
Most of our users will be accessing services related to Unity, and we should Unity ID to authenticate those users to any new services or publicly facing applications. Using a single, unified identity to authenticate a user will make it easy for the user to use a new service and application.
27
-
28
-
When creating internal applications, validate users via their IT issued credentials.
29
-
###### Why We Care
30
-
31
-
Many services will require authentication as a requirement. No authentication allows for anonymous access, which prevents proper logging and brings the risk of trivial information disclosure. However, designing an entire authentication service for you an application is also no trivial task, with many caveats that can lead to leaked/bypassed credentials, and a number of other issues. By using a trusted identity provider, the security team can work on securing a small number of authentication platforms to the benefit of a number of teams at Uniyt.
32
-
###### How to Fix?
33
-
34
-
Determine if your application is an internal or external application. If it is external, contact Genesis and Security to integrate your application with Unity ID. If it is internal, contact IT to integrate with out internal authentication system.
35
-
###### Risk Rating
36
-
37
-
High
38
-
39
-
---
40
-
=======
41
-
>>>>>>> 2910d0b35380405a483e2fd4eb9636ac62a937e1
42
18
### Require Multi-Factor Authentication for Sensitive Applications
43
19
###### Description
44
20
@@ -57,23 +33,13 @@ Medium
57
33
### Limit OAuth2 Scope by the Principle of Least Privilege
58
34
###### Description
59
35
60
-
<<<<<<< HEAD
61
-
When an OAuth2 client, a scope is defined for the the client. This scope determines which Genesis Backend APIs are accessible to the client after performing authentication. When setting up a new OAuth2 client, the team requesting the client should identify what APIs/data they need access to, and limit the scope to those specific APIs.
62
-
###### Why We Care
63
-
64
-
Limiting the scope of our APIs is a best practice, that can limit the impact of a successful attack. Also, often it is a Unity ID user that is authenticating using the given scope, and with the given access token will give the user direct access to the APIs. Since this is publicly accessible, care should be taken that the user cannot access sensitive APIs, in particular APIs that handle personally identifiable information (PII).
65
-
###### How to Fix?
66
-
67
-
During the requirements phase, determine what information is needed for the OAuth2 client, and limit the APIs to only what is necessary. If possible, work with Genesis to build a custom scope that will limit access to wider APIs.
68
-
=======
69
36
When an OAuth2 client, a scope is defined for the the client. This scope determines which backend APIs are accessible to the client after performing authentication via the auth provider. When setting up a new OAuth2 client, the team requesting the client should identify what APIs/data they need access to, and limit the scope to those specific APIs.
70
37
###### Why We Care
71
38
72
39
Limiting the scope of our APIs is a best practice that can limit the impact of a successful attack. Also, often it is a Unity ID user that is authenticating using the given scope, and with the given access token will give the user direct access to the APIs. Since this is publicly accessible, care should be taken that the user cannot access sensitive APIs, in particular, APIs that handle personally identifiable information (PII).
73
40
###### How to Fix?
74
41
75
42
During the requirements phase, determine what information is needed for the OAuth2 client, and limit the APIs to only what is necessary. If possible, work with the auth provider to build a custom scope that will limit access to wider APIs.
76
-
>>>>>>> 2910d0b35380405a483e2fd4eb9636ac62a937e1
77
43
###### Risk Rating
78
44
79
45
Medium
@@ -85,17 +51,10 @@ Medium
85
51
### Limited Token Lifetimes
86
52
###### Description
87
53
88
-
<<<<<<< HEAD
89
-
When authenticating, a variety of tokens are used to prove the identity of a user. This is typically through a session cookie, or an access token attached to a user’s account. These tokens should have the shortest lifetime that balances the needs to of the users with security. Tokens should not be valid for an infinite amount of time, and should expire within a reasonable timeframe.
90
-
###### Why We Care
91
-
92
-
This is primarily a defense-in-depth measure, focusing on the case if these tokens are compromised, it will limit the impact of an attack. This also decreases the attack surface of a resulting application, reducing the number of valid tokens at any given time.
93
-
=======
94
54
When authenticating, a variety of tokens are used to prove the identity of a user. This is typically through a session cookie, or an access token attached to a user’s account. These tokens should have the shortest lifetime that balances the needs of the users with security. Tokens should not be valid for an infinite length of time, and should expire within a reasonable timeframe.
95
55
###### Why We Care
96
56
97
57
This is primarily a defense-in-depth measure, focusing on limiting the impact of an attack if these tokens are compromised. This also decreases the attack surface of a resulting application, reducing the number of valid tokens at any given time.
98
-
>>>>>>> 2910d0b35380405a483e2fd4eb9636ac62a937e1
99
58
###### How to Fix?
100
59
101
60
Check all tokens related to authentication, and review their lifetimes. If you are unsure, contact security for recommendations on their lifetimes. When possible, use the shortest lifetime within a reasonable use.
@@ -107,11 +66,7 @@ Medium
107
66
### Validating OAuth2 Redirect URIs
108
67
###### Description
109
68
110
-
<<<<<<< HEAD
111
-
When performing the OAuth2 login flow, a redirect URI is used to securely send the access token to the client web application, after it has authenticated with Genesis. This is provided by the client during the OAuth2 flow. This URI should be validated to ensure it is a known URI that is used by the OAuth2 client.
112
-
=======
113
69
When performing the OAuth2 login flow, a redirect URI is used to securely send the access token to the client web application, after it has authenticated with the auth provider. This is provided by the client during the OAuth2 flow. This URI should be validated to ensure it is a known URI that is used by the OAuth2 client.
114
-
>>>>>>> 2910d0b35380405a483e2fd4eb9636ac62a937e1
115
70
###### Why We Care
116
71
117
72
This prevents a potential information disclosure attack when there is an open redirect on a valid redirect URI. This results in a user’s OAuth token being potentially leaked, compromising their account.
@@ -144,17 +99,10 @@ High
144
99
### Validating the OAuth2 State Parameter
145
100
###### Description
146
101
147
-
<<<<<<< HEAD
148
-
When starting the initial OAuth2 flow, the client has the option of providing a state parameter. This state parameter is then send back with the authorization to be validated by the client later in the flow. This state parameter should be generated upon the initial OAuth2 request, and stored to validate once the authorization from Genesis has occurred.
149
-
###### Why We Care
150
-
151
-
This is to ensure that the OAuth2 flow is initiated by the user, and is not vulnerable to a potential CSRF. By ensuring that the user has initiated the OAuth2 flow, they will be performing actions within their account with known permissions.
152
-
=======
153
102
When starting the initial OAuth2 flow, the client has the option of providing a state parameter. This state parameter is then sent back with the authorization to be validated by the client later in the flow. This state parameter should be generated upon the initial OAuth2 request, and stored to validate once the authorization from the auth provider has occurred.
154
103
###### Why We Care
155
104
156
105
This is to ensure that the OAuth2 flow is initiated by the user, and is not vulnerable to a potential CSRF (Cross-Site Request Forgery). By ensuring that the user has initiated the OAuth2 flow, they will be performing actions within their account with known permissions.
157
-
>>>>>>> 2910d0b35380405a483e2fd4eb9636ac62a937e1
158
106
###### How to Fix?
159
107
160
108
Generate a cryptographically-secure random state parameter when the OAuth2 flow is initialized. The client should validate this when it is returned through the redirect URI callback. The parameter should only be valid for the same OAuth2 flow that initiated it.
0 commit comments