-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat: add YAML anchors and aliases support to ClusterConfig #8535
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: main
Are you sure you want to change the base?
Conversation
457c0e8
to
98d11c5
Compare
c6d24ff
to
21eb238
Compare
- Add resolveYAMLAnchors() function to process YAML anchors and aliases - Remove only 'aliases' field to maintain strict validation for other fields - Include security protections against YAML bombs and excessive nesting - Add comprehensive test coverage for functionality and edge cases - Update FAQ documentation with YAML anchor examples Fixes eksctl-io#8270
21eb238
to
5152cb6
Compare
@NicholasBlaskey I've made some changes to the PR, with simplified solution, more test cases and FAQ section added, please review. |
// Remove only the aliases field, maintaining strict validation for everything else | ||
delete(temp, "aliases") |
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.
Updated the implementation to support special "aliases" section only.
// Security: Limit input size to prevent memory exhaustion attacks | ||
const maxInputSize = 1024 * 1024 // 1MB limit | ||
if len(data) > maxInputSize { | ||
return nil, fmt.Errorf("YAML input too large: %d bytes exceeds limit of %d bytes", len(data), maxInputSize) | ||
} |
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.
YAML file over 1MB should be considered as abnormal, any concern?
Fixes #8270