Skip to content

Commit b4bd252

Browse files
committed
ready for prod, removed some prints, left some in, errors redirected back to cg-platform
1 parent 978b6c1 commit b4bd252

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

ci/aws-iam-check-keys/find_stale_keys.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ def search_for_keys(region_name: str, profile: dict, all_users: list[Threshold],
230230
aws_access_key_id=profile["id"],
231231
aws_secret_access_key=profile["secret"],
232232
)
233-
print(f"about to check: {account}")
234233
iam = session.client("iam")
235234
# Generate credential report for the given profile
236235
# Generating the report is an async operation, so wait for it by sleeping
@@ -250,8 +249,6 @@ def search_for_keys(region_name: str, profile: dict, all_users: list[Threshold],
250249
row: dict
251250
for row in csv_reader:
252251
user_name = row["user"]
253-
if user_name == "ephraim.gross":
254-
print(f"found ephraim: {row}")
255252
# Note: If the user is unknown, we aren't capturing it, but could here
256253
# in an else below
257254
aws_user = find_known_user(user_name, all_users)
@@ -331,15 +328,13 @@ def send_key(key_dict: dict, severity: str):
331328
def check_key(key_num: int, last_rotated_key: str, user: Threshold, row: dict, account: str):
332329
days_since_rotation = calc_days_since_rotation(last_rotated_key)
333330
user_dict = {"user":row["user"], "key_num": key_num, "user_type": user.account_type, "account": account, "days_since_rotation": days_since_rotation, "last_rotated":last_rotated_key}
331+
print(f"user is either being sent or deleted: {user_dict}")
334332
if days_since_rotation >= user.violation and user.account_type:
335-
print(f"about to send user: {user_dict['user']}")
336333
send_key(user_dict, "violation")
337334
elif days_since_rotation >= user.warn:
338-
print(f"about to send user: {user_dict['user']}")
339335
send_key(user_dict, "warn")
340336
else:
341-
# print(f"about to send rotated for user: {user}")
342-
print(f"about to del user: {user_dict['user']}")
337+
print("it was actually deleted")
343338
del_key(user_dict)
344339

345340

ci/pipeline.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ jobs:
130130
IAM_KEYS_HOST: ((aws-iam-keys-host))
131131
IAM_KEYS_PORT: ((aws-iam-keys-port))
132132
IAM_CREATE_TABLES: ((aws-iam-create-tables-bool))
133-
GATEWAY_HOST: prometheus-staging.service.cf.internal
133+
GATEWAY_HOST: prometheus.service.cf.internal
134134
PREFIX_DELIMITER: ((aws-iam-prefix-delimiter))
135135
WARN_DAYS: ((aws-iam-warn-days))
136136
VIOLATION_DAYS: ((aws-iam-violation-days))
@@ -141,7 +141,7 @@ jobs:
141141
text: |
142142
:x: FAILED to deploy IAM Check Keys on production
143143
<$ATC_EXTERNAL_URL/teams/$BUILD_TEAM_NAME/pipelines/$BUILD_PIPELINE_NAME/jobs/$BUILD_JOB_NAME/builds/$BUILD_NAME|View build details>
144-
channel: "#cg-platform-news"
144+
channel: "#cg-platform"
145145
username: ((slack-username))
146146
icon_url: ((slack-icon-url))
147147

0 commit comments

Comments
 (0)