forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose more authentication info to ingest pipeline (elastic#51305)
The changes add more granularity for identiying the data ingestion user. The ingest pipeline can now be configure to record authentication realm and type. It can also record API key name and ID when one is in use. This improves traceability when data are being ingested from multiple agents and will become more relevant with the incoming support of required pipelines (elastic#46847) Resolves: elastic#49106
- Loading branch information
Showing
8 changed files
with
224 additions
and
17 deletions.
There are no files selected for viewing
17 changes: 12 additions & 5 deletions
17
docs/reference/ingest/processors/set-security-user.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -194,6 +194,9 @@ | |
}, | ||
"realm" : { | ||
"type" : "keyword" | ||
}, | ||
"realm_type" : { | ||
"type" : "keyword" | ||
} | ||
} | ||
}, | ||
|
33 changes: 33 additions & 0 deletions
33
...n/core/src/test/java/org/elasticsearch/xpack/core/security/authc/AuthenticationTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* | ||
* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* * or more contributor license agreements. Licensed under the Elastic License; | ||
* * you may not use this file except in compliance with the Elastic License. | ||
* | ||
*/ | ||
|
||
package org.elasticsearch.xpack.core.security.authc; | ||
|
||
import org.elasticsearch.test.ESTestCase; | ||
import org.elasticsearch.xpack.core.security.user.User; | ||
|
||
public class AuthenticationTests extends ESTestCase { | ||
|
||
public void testWillGetLookedUpByWhenItExists() { | ||
final Authentication.RealmRef authenticatedBy = new Authentication.RealmRef("auth_by", "auth_by_type", "node"); | ||
final Authentication.RealmRef lookedUpBy = new Authentication.RealmRef("lookup_by", "lookup_by_type", "node"); | ||
final Authentication authentication = new Authentication( | ||
new User("user"), authenticatedBy, lookedUpBy); | ||
|
||
assertEquals(lookedUpBy, authentication.getSourceRealm()); | ||
} | ||
|
||
public void testWillGetAuthenticateByWhenLookupIsNull() { | ||
final Authentication.RealmRef authenticatedBy = new Authentication.RealmRef("auth_by", "auth_by_type", "node"); | ||
final Authentication authentication = new Authentication( | ||
new User("user"), authenticatedBy, null); | ||
|
||
assertEquals(authenticatedBy, authentication.getSourceRealm()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.