Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
GitHub-Ldap is a wrapper on top of Net::LDAP to make it human friendly.
Add this line to your application's Gemfile:
gem 'github-ldap'
And then execute:
$ bundle
Or install it yourself as:
$ gem install github-ldap
GitHub-Ldap let you use an external ldap server to authenticate your users with.
There are a few configuration options required to use this adapter:
ssl
and tls
.sAMAccountName
.Using administrator credentials is optional but recommended. You can pass those credentials with these two options:
Initialize a new adapter using those required options:
ldap = GitHub::Ldap.new options
See GitHub::Ldap#initialize for additional options.
Searches are performed against an individual domain base, so the first step is to get a new GitHub::Ldap::Domain
object for the connection:
ldap = GitHub::Ldap.new options
domain = ldap.domain("dc=github,dc=com")
When we have the domain, we can check if a user can log in with a given password:
domain.valid_login? 'calavera', 'secret'
Or whether a user is member of the given groups:
entry = ldap.domain('uid=calavera,dc=github,dc=com').bind
domain.is_member? entry, %w(Enterprise)
Some LDAP servers have support for virtual attributes, or overlays. These allow to perform queries more efficiently on the server.
To enable virtual attributes you can set the option virtual_attributes
initializing the ldap connection.
We use our default set of virtual names if this option is just set to true
.
ldap = GitHub::Ldap.new {virtual_attributes: true}
You can also override our defaults by providing your server mappings into a Hash. The only mapping supported for now is to check virtual membership of individuals in groups.
ldap = GitHub::Ldap.new {virtual_attributes: {virtual_membership: 'memberOf'}}
GitHub-Ldap uses ladle for testing. Ladle is not required by default, so you'll need to add it to your gemfile separatedly and require it.
Once you have it installed you can start the testing ldap server in the setup phase for your tests:
require 'github/ldap/server'
def setup
GitHub::Ldap.start_server
end
def teardown
GitHub::Ldap.stop_server
end
GitHub-Ldap includes a set of configured users for testing, but you can provide your own users into a ldif file:
def setup
GitHub::Ldap.start_server \
user_fixtures: ldif_path
end
If you provide your own user fixtures, you'll probably need to change the default user domain, the administrator name and her password:
def setup
GitHub::Ldap.start_server \
user_fixtures: ldif_path,
user_domain: 'dc=evilcorp,dc=com'
admin_user: 'uid=eviladmin,dc=evilcorp,dc=com',
admin_password: 'correct horse battery staple'
end
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)This section is for gem maintainers to cut a new version of the gem. See jch/release-scripts for original source of release scripts.
master
named release-x.y.z
, where x.y.z
is the version to be releasedgithub-ldap.gemspec
to x.y.z following semverscript/changelog
and paste the draft into CHANGELOG.md
. Edit as neededscript/release
FAQs
Unknown package
We found that github-ldap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.