-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8805 from Accelerynt-Security/08-16-2023--AS-Sign…
…-Out-Google-User 08 16 2023 as sign out google user
- Loading branch information
Showing
44 changed files
with
786 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
Playbooks/AS-Sign-Out-Google-User/CreateGoogleJWT/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import logging | ||
import azure.functions as func | ||
import time | ||
from jwt import encode | ||
|
||
|
||
def create_google_jwt(iss: str, scope: str, aud: str, private_key_id: str, private_key: str) -> str: | ||
iat = time.time() | ||
exp = iat + 3600 | ||
payload = {'iss': iss, | ||
'scope': scope, | ||
'aud': aud, | ||
'iat': iat, | ||
'exp': exp} | ||
additional_headers = {'kid': private_key_id} | ||
signed_jwt = encode(payload, private_key, headers=additional_headers, algorithm='RS256') | ||
return signed_jwt | ||
|
||
|
||
def main(req: func.HttpRequest) -> func.HttpResponse: | ||
logging.info('Python HTTP trigger function processed a request.') | ||
|
||
try: | ||
req_body = req.get_json() | ||
except ValueError: | ||
return func.HttpResponse( | ||
"Please pass 'iss', 'scope', 'aud', 'private_key_id', and 'private_key' in the request body.", | ||
status_code=400 | ||
) | ||
|
||
iss = req_body.get('iss') | ||
scope = req_body.get('scope') | ||
aud = req_body.get('aud') | ||
private_key_id = req_body.get('private_key_id') | ||
private_key = req_body.get('private_key') | ||
|
||
if all([iss, scope, aud, private_key_id, private_key]): | ||
jwt = create_google_jwt(iss, scope, aud, private_key_id, private_key) | ||
return func.HttpResponse(jwt) | ||
else: | ||
return func.HttpResponse( | ||
"Please ensure all parameters ('iss', 'scope', 'aud', 'private_key_id', and 'private_key') are in the request body.", | ||
status_code=400 | ||
) |
Binary file added
BIN
+62.3 KB
...oks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Add_Contributor_Role_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+167 KB
...oks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Add_Contributor_Role_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+65.9 KB
...oks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Add_Contributor_Role_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+35.8 KB
...oks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Add_Contributor_Role_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+51.3 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Configure_VSCode_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+84.3 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Configure_VSCode_10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+183 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Configure_VSCode_11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+66.3 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Configure_VSCode_12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+57.8 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Configure_VSCode_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+33 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Configure_VSCode_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+115 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Configure_VSCode_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+72.3 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Configure_VSCode_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+38.8 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Configure_VSCode_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.4 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Configure_VSCode_7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+137 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Configure_VSCode_8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+175 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Configure_VSCode_9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+126 KB
...gn-Out-Google-User/Images/SignOutGoogleUser_Create_Google_Service_Account_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+131 KB
...gn-Out-Google-User/Images/SignOutGoogleUser_Create_Google_Service_Account_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+53.3 KB
...gn-Out-Google-User/Images/SignOutGoogleUser_Create_Google_Service_Account_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+50.4 KB
...gn-Out-Google-User/Images/SignOutGoogleUser_Create_Google_Service_Account_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+87.8 KB
...gn-Out-Google-User/Images/SignOutGoogleUser_Create_Google_Service_Account_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+39.6 KB
...gn-Out-Google-User/Images/SignOutGoogleUser_Create_Google_Service_Account_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+45.4 KB
...gn-Out-Google-User/Images/SignOutGoogleUser_Create_Google_Service_Account_7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+109 KB
...oks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Create_a_Private_Key_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+170 KB
...oks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Create_a_Private_Key_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+36.2 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Demo_1.png
Oops, something went wrong.
Binary file added
BIN
+117 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Deploy_1.png
Oops, something went wrong.
Binary file added
BIN
+203 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Deploy_2.png
Oops, something went wrong.
Binary file added
BIN
+42.8 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Deploy_3.png
Oops, something went wrong.
Binary file added
BIN
+108 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Deploy_4.png
Oops, something went wrong.
Binary file added
BIN
+39.5 KB
...ks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Deploy_Azure_Function_1.png
Oops, something went wrong.
Binary file added
BIN
+34.4 KB
...ks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Deploy_Azure_Function_2.png
Oops, something went wrong.
Binary file added
BIN
+76.7 KB
...ks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Deploy_Azure_Function_3.png
Oops, something went wrong.
Binary file added
BIN
+112 KB
...ks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Deploy_Azure_Function_4.png
Oops, something went wrong.
Binary file added
BIN
+94.4 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Key_Vault_Access_1.png
Oops, something went wrong.
Binary file added
BIN
+51.6 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Key_Vault_Access_2.png
Oops, something went wrong.
Binary file added
BIN
+35.6 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Key_Vault_Access_3.png
Oops, something went wrong.
Binary file added
BIN
+49.2 KB
Playbooks/AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Key_Vault_Access_4.png
Oops, something went wrong.
Binary file added
BIN
+87.2 KB
.../AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Key_Vault_Create_Secret_1.png
Oops, something went wrong.
Binary file added
BIN
+72.6 KB
.../AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Key_Vault_Create_Secret_2.png
Oops, something went wrong.
Binary file added
BIN
+92.6 KB
.../AS-Sign-Out-Google-User/Images/SignOutGoogleUser_Key_Vault_Create_Secret_3.png
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.