mirror of
https://github.com/shadow1ng/fscan.git
synced 2026-02-09 02:09:17 +08:00
feat: 增加LDAP测试环境
This commit is contained in:
18
TestDocker/LDAP/Dockerfile
Normal file
18
TestDocker/LDAP/Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
FROM osixia/openldap:1.5.0
|
||||
|
||||
# 环境变量设置
|
||||
ENV LDAP_ORGANISATION="Example Inc"
|
||||
ENV LDAP_DOMAIN="example.com"
|
||||
ENV LDAP_BASE_DN="dc=example,dc=com"
|
||||
# 设置一个弱密码
|
||||
ENV LDAP_ADMIN_PASSWORD="123456"
|
||||
# 允许匿名访问
|
||||
ENV LDAP_READONLY_USER="true"
|
||||
ENV LDAP_READONLY_USER_USERNAME="readonly"
|
||||
ENV LDAP_READONLY_USER_PASSWORD="readonly"
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 389 636
|
||||
|
||||
# 创建初始化脚本
|
||||
COPY bootstrap.ldif /container/service/slapd/assets/config/bootstrap/ldif/custom/
|
||||
2
TestDocker/LDAP/README.txt
Normal file
2
TestDocker/LDAP/README.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
docker build -t ldap-weak .
|
||||
docker run -d --name ldap-test -p 389:389 -p 636:636 ldap-weak
|
||||
24
TestDocker/LDAP/bootstrap.ldif
Normal file
24
TestDocker/LDAP/bootstrap.ldif
Normal file
@@ -0,0 +1,24 @@
|
||||
dn: ou=users,dc=example,dc=com
|
||||
objectClass: organizationalUnit
|
||||
ou: users
|
||||
|
||||
dn: cn=admin,ou=users,dc=example,dc=com
|
||||
objectClass: inetOrgPerson
|
||||
cn: admin
|
||||
sn: admin
|
||||
uid: admin
|
||||
userPassword: admin123
|
||||
|
||||
dn: cn=test,ou=users,dc=example,dc=com
|
||||
objectClass: inetOrgPerson
|
||||
cn: test
|
||||
sn: test
|
||||
uid: test
|
||||
userPassword: test123
|
||||
|
||||
dn: cn=root,ou=users,dc=example,dc=com
|
||||
objectClass: inetOrgPerson
|
||||
cn: root
|
||||
sn: root
|
||||
uid: root
|
||||
userPassword: root123
|
||||
Reference in New Issue
Block a user