-
Notifications
You must be signed in to change notification settings - Fork 164
[LOG-7505] Add support for cross-account AssumeRole #3093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: apahim The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/hold
docs/reference/samples/clusterlogforwarder-cloudwatch-cross-account.yaml
Outdated
Show resolved
Hide resolved
…sion names Add support for cross-account CloudWatch log forwarding using AssumeRole. with automatically - Add AssumeRole field to CloudwatchIAMRole for cross-account access - Add ExternalID field for optional enhanced security - Use AssumeRole session names generated following the pattern: <cluster_ID>-<CLF_Name>-<output_name> - Use dual-profile AWS credentials approach for authentication separation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
/retest |
Looks good from review. I'm pulling down the changes today to get a closer look. |
docs/features/logforwarding/outputs/cloudwatch-sts-forwarding.adoc
Outdated
Show resolved
Hide resolved
docs/features/logforwarding/outputs/cloudwatch-sts-forwarding.adoc
Outdated
Show resolved
Hide resolved
docs/features/logforwarding/outputs/cloudwatch-sts-forwarding.adoc
Outdated
Show resolved
Hide resolved
docs/features/logforwarding/outputs/cloudwatch-sts-forwarding.adoc
Outdated
Show resolved
Hide resolved
/retest |
f8b29f3
to
72357ca
Compare
/retest |
This commit addresses all review comments from @jcantrill on the AssumeRole PR to improve code quality, documentation, and session name generation. Changes include: - Update AssumeRole API documentation to be more specific about cross-account use cases - Remove excessive documentation sections about session names and external ID - Update session name format to {clusterId}-{namespace}-{clfName}-{outputName} - Pass cluster ID from ForwarderContext instead of dynamic retrieval - Replace custom min function with Go's built-in min function - Refactor ParseRoleArn and ParseAssumeRoleArn to use shared parseAwsRoleArn function - Update all test cases to work with new function signatures The session name format now provides better uniqueness and traceability for AssumeRole sessions across different namespaces and ClusterLogForwarder instances, improving CloudTrail auditing capabilities. Manual testing verified that cross-account log forwarding continues to work correctly with the new session name format: 625f0e4d-openshift-logging-cp-logs-out-to-cw 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
72357ca
to
4563959
Compare
@apahim: all tests passed! Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Summary
This PR adds support for cross-account CloudWatch log forwarding using AWS AssumeRole with automatically generated session names that include cluster and forwarder context.
What's Changed
AssumeRole
field toCloudwatchIAMRole
for cross-account accessExternalID
field for additional security measures<cluster_ID>-<CLF_Name>-<output_name>
. Example:625f0e4d-cp-logs-out-to-cw
Key Features
Cross-Account AssumeRole
Vector Configuration with AssumeRole
Here's the exact Vector configuration that's generated when using AssumeRole. The key
parts are:
Key Points:
direct auth parameters
AWS credentials file
AWS IAM Configuration for Cross-Account Access
Initial Role (Cluster Account, e.g. 123456789012:role/app-logs)
The initial role in your cluster account needs:
Target Role (Cross-account, e.g. 987654321098:role/app-logs-cross)
The target role in the external account needs:
Backward Compatibility
✅ No breaking changes for existing users
output-{outputName}
session namesTechnical Details
Testing Verified
625f0e4d-cp-logs-out-to-cw
This resolves authentication issues in cross-account scenarios while maintaining full backward compatibility for existing CloudWatch outputs.