-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[VAULT-3252] Disallow alias creation if entity/accessor combination exists #12747
Conversation
we may want to use something other than 400 for the duplicate request. perhaps 409? 400 is @chelshaw thoughts? |
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.
Looks good. I left a couple small questions/suggestions.
Looks like I've broken some existing tests with these changes, taking a look at those now |
changelog/12747.txt
Outdated
@@ -0,0 +1,3 @@ | |||
```release-note:bug | |||
core/identity: Disallow entity alias creation when an alias for the specified entity and mount exists |
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.
Since it's no longer just about creation, maybe reword?
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.
Fixed by 3c47f12 |
vault/identity_store_entities.go
Outdated
@@ -799,6 +808,10 @@ func (i *IdentityStore) mergeEntity(ctx context.Context, txn *memdb.Txn, toEntit | |||
return nil, fmt.Errorf("failed to update alias during merge: %w", err) | |||
} | |||
|
|||
if _, ok := toEntityAccessors[alias.MountAccessor]; ok { | |||
i.logger.Warn("skipping from_entity alias which has an accessor on which to_entity has an alias", "from_entity", fromEntityID, "skipped_alias", alias.ID) |
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.
Is this log message's context clear? Should we maybe add something to indicate that this is about an entity merge?
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.
good point! updated it here b465411
…xists (#12747) * Disallow alias creation if entity/accessor combination exists * Add changelog * Address review comments * Add handling to aliasUpdate, some field renaming * Update tests to work under new entity-alias constraint * Add check to entity merge, other review fixes * Log duplicated accessors only once * Fix flaky test * Add note about new constraint to docs * Update entity merge warn log
…xists (#12747) * Disallow alias creation if entity/accessor combination exists * Add changelog * Address review comments * Add handling to aliasUpdate, some field renaming * Update tests to work under new entity-alias constraint * Add check to entity merge, other review fixes * Log duplicated accessors only once * Fix flaky test * Add note about new constraint to docs * Update entity merge warn log
…xists (#12747) * Disallow alias creation if entity/accessor combination exists * Add changelog * Address review comments * Add handling to aliasUpdate, some field renaming * Update tests to work under new entity-alias constraint * Add check to entity merge, other review fixes * Log duplicated accessors only once * Fix flaky test * Add note about new constraint to docs * Update entity merge warn log
…xists (#12747) (#12836) * Disallow alias creation if entity/accessor combination exists * Add changelog * Address review comments * Add handling to aliasUpdate, some field renaming * Update tests to work under new entity-alias constraint * Add check to entity merge, other review fixes * Log duplicated accessors only once * Fix flaky test * Add note about new constraint to docs * Update entity merge warn log
…xists (#12747) (#12837) * Disallow alias creation if entity/accessor combination exists * Add changelog * Address review comments * Add handling to aliasUpdate, some field renaming * Update tests to work under new entity-alias constraint * Add check to entity merge, other review fixes * Log duplicated accessors only once * Fix flaky test * Add note about new constraint to docs * Update entity merge warn log
* [VAULT-3252] Disallow alias creation if entity/accessor combination exists (#12747) * Disallow alias creation if entity/accessor combination exists * Add changelog * Address review comments * Add handling to aliasUpdate, some field renaming * Update tests to work under new entity-alias constraint * Add check to entity merge, other review fixes * Log duplicated accessors only once * Fix flaky test * Add note about new constraint to docs * Update entity merge warn log * Add doc update
Sorry to revive an old-ish thread, but is there a link to information for why this change was made? I previously had multiple aliases within a given accessor to the same entity, and now need to re-work how I'm representing things. I would just like to understand what was wrong about having multiple aliases. Thanks in advance! 🙇 |
hey @christophermaier ! Sure thing, so the issue was that the behavior could be exploited via a vulnerability, you can find the CVE noted here https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-43998, and some details around why we went with this solution to fix the cve in the 1.9 upgrade guide here https://www.vaultproject.io/docs/upgrading/upgrade-to-1.9.x#entity-alias-mapping. |
@pmmukh That makes sense; thanks for the links and for the very quick response! 👍 |
Screenshot of create api error

Screenshot of startup log using a file backend