Skip to content

Conversation

@pmalu9211
Copy link

  1. Added detailed loggin to file cloudtracker/cli.py.
  2. Configured cdx_logger to get the logs for all the files.

LINK TO CARD

Copy link
Collaborator

@ganeshjagdale9545 ganeshjagdale9545 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one minor change needed

cloudtrail_log_paths[log_level]["bucket"] = logging_account["bucketName"]
except (s3.exceptions.NoSuchKey, s3.exceptions.NoSuchBucket, botocore.exceptions.ClientError) as e:
continue
if cloudtrail_log_paths[log_level].get("boto3_session"):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this if else condition. if its fail to create session it will throw an error

@mpurusottamc mpurusottamc requested a review from Copilot May 13, 2025 20:07
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces detailed logging throughout CloudTracker by adding a new logger parameter (cdx_logger) in multiple modules, replacing direct logging calls with consistent cdx_logger invocations.

  • Added detailed logging to the ElasticSearch, Athena, and CLI modules.
  • Updated function signatures in init.py to pass and use the new cdx_logger for consistent logging across the codebase.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
cloudtracker/datasources/es.py Updated init signature and logger usage.
cloudtracker/datasources/athena.py Replaced logging calls with cdx_logger and expanded logging in query flows.
cloudtracker/cli.py Modified main() to receive cdx_logger and updated logging calls.
cloudtracker/init.py Updated helper functions to accept cdx_logger and adjust logging calls.
Comments suppressed due to low confidence (1)

cloudtracker/cli.py:142

  • [nitpick] Concatenating principal ARNs into a string using string addition may become hard to maintain as the logic grows; consider using a list to collect ARNs and then joining them with a suitable separator for improved clarity and potential reuse.
principals_arn = ""

@ganeshjagdale9545
Copy link
Collaborator

@pmalu9211 can you please resolve this comments?

Copy link
Collaborator

@ganeshjagdale9545 ganeshjagdale9545 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me
@pmalu9211 can you please make changes in cloud-iam-entitlements project?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants