Skip to content

Commit b1bdd6a

Browse files
authored
Merge pull request uc-cdis#1132 from uc-cdis/chore/sec
(PPS-635): chore(security): update urllib3 and related deps
2 parents 0b74555 + 037b21e commit b1bdd6a

34 files changed

+2771
-943
lines changed

docs/google_architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ We'll talk about each one of those in-depth here (and even delve into the intern
1717

1818
### Fence -> cirrus -> Google: A library wrapping Google's API
1919

20-
We have a library that wraps Google's public API called [cirrus](https://github.com/uc-cdis/cirrus). Our design is such that fence does not hit Google's API directly, but goes through cirrus. For all of cirrus's features to work, a very specific setup is required, which is detailed in cirrus's README.
20+
We have a library that wraps Google's public API called [cirrus](https://github.com/uc-cdis/cirrus). Our design is such that fence does not hit Google's API directly, but goes through gen3cirrus. For all of cirrus's features to work, a very specific setup is required, which is detailed in cirrus's README.
2121

2222
Essentially, cirrus requires a Google Cloud Identity account (for group management) and
2323
Google Cloud Platform project(s). In order to automate group management in Google Cloud Identity with cirrus, you must go through a manual process of allowing API access and delegating a specific service account from a Google Cloud Platform project to have group management authority. Details can be found in cirrus's README.

fence/blueprints/data/indexd.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
from sqlalchemy.sql.functions import user
88
from cached_property import cached_property
9-
import cirrus
10-
from cirrus import GoogleCloudManager
9+
import gen3cirrus
10+
from gen3cirrus import GoogleCloudManager
1111
from cdislogging import get_logger
1212
from cdispyutils.config import get_value
1313
from cdispyutils.hmac4 import generate_aws_presigned_url
@@ -162,7 +162,7 @@ def get_signed_url_for_file(
162162
_log_signed_url_data_info(
163163
indexed_file=indexed_file,
164164
user_sub=flask.g.audit_data.get("sub", ""),
165-
requested_protocol=requested_protocol
165+
requested_protocol=requested_protocol,
166166
)
167167

168168
return {"url": signed_url}
@@ -1197,7 +1197,7 @@ def _generate_anonymous_google_storage_signed_url(
11971197
):
11981198
# we will use the main fence SA service account to sign anonymous requests
11991199
private_key = get_google_app_creds()
1200-
final_url = cirrus.google_cloud.utils.get_signed_url(
1200+
final_url = gen3cirrus.google_cloud.utils.get_signed_url(
12011201
resource_path,
12021202
http_verb,
12031203
expires_in,
@@ -1338,7 +1338,7 @@ def _generate_google_storage_signed_url(
13381338
if config["BILLING_PROJECT_FOR_SIGNED_URLS"] and not r_pays_project:
13391339
r_pays_project = config["BILLING_PROJECT_FOR_SIGNED_URLS"]
13401340

1341-
final_url = cirrus.google_cloud.utils.get_signed_url(
1341+
final_url = gen3cirrus.google_cloud.utils.get_signed_url(
13421342
resource_path,
13431343
http_verb,
13441344
expires_in,

fence/blueprints/google.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
import flask
88
from flask_restful import Resource
99

10-
from cirrus import GoogleCloudManager
11-
from cirrus.errors import CirrusNotFound
12-
from cirrus.google_cloud.errors import GoogleAPIError
10+
from gen3cirrus import GoogleCloudManager
11+
from gen3cirrus.errors import CirrusNotFound
12+
from gen3cirrus.google_cloud.errors import GoogleAPIError
1313

1414
from fence.auth import current_token, require_auth_header
1515
from fence.restful import RestfulApi

fence/blueprints/link.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from cdislogging import get_logger
88

9-
from cirrus import GoogleCloudManager
9+
from gen3cirrus import GoogleCloudManager
1010
from fence.blueprints.login.redirect import validate_redirect
1111
from fence.restful import RestfulApi
1212
from fence.errors import NotFound

fence/blueprints/storage_creds/google.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
from flask_restful import Resource
77
from flask import current_app
88

9-
from cirrus import GoogleCloudManager
10-
from cirrus.config import config as cirrus_config
9+
from gen3cirrus import GoogleCloudManager
10+
from gen3cirrus.config import config as cirrus_config
1111

1212
from fence.config import config
1313
from fence.auth import require_auth_header

fence/config-default.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,10 @@ GS_BUCKETS: {}
691691
# bucket3:
692692
# region: 'us-east-1'
693693

694+
# When using the Cleversafe storageclient, whether or not to send verify=true
695+
# for requests
696+
VERIFY_CLEVERSAFE_CERT: true
697+
694698
# Names of the S3 buckets to which data files can be uploaded. They should be
695699
# configured in `S3_BUCKETS`.
696700
ALLOWED_DATA_UPLOAD_BUCKETS: []

fence/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from yaml import safe_load as yaml_load
33
import urllib.parse
44

5-
import cirrus
5+
import gen3cirrus
66
from gen3config import Config
77

88
from cdislogging import get_logger
@@ -92,7 +92,7 @@ def post_process(self):
9292
if self._configs.get("MOCK_STORAGE", False):
9393
self._configs["STORAGE_CREDENTIALS"] = {}
9494

95-
cirrus.config.config.update(**self._configs.get("CIRRUS_CFG", {}))
95+
gen3cirrus.config.config.update(**self._configs.get("CIRRUS_CFG", {}))
9696

9797
# if we have a default google project for billing requester pays, we should
9898
# NOT allow end-users to have permission to create Temporary Google Service

fence/resources/admin/admin_users.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from cdislogging import get_logger
2-
from cirrus import GoogleCloudManager
3-
from cirrus.google_cloud.utils import get_proxy_group_name_for_user
2+
from gen3cirrus import GoogleCloudManager
3+
from gen3cirrus.google_cloud.utils import get_proxy_group_name_for_user
44
from fence.config import config
55
from fence.errors import NotFound, UserError, UnavailableError
66
from fence.models import (
@@ -363,7 +363,7 @@ def delete_user(current_session, username):
363363
# and check if it exists in cirrus, in case Fence db just
364364
# didn't know about it.
365365
logger.debug(
366-
"Could not find Google proxy group for this user in Fence db. Checking cirrus..."
366+
"Could not find Google proxy group for this user in Fence db. Checking gen3cirrus..."
367367
)
368368
pgname = get_proxy_group_name_for_user(
369369
user.id, user.username, prefix=config["GOOGLE_GROUP_PREFIX"]
@@ -377,7 +377,7 @@ def delete_user(current_session, username):
377377

378378
if not gpg_email:
379379
logger.info(
380-
"Could not find Google proxy group for user in Fence db or in cirrus. "
380+
"Could not find Google proxy group for user in Fence db or in gen3cirrus. "
381381
"Assuming Google not in use as IdP. Proceeding with Fence deletes."
382382
)
383383
else:

fence/resources/google/access_utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
from urllib.parse import unquote
99
import traceback
1010

11-
from cirrus.google_cloud.iam import GooglePolicyMember
12-
from cirrus.google_cloud.errors import GoogleAPIError
13-
from cirrus.google_cloud.iam import GooglePolicy
14-
from cirrus import GoogleCloudManager
11+
from gen3cirrus.google_cloud.iam import GooglePolicyMember
12+
from gen3cirrus.google_cloud.errors import GoogleAPIError
13+
from gen3cirrus.google_cloud.iam import GooglePolicy
14+
from gen3cirrus import GoogleCloudManager
1515

1616
import fence
1717
from cdislogging import get_logger
@@ -218,7 +218,7 @@ def get_google_project_valid_users_and_service_accounts(
218218
Will make call to Google API if membership is None
219219
220220
Return:
221-
List[cirrus.google_cloud.iam.GooglePolicyMember]: Members on the
221+
List[gen3cirrus.google_cloud.iam.GooglePolicyMember]: Members on the
222222
google project
223223
224224
Raises:

fence/resources/google/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
from sqlalchemy import desc, func
1010

1111
from cdislogging import get_logger
12-
from cirrus import GoogleCloudManager
13-
from cirrus.google_cloud.iam import GooglePolicyMember
14-
from cirrus.google_cloud.utils import (
12+
from gen3cirrus import GoogleCloudManager
13+
from gen3cirrus.google_cloud.iam import GooglePolicyMember
14+
from gen3cirrus.google_cloud.utils import (
1515
get_valid_service_account_id_for_client,
1616
get_valid_service_account_id_for_user,
1717
)

0 commit comments

Comments
 (0)