SlideShare uma empresa Scribd logo
1 de 19
Slide 1
Talking LDAP and Radius from Erlang
Torbjörn Törnkvist
tobbe@nortelnetworks.com
Slide 2
What is LDAP ?
• LDAP provides directory access, a centralized
database of information about people, groups
and other entities.
• Defined as a set of protocol operations against
servers.
• Assumes one (or more) servers which jointly
provide access to the DIT (Directory
Information Tree)
• Protocol described in ASN.1
Slide 3
The Directory Information Tree (DIT)
• The DIT is made up of entries.
• Entries have names consisting of
one (or more) attribute values.
• The concatenation of the entry
names form a path, the
Distinguished Name (DN), which
uniquely identifies an entry.
Slide 4
(Main) Protocol Operations
• Add/Delete/Modify entries.
• Search the DIT (retreiving info)
• Authenticate the client (the bind-operation)
Slide 5
Example: from the Erlang shell
1> {_,S} = eldap:open(["192.168.128.47"], []).
{ok,<0.30.0>}
2> eldap:simple_bind(S,"cn=Torbjorn Tornkvist,cn=Users,dc=bluetail,dc=com","qwe123").
ok
3> Base = {base, "dc=bluetail,dc=com"}.
{base,"dc=bluetail,dc=com"}
4> Scope = {scope, eldap:wholeSubtree()}.
{scope,wholeSubtree}
5> Filter = {filter, eldap:equalityMatch("sAMAccountName", "tobbe")}.
{filter,{equalityMatch,{'AttributeValueAssertion',"sAMAccountName","tobbe"}}}
6> Search = [Base, Scope, Filter].
[{base,"dc=bluetail,dc=com"},
{scope,wholeSubtree},
{filter,{equalityMatch,{'AttributeValueAssertion',"sAMAccountName","tobbe"}}}]
7> eldap:search(S, Search).
{ok,{eldap_search_result,[{eldap_entry,
"CN=Torbjorn Tornkvist,CN=Users,DC=bluetail,DC=com",
[{"memberOf",
["CN=TestGroup2,CN=Users,DC=bluetail,DC=com",
"CN=TestGroup,CN=Users,DC=bluetail,DC=com",
"CN=Pre-Windows 2000 Compatible Access,CN=Builtin,DC=bluetail,DC=com",
"CN=Server Operators,CN=Builtin,DC=bluetail,DC=com"]},
{"cn",["Torbjorn Tornkvist"]},
{"company",["Alteon Web Systems"]},
{"mail",["tobbe@bluetail.com"]},
{"givenName",["Torbjorn"]},
{"instanceType",["4"]},
{"lastLogoff",["0"]},
{"lastLogon",["127119109376267104"]},
{"logonCount",[...]},
{"msNPAllowDialin"|...},
{...}|...]}],
[["ldap://bluetail.com/CN=Configuration,DC=bluetail,DC=com"]]}}
Slide 6
Some eldap notes...
• Build a gen_server/supervisor harness around the eldap library when
incorporating it into your system.
• By using the option: {ssl, true} you will use the ssl application to setup an
SSL tunnel (LDAPS). (Make sure to also set the port to 636)
• The eldap/test directory contains test code, and examples on how to setup
an OpenLDAP server.
• Eldap has been tested with OpenLDAP, Iplanet and ActiveDirectory LDAP-
servers.
Slide 7
RADIUS
(Remote Authentication Dial-In User Service)
• A protocol to carry authentication, authorization, and configuration
information between a Network Access Server, which desires to authenticate
its links, and a shared Authentication server.
• Transactions client/server are authenticated through the use of a shared
secret, which also is used to encrypt any user password sent over the
network.
• Information is sent as Attribute-Length-Value 3-tuples, where new attributes
(e.g vendor specific) easily can be added without disturbing existing
implementations of the protocol.
Slide 8
A real example: the Nortel SSL-VPN
1. The user contact the Web-site and
is presented with a login page.
2. A Radius Access-Request is sent
from the SSL-VPN to the Radius
server.
3. The Radius server returns an
Access-Accept with authorization
info.
4. The user accesses the Intranet via
the SSL-VPN portal.
Slide 9
Attribute dictionaries (FreeRadius).
ATTRIBUTE User-Name 1 string
ATTRIBUTE User-Password 2 string encrypt=1
ATTRIBUTE CHAP-Password 3 octets
ATTRIBUTE NAS-IP-Address 4 ipaddr
ATTRIBUTE NAS-Port 5 integer
ATTRIBUTE Service-Type 6 integer
ATTRIBUTE Framed-Protocol 7 integer
ATTRIBUTE Framed-IP-Address 8 ipaddr
1 7 o b b e
t
.....
Type Length Value
Slide 10
Vendor specific attribute dictionaries.
VENDOR Alteon 1872
ATTRIBUTE Alteon-Service-Type 26 integer Alteon
ATTRIBUTE Alteon-Xnet-Group 1 string Alteon
ATTRIBUTE Alteon-ASA-Audit-Trail 2 string Alteon
ATTRIBUTE Alteon-ASA-Audit-Source 3 string Alteon
VALUE Alteon-Service-Type Alteon-L4admin 250
VALUE Alteon-Service-Type Alteon-Slbadmin 251
Slide 11
Dictionaries and eradius
• 41 dictionaries taken from FreeRadius 0.9.1 are stored in
eradius/priv/dictionaries/
• These dictionaries are parsed and transformed into the corresponding files
containing Erlang records, as well as Erlang include files.
• Code that uses eradius can choose which dictionaries to load.
Slide 12
Example: an Erlang program
go(IP, User, Passwd, Shared, NasIP) ->
TraceFun = fun(_E,Str,Args) ->
io:format(Str,Args),
io:nl()
end,
E = #eradius{servers = [[IP, 1812, Shared]],
user = User,
passwd = Passwd,
tracefun = TraceFun,
nas_ip_address = NasIP},
eradius:start(),
eradius:load_tables(["dictionary",
"dictionary_alteon",
"dictionary_ascend"]),
print_result(eradius:auth(E)).
print_result({accept, Attributes}) ->
io:format("Got 'Accept' with attributes: ~p~n",[Attributes]),
pa(Attributes);
print_result({reject, Attributes}) ->
io:format("Got 'Reject' with attributes: ~p~n",[Attributes]),
pa(Attributes);
print_result(Res) ->
io:format("Got: ~p~n",[Res]).
pa([{K, V} | As]) ->
case eradius_dict:lookup(K) of
[A] ->
io:format(" ~s = ~p~n",[A#attribute.name,
to_list(V, A#attribute.type)]);
_ ->
io:format(" <not found in dictionary>: ~p~n",
......
1.
2.
Slide 13
Example: ...the output...
2> et:go({192,168,128,1}, "support", Passwd, Passwd, {192,168,128,32}).
sending RADIUS request for support to {{192,168,128,1},1812}
got RADIUS reply Accept for support with attributes: [{{529,194},
<<0,0,0,72>>},
{{1872,1},
<<115,116,97,102,102>>}]
Got 'Accept' with attributes: [{{529,194},<<0,0,0,72>>},
{{1872,1},<<115,116,97,102,102>>}]
Ascend_Maximum_Time = 72
Alteon_Xnet_Group = "staff"
true
1.
2.
Slide 14
Radius Accounting
• Extends the use of Radius to cover delivery of accounting
information.
• Client sends Accounting-Request containing attributes.
• Server replies with Accounting-Response.
Slide 15
Types of Accounting-Requests.
• Accounting On/Off.
• Start/Stop accounting info for a user.
• Interim-Update accounting info for a user.
Slide 16
Example of use: the Nortel SSL-VPN
• Sends info about how long time a user was logged on and what
the termination cause was.
• Used for audit trail logging, i.e logging of operator issued CLI
commands.
Slide 17
Example: an Erlang program
-include(“dictionary_alteon.hrl”).
acc() ->
eradius:start(),
eradius_acc:start(),
eradius:load_tables(["dictionary",
"dictionary_alteon"]),
User = "tobbe",
SessionId = 42,
R = acc_start(User, SessionId),
Login = R#rad_accreq.login_time,
sleep(10),
VendAttrs = [{?Alteon, [{?Alteon_ASA_Audit_Trail,
"This is a test!"}]}],
acc_update(User, SessionId, VendAttrs),
sleep(10),
acc_stop(User, SessionId, Login,
?REASON_LOGOUT).
acc_start(User, SessId) ->
Srvs = radacct_servers(),
NasIP = nas_ip_address(),
A = eradius_acc:new(),
R = set_session_id(
set_user(
set_servers(
set_nas_ip_address(
set_login_time(A),
NasIP),
Srvs),
User),
SessId),
eradius_acc:acc_start(R),
R.
2.
1.
2.
3.
Slide 18
Example: the Radius accounting log
Mon Nov 10 14:14:47 2003
Acct-Status-Type = Start
Acct-Session-Id = "42"
User-Name = "tobbe"
NAS-IP-Address = 192.168.128.32
Client-IP-Address = trana.bluetail.com
Acct-Unique-Session-Id = "000b40c13fd3ef1a"
Timestamp = 1068470087
Mon Nov 10 14:14:57 2003
Acct-Status-Type = Alive
Acct-Session-Id = "42"
User-Name = "tobbe"
NAS-IP-Address = 192.168.128.32
Alteon-ASA-Audit-Trail = "This is a test!"
Client-IP-Address = trana.bluetail.com
Acct-Unique-Session-Id = "000b40c13fd3ef1a"
Timestamp = 1068470097
Mon Nov 10 14:15:07 2003
Acct-Status-Type = Stop
Acct-Session-Time = 20
Acct-Session-Id = "42"
Acct-Terminate-Cause = User-Request
User-Name = "tobbe"
NAS-IP-Address = 192.168.128.32
Client-IP-Address = trana.bluetail.com
Acct-Unique-Session-Id = "000b40c13fd3ef1a"
Timestamp = 1068470107
1.
2.
3.
Slide 19
Available via the sourceforge jungerl cvs:
http://sourceforge.net/projects/jungerl/
Recommended References:
LDAP: RFC-2251, “LDAP System Administration” (O'Reilly), ,
Articles in Linux Journal July-Sep 2003, www.openldap.org
Radius: RFC-2865,2866, “Radius” (O'Reilly), www.freeradius.org

Mais conteúdo relacionado

Semelhante a 1200tobbe.ppt

IRJET-Block-Level Message Encryption for Secure Large File to Avoid De-Duplic...
IRJET-Block-Level Message Encryption for Secure Large File to Avoid De-Duplic...IRJET-Block-Level Message Encryption for Secure Large File to Avoid De-Duplic...
IRJET-Block-Level Message Encryption for Secure Large File to Avoid De-Duplic...IRJET Journal
 
BIND DNS IPWorks Introduction To Advanced
BIND DNS IPWorks Introduction To AdvancedBIND DNS IPWorks Introduction To Advanced
BIND DNS IPWorks Introduction To AdvancedMustafa Golam
 
JoTechies - Azure SQL DB
JoTechies - Azure SQL DBJoTechies - Azure SQL DB
JoTechies - Azure SQL DBJoTechies
 
8021x feature config_guide
8021x feature config_guide8021x feature config_guide
8021x feature config_guideWilson Ospina
 
TechEvent EUS, Kerberos, SSL and OUD
TechEvent EUS, Kerberos, SSL and OUDTechEvent EUS, Kerberos, SSL and OUD
TechEvent EUS, Kerberos, SSL and OUDTrivadis
 
MongoDB.local Dallas 2019: MongoDB Atlas for Your Enterprise
MongoDB.local Dallas 2019: MongoDB Atlas for Your EnterpriseMongoDB.local Dallas 2019: MongoDB Atlas for Your Enterprise
MongoDB.local Dallas 2019: MongoDB Atlas for Your EnterpriseMongoDB
 
Centralizing users’ authentication at Active Directory level 
Centralizing users’ authentication at Active Directory level Centralizing users’ authentication at Active Directory level 
Centralizing users’ authentication at Active Directory level Hossein Sarshar
 
Computer network (4)
Computer network (4)Computer network (4)
Computer network (4)NYversity
 
Demystifying SharePoint Infrastructure – for NON-IT People
 Demystifying SharePoint Infrastructure – for NON-IT People  Demystifying SharePoint Infrastructure – for NON-IT People
Demystifying SharePoint Infrastructure – for NON-IT People SPC Adriatics
 
Using Graph Databases in Real-Time to Solve Resource Authorization at Telenor...
Using Graph Databases in Real-Time to Solve Resource Authorization at Telenor...Using Graph Databases in Real-Time to Solve Resource Authorization at Telenor...
Using Graph Databases in Real-Time to Solve Resource Authorization at Telenor...Sebastian Verheughe
 
Windows 2008 R2 Security
Windows 2008 R2 SecurityWindows 2008 R2 Security
Windows 2008 R2 SecurityAmit Gatenyo
 
Interoperability Fundamentals: SWORD 2
Interoperability Fundamentals: SWORD 2Interoperability Fundamentals: SWORD 2
Interoperability Fundamentals: SWORD 2Adrian Stevenson
 
Treasure Data and AWS - Developers.io 2015
Treasure Data and AWS - Developers.io 2015Treasure Data and AWS - Developers.io 2015
Treasure Data and AWS - Developers.io 2015N Masahiro
 

Semelhante a 1200tobbe.ppt (20)

IRJET-Block-Level Message Encryption for Secure Large File to Avoid De-Duplic...
IRJET-Block-Level Message Encryption for Secure Large File to Avoid De-Duplic...IRJET-Block-Level Message Encryption for Secure Large File to Avoid De-Duplic...
IRJET-Block-Level Message Encryption for Secure Large File to Avoid De-Duplic...
 
AAA server
AAA serverAAA server
AAA server
 
BIND DNS IPWorks Introduction To Advanced
BIND DNS IPWorks Introduction To AdvancedBIND DNS IPWorks Introduction To Advanced
BIND DNS IPWorks Introduction To Advanced
 
JoTechies - Azure SQL DB
JoTechies - Azure SQL DBJoTechies - Azure SQL DB
JoTechies - Azure SQL DB
 
8021x feature config_guide
8021x feature config_guide8021x feature config_guide
8021x feature config_guide
 
TechEvent EUS, Kerberos, SSL and OUD
TechEvent EUS, Kerberos, SSL and OUDTechEvent EUS, Kerberos, SSL and OUD
TechEvent EUS, Kerberos, SSL and OUD
 
MongoDB.local Dallas 2019: MongoDB Atlas for Your Enterprise
MongoDB.local Dallas 2019: MongoDB Atlas for Your EnterpriseMongoDB.local Dallas 2019: MongoDB Atlas for Your Enterprise
MongoDB.local Dallas 2019: MongoDB Atlas for Your Enterprise
 
Centralizing users’ authentication at Active Directory level 
Centralizing users’ authentication at Active Directory level Centralizing users’ authentication at Active Directory level 
Centralizing users’ authentication at Active Directory level 
 
Computer network (4)
Computer network (4)Computer network (4)
Computer network (4)
 
Demystifying SharePoint Infrastructure – for NON-IT People
 Demystifying SharePoint Infrastructure – for NON-IT People  Demystifying SharePoint Infrastructure – for NON-IT People
Demystifying SharePoint Infrastructure – for NON-IT People
 
Using Graph Databases in Real-Time to Solve Resource Authorization at Telenor...
Using Graph Databases in Real-Time to Solve Resource Authorization at Telenor...Using Graph Databases in Real-Time to Solve Resource Authorization at Telenor...
Using Graph Databases in Real-Time to Solve Resource Authorization at Telenor...
 
Windows 2008 R2 Security
Windows 2008 R2 SecurityWindows 2008 R2 Security
Windows 2008 R2 Security
 
Introduction
IntroductionIntroduction
Introduction
 
Less05 Network
Less05 NetworkLess05 Network
Less05 Network
 
Ad ds ws2008 r2
Ad ds ws2008 r2Ad ds ws2008 r2
Ad ds ws2008 r2
 
Hadoop security
Hadoop securityHadoop security
Hadoop security
 
Interoperability Fundamentals: SWORD 2
Interoperability Fundamentals: SWORD 2Interoperability Fundamentals: SWORD 2
Interoperability Fundamentals: SWORD 2
 
Sql Server - Apresentação
Sql Server - ApresentaçãoSql Server - Apresentação
Sql Server - Apresentação
 
Net prog
Net progNet prog
Net prog
 
Treasure Data and AWS - Developers.io 2015
Treasure Data and AWS - Developers.io 2015Treasure Data and AWS - Developers.io 2015
Treasure Data and AWS - Developers.io 2015
 

Último

FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...CzechDreamin
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessUXDXConf
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaCzechDreamin
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCzechDreamin
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfFIDO Alliance
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoTAnalytics
 
THE BEST IPTV in GERMANY for 2024: IPTVreel
THE BEST IPTV in  GERMANY for 2024: IPTVreelTHE BEST IPTV in  GERMANY for 2024: IPTVreel
THE BEST IPTV in GERMANY for 2024: IPTVreelreely ones
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...CzechDreamin
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityScyllaDB
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsUXDXConf
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 

Último (20)

FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
THE BEST IPTV in GERMANY for 2024: IPTVreel
THE BEST IPTV in  GERMANY for 2024: IPTVreelTHE BEST IPTV in  GERMANY for 2024: IPTVreel
THE BEST IPTV in GERMANY for 2024: IPTVreel
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 

1200tobbe.ppt

  • 1. Slide 1 Talking LDAP and Radius from Erlang Torbjörn Törnkvist tobbe@nortelnetworks.com
  • 2. Slide 2 What is LDAP ? • LDAP provides directory access, a centralized database of information about people, groups and other entities. • Defined as a set of protocol operations against servers. • Assumes one (or more) servers which jointly provide access to the DIT (Directory Information Tree) • Protocol described in ASN.1
  • 3. Slide 3 The Directory Information Tree (DIT) • The DIT is made up of entries. • Entries have names consisting of one (or more) attribute values. • The concatenation of the entry names form a path, the Distinguished Name (DN), which uniquely identifies an entry.
  • 4. Slide 4 (Main) Protocol Operations • Add/Delete/Modify entries. • Search the DIT (retreiving info) • Authenticate the client (the bind-operation)
  • 5. Slide 5 Example: from the Erlang shell 1> {_,S} = eldap:open(["192.168.128.47"], []). {ok,<0.30.0>} 2> eldap:simple_bind(S,"cn=Torbjorn Tornkvist,cn=Users,dc=bluetail,dc=com","qwe123"). ok 3> Base = {base, "dc=bluetail,dc=com"}. {base,"dc=bluetail,dc=com"} 4> Scope = {scope, eldap:wholeSubtree()}. {scope,wholeSubtree} 5> Filter = {filter, eldap:equalityMatch("sAMAccountName", "tobbe")}. {filter,{equalityMatch,{'AttributeValueAssertion',"sAMAccountName","tobbe"}}} 6> Search = [Base, Scope, Filter]. [{base,"dc=bluetail,dc=com"}, {scope,wholeSubtree}, {filter,{equalityMatch,{'AttributeValueAssertion',"sAMAccountName","tobbe"}}}] 7> eldap:search(S, Search). {ok,{eldap_search_result,[{eldap_entry, "CN=Torbjorn Tornkvist,CN=Users,DC=bluetail,DC=com", [{"memberOf", ["CN=TestGroup2,CN=Users,DC=bluetail,DC=com", "CN=TestGroup,CN=Users,DC=bluetail,DC=com", "CN=Pre-Windows 2000 Compatible Access,CN=Builtin,DC=bluetail,DC=com", "CN=Server Operators,CN=Builtin,DC=bluetail,DC=com"]}, {"cn",["Torbjorn Tornkvist"]}, {"company",["Alteon Web Systems"]}, {"mail",["tobbe@bluetail.com"]}, {"givenName",["Torbjorn"]}, {"instanceType",["4"]}, {"lastLogoff",["0"]}, {"lastLogon",["127119109376267104"]}, {"logonCount",[...]}, {"msNPAllowDialin"|...}, {...}|...]}], [["ldap://bluetail.com/CN=Configuration,DC=bluetail,DC=com"]]}}
  • 6. Slide 6 Some eldap notes... • Build a gen_server/supervisor harness around the eldap library when incorporating it into your system. • By using the option: {ssl, true} you will use the ssl application to setup an SSL tunnel (LDAPS). (Make sure to also set the port to 636) • The eldap/test directory contains test code, and examples on how to setup an OpenLDAP server. • Eldap has been tested with OpenLDAP, Iplanet and ActiveDirectory LDAP- servers.
  • 7. Slide 7 RADIUS (Remote Authentication Dial-In User Service) • A protocol to carry authentication, authorization, and configuration information between a Network Access Server, which desires to authenticate its links, and a shared Authentication server. • Transactions client/server are authenticated through the use of a shared secret, which also is used to encrypt any user password sent over the network. • Information is sent as Attribute-Length-Value 3-tuples, where new attributes (e.g vendor specific) easily can be added without disturbing existing implementations of the protocol.
  • 8. Slide 8 A real example: the Nortel SSL-VPN 1. The user contact the Web-site and is presented with a login page. 2. A Radius Access-Request is sent from the SSL-VPN to the Radius server. 3. The Radius server returns an Access-Accept with authorization info. 4. The user accesses the Intranet via the SSL-VPN portal.
  • 9. Slide 9 Attribute dictionaries (FreeRadius). ATTRIBUTE User-Name 1 string ATTRIBUTE User-Password 2 string encrypt=1 ATTRIBUTE CHAP-Password 3 octets ATTRIBUTE NAS-IP-Address 4 ipaddr ATTRIBUTE NAS-Port 5 integer ATTRIBUTE Service-Type 6 integer ATTRIBUTE Framed-Protocol 7 integer ATTRIBUTE Framed-IP-Address 8 ipaddr 1 7 o b b e t ..... Type Length Value
  • 10. Slide 10 Vendor specific attribute dictionaries. VENDOR Alteon 1872 ATTRIBUTE Alteon-Service-Type 26 integer Alteon ATTRIBUTE Alteon-Xnet-Group 1 string Alteon ATTRIBUTE Alteon-ASA-Audit-Trail 2 string Alteon ATTRIBUTE Alteon-ASA-Audit-Source 3 string Alteon VALUE Alteon-Service-Type Alteon-L4admin 250 VALUE Alteon-Service-Type Alteon-Slbadmin 251
  • 11. Slide 11 Dictionaries and eradius • 41 dictionaries taken from FreeRadius 0.9.1 are stored in eradius/priv/dictionaries/ • These dictionaries are parsed and transformed into the corresponding files containing Erlang records, as well as Erlang include files. • Code that uses eradius can choose which dictionaries to load.
  • 12. Slide 12 Example: an Erlang program go(IP, User, Passwd, Shared, NasIP) -> TraceFun = fun(_E,Str,Args) -> io:format(Str,Args), io:nl() end, E = #eradius{servers = [[IP, 1812, Shared]], user = User, passwd = Passwd, tracefun = TraceFun, nas_ip_address = NasIP}, eradius:start(), eradius:load_tables(["dictionary", "dictionary_alteon", "dictionary_ascend"]), print_result(eradius:auth(E)). print_result({accept, Attributes}) -> io:format("Got 'Accept' with attributes: ~p~n",[Attributes]), pa(Attributes); print_result({reject, Attributes}) -> io:format("Got 'Reject' with attributes: ~p~n",[Attributes]), pa(Attributes); print_result(Res) -> io:format("Got: ~p~n",[Res]). pa([{K, V} | As]) -> case eradius_dict:lookup(K) of [A] -> io:format(" ~s = ~p~n",[A#attribute.name, to_list(V, A#attribute.type)]); _ -> io:format(" <not found in dictionary>: ~p~n", ...... 1. 2.
  • 13. Slide 13 Example: ...the output... 2> et:go({192,168,128,1}, "support", Passwd, Passwd, {192,168,128,32}). sending RADIUS request for support to {{192,168,128,1},1812} got RADIUS reply Accept for support with attributes: [{{529,194}, <<0,0,0,72>>}, {{1872,1}, <<115,116,97,102,102>>}] Got 'Accept' with attributes: [{{529,194},<<0,0,0,72>>}, {{1872,1},<<115,116,97,102,102>>}] Ascend_Maximum_Time = 72 Alteon_Xnet_Group = "staff" true 1. 2.
  • 14. Slide 14 Radius Accounting • Extends the use of Radius to cover delivery of accounting information. • Client sends Accounting-Request containing attributes. • Server replies with Accounting-Response.
  • 15. Slide 15 Types of Accounting-Requests. • Accounting On/Off. • Start/Stop accounting info for a user. • Interim-Update accounting info for a user.
  • 16. Slide 16 Example of use: the Nortel SSL-VPN • Sends info about how long time a user was logged on and what the termination cause was. • Used for audit trail logging, i.e logging of operator issued CLI commands.
  • 17. Slide 17 Example: an Erlang program -include(“dictionary_alteon.hrl”). acc() -> eradius:start(), eradius_acc:start(), eradius:load_tables(["dictionary", "dictionary_alteon"]), User = "tobbe", SessionId = 42, R = acc_start(User, SessionId), Login = R#rad_accreq.login_time, sleep(10), VendAttrs = [{?Alteon, [{?Alteon_ASA_Audit_Trail, "This is a test!"}]}], acc_update(User, SessionId, VendAttrs), sleep(10), acc_stop(User, SessionId, Login, ?REASON_LOGOUT). acc_start(User, SessId) -> Srvs = radacct_servers(), NasIP = nas_ip_address(), A = eradius_acc:new(), R = set_session_id( set_user( set_servers( set_nas_ip_address( set_login_time(A), NasIP), Srvs), User), SessId), eradius_acc:acc_start(R), R. 2. 1. 2. 3.
  • 18. Slide 18 Example: the Radius accounting log Mon Nov 10 14:14:47 2003 Acct-Status-Type = Start Acct-Session-Id = "42" User-Name = "tobbe" NAS-IP-Address = 192.168.128.32 Client-IP-Address = trana.bluetail.com Acct-Unique-Session-Id = "000b40c13fd3ef1a" Timestamp = 1068470087 Mon Nov 10 14:14:57 2003 Acct-Status-Type = Alive Acct-Session-Id = "42" User-Name = "tobbe" NAS-IP-Address = 192.168.128.32 Alteon-ASA-Audit-Trail = "This is a test!" Client-IP-Address = trana.bluetail.com Acct-Unique-Session-Id = "000b40c13fd3ef1a" Timestamp = 1068470097 Mon Nov 10 14:15:07 2003 Acct-Status-Type = Stop Acct-Session-Time = 20 Acct-Session-Id = "42" Acct-Terminate-Cause = User-Request User-Name = "tobbe" NAS-IP-Address = 192.168.128.32 Client-IP-Address = trana.bluetail.com Acct-Unique-Session-Id = "000b40c13fd3ef1a" Timestamp = 1068470107 1. 2. 3.
  • 19. Slide 19 Available via the sourceforge jungerl cvs: http://sourceforge.net/projects/jungerl/ Recommended References: LDAP: RFC-2251, “LDAP System Administration” (O'Reilly), , Articles in Linux Journal July-Sep 2003, www.openldap.org Radius: RFC-2865,2866, “Radius” (O'Reilly), www.freeradius.org