Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
2e69f922
Commit
2e69f922
authored
5 years ago
by
nixonrodrigues
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1866 :- Documentation for PAM type authentication and better logging for PAM auth
parent
72910c4f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
3 deletions
+53
-3
Authentication.md
docs/src/documents/Security/Authentication.md
+24
-0
AtlasAbstractAuthenticationProvider.java
...las/web/security/AtlasAbstractAuthenticationProvider.java
+2
-1
AtlasPamAuthenticationProvider.java
...he/atlas/web/security/AtlasPamAuthenticationProvider.java
+18
-1
PamLoginModule.java
...in/java/org/apache/atlas/web/security/PamLoginModule.java
+9
-1
No files found.
docs/src/documents/Security/Authentication.md
View file @
2e69f922
...
...
@@ -20,6 +20,7 @@ Atlas supports following authentication methods
*
**Kerberos**
*
**LDAP**
*
**Keycloak (OpenID Connect / OAUTH2)**
*
**PAM**
Following properties should be set true to enable the authentication of that type in
`atlas-application.properties`
file.
...
...
@@ -153,3 +154,26 @@ Setup you keycloak.json per instructions from Keycloak. Make sure to include `"p
"autodetect-bearer-only": true
}`
}
</SyntaxHighlighter>
### PAM.
The prerequisite for enabling PAM authentication, is to have login service file in
*/etc/pam.d/*
To enable the PAM authentication mode in Atlas.
*
Set the atlas property
`atlas.authentication.method.pam`
to true in
`atlas-application.properties`
.
<SyntaxHighlighter
wrapLines=
{true}
language=
"shell"
style=
{theme.dark}
>
{
`atlas.authentication.method.pam=true`
}
</SyntaxHighlighter>
*
Set the property
`atlas.authentication.method.pam.service=<login service>`
to use desired PAM login service.
For example, set below property to use
`/etc/pam.d/login`
.
<SyntaxHighlighter
wrapLines=
{true}
language=
"shell"
style=
{theme.dark}
>
{
`atlas.authentication.method.pam.service=login`
}
</SyntaxHighlighter>
This diff is collapsed.
Click to expand it.
webapp/src/main/java/org/apache/atlas/web/security/AtlasAbstractAuthenticationProvider.java
View file @
2e69f922
...
...
@@ -37,6 +37,7 @@ import java.util.ArrayList;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.Arrays
;
import
org.apache.atlas.utils.AuthenticationUtil
;
...
...
@@ -106,7 +107,7 @@ public abstract class AtlasAbstractAuthenticationProvider implements Authenticat
String
[]
groups
=
ugi
.
getGroupNames
();
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"UserGroupInformation userGroups="
+
groups
);
LOG
.
debug
(
"UserGroupInformation userGroups="
+
Arrays
.
toString
(
groups
)
);
}
if
(
groups
!=
null
)
{
...
...
This diff is collapsed.
Click to expand it.
webapp/src/main/java/org/apache/atlas/web/security/AtlasPamAuthenticationProvider.java
View file @
2e69f922
...
...
@@ -110,7 +110,7 @@ public class AtlasPamAuthenticationProvider extends AtlasAbstractAuthenticationP
LOG
.
debug
(
"Pam Authentication Failed:"
,
e
);
}
if
(
isDebugEnabled
)
{
LOG
.
debug
(
"<== AtlasPamAuthenticationProvider getPamAuthentication
"
);
LOG
.
debug
(
"<== AtlasPamAuthenticationProvider getPamAuthentication
: "
+
jaasAuthenticationProvider
);
}
return
authentication
;
}
...
...
@@ -127,6 +127,13 @@ public class AtlasPamAuthenticationProvider extends AtlasAbstractAuthenticationP
if
(!
options
.
containsKey
(
"service"
))
{
options
.
put
(
"service"
,
"atlas-login"
);
}
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"AtlasPAMAuthenticationProvider{groupsFromUGI= "
+
groupsFromUGI
+
'\''
+
", options="
+
options
+
'}'
);
}
}
catch
(
Exception
e
)
{
LOG
.
error
(
"Exception while setLdapProperties"
,
e
);
}
...
...
@@ -148,6 +155,16 @@ public class AtlasPamAuthenticationProvider extends AtlasAbstractAuthenticationP
UserAuthorityGranter
[]
authorityGranters
=
new
UserAuthorityGranter
[]{
authorityGranter
};
jaasAuthenticationProvider
.
setAuthorityGranters
(
authorityGranters
);
jaasAuthenticationProvider
.
afterPropertiesSet
();
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"AtlasPAMAuthenticationProvider{"
+
"jaasAuthenticationProvider='"
+
jaasAuthenticationProvider
+
'\''
+
", loginModuleName='"
+
loginModuleName
+
'\''
+
", controlFlag='"
+
controlFlag
+
'\''
+
", options='"
+
options
+
'}'
);
}
}
catch
(
Exception
e
)
{
LOG
.
error
(
"Failed to init PAM Authentication"
,
e
);
}
...
...
This diff is collapsed.
Click to expand it.
webapp/src/main/java/org/apache/atlas/web/security/PamLoginModule.java
View file @
2e69f922
...
...
@@ -22,7 +22,8 @@ package org.apache.atlas.web.security;
import
org.jvnet.libpam.PAM
;
import
org.jvnet.libpam.PAMException
;
import
org.jvnet.libpam.UnixUser
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.Logger
;
import
javax.security.auth.Subject
;
import
javax.security.auth.callback.*
;
import
javax.security.auth.login.FailedLoginException
;
...
...
@@ -35,6 +36,8 @@ import java.util.Map;
import
java.util.Set
;
public
class
PamLoginModule
extends
Object
implements
LoginModule
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
PamLoginModule
.
class
);
public
static
final
String
SERVICE_KEY
=
"service"
;
private
PAM
pam
;
...
...
@@ -110,6 +113,9 @@ public class PamLoginModule extends Object implements LoginModule {
initUserName
(
nameCallback
);
initPassword
(
passwordCallback
);
if
(
LOG
.
isDebugEnabled
())
LOG
.
debug
(
"Searching for user "
+
nameCallback
.
getName
());
}
catch
(
IOException
|
UnsupportedCallbackException
ex
)
{
...
...
@@ -150,6 +156,8 @@ public class PamLoginModule extends Object implements LoginModule {
principal
=
new
PamPrincipal
(
user
);
authSucceeded
=
true
;
if
(
LOG
.
isDebugEnabled
())
LOG
.
debug
(
"user "
+
username
);
return
true
;
}
catch
(
PAMException
ex
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment