Skip to content
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

chore: notice for https://github.com/aws/aws-cdk/issues/25674 #210

Merged
merged 4 commits into from
May 23, 2023

Conversation

iliapolo
Copy link
Contributor

@iliapolo iliapolo commented May 23, 2023

Since there are two separate problems, introduced in two separate commits, issue two notices based on the affeceted versions. Note that we have no way of knowing if customers are actually impacted by the default masters role because we don't know if they pass the mastersRole property or not.

"title": "(eks) eks overly permissive trust policies",
"issueNumber": 25674,
"overview": "The default MastersRole allows any identity in the account with the appropriate sts:AssumeRole permissions to assume it.",
"components": [
Copy link
Contributor Author

@iliapolo iliapolo May 23, 2023

Choose a reason for hiding this comment

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

These only suffer from the default masters role.

"title": "(eks) eks overly permissive trust policies",
"issueNumber": 25674,
"overview": "Cluster CreationRole and default MastersRole allows any identity in the account with the appropriate sts:AssumeRole permissions to assume it.",
"components": [
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These suffer from both the default masters role and the creation role

@iliapolo iliapolo requested a review from a team May 23, 2023 07:14
for (const component of notice.components) {
if (component.version === '1.*') { continue; } // Special range that we allow
if (semver.intersects(component.version, '2') && !semver.subset(component.version, '2')) {
Copy link
Contributor Author

@iliapolo iliapolo May 23, 2023

Choose a reason for hiding this comment

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

Using 2 as the range wouldn't allow pre releases, and we still have customers using those...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

> semver.satisfies('2.0.0-rc.2', '>=2.0.0-rc.1 <2.80.0')
true
> semver.satisfies('2.0.0-rc.2', '^2.0.0 <2.80.0')
false

Copy link
Contributor

@rix0rrr rix0rrr May 23, 2023

Choose a reason for hiding this comment

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

I think what we're trying to convey here is that:

  • A range may not cross a major version boundary (if we use >= we must also have a <)
  • A range must be bounded at the top (if we use ^ we must also have a <)

Maybe it would be simpler to do the following:

  • Do a linear scan of version ranges x ∈ [1..10], test x.0.0 and x.10000.0 and make sure not more than one x is within the range
  • Of that same x, test x.10000.0 and test that it is not matched.

Potentially a simpler set of tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Potentially, I honestly don't have the mental capacity right now to rework this...

test/schema.test.ts Outdated Show resolved Hide resolved
Co-authored-by: Rico Hermans <[email protected]>
@iliapolo iliapolo requested a review from rix0rrr May 23, 2023 09:05
@mergify mergify bot merged commit e1bcd21 into main May 23, 2023
@mergify mergify bot deleted the epolon/notice-for-25674 branch May 23, 2023 09:41
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.

2 participants