当前位置:网站首页>Realization of a springboard machine
Realization of a springboard machine
2022-06-28 10:14:00 【InfoQ】
One 、 Introduction to the idea of springboard machine
- Linux The server
- Windows The server
- Other terminals (MySQL terminal 、Redis terminal 、 Network equipment terminal wait )
Two 、 Background knowledge
2.1 Linux Of PAM Mechanism

2.2 PAM The core competencies of

2.3 PAM Module type
- auth
- account
- session
- password
2.4 common PAM modular
- pam_unix.so modular
- pam_cracklib.so modular
- pam_loginuid.so modular
- pam_securetty.so modular
- pam_rootok.so modular
- pam_console.so modular
- pam_permit.so modular
- pam_env.so modular
- pam_xauth.so modular
- pam_stack.so modular
- pam_warn.so modular
3、 ... and 、 Springboard system architecture
3.1 Microservices and high availability design
3.1.1 Microservice design
- monitor 8080 port , Provide http Interface capabilities
- Verify whether an account exists and is normal
- Verify whether an account has login permission to a server
- Verify whether an account has a connection to a server sudo jurisdiction
- Data pulling : account number 、 host 、 Dangerous command library, etc
- yes jmp The only access to the database
- monitor 2200 port , Provide ssh Agency ability
- Direct access to Linux The server 、 Other terminals
- monitor 8080 port , Provide websocket/socket.io Connection ability
- adopt ssh Protocol forwarding socket.io Flow to jmp-ssh
- Support the connection and access of Web terminal
- monitor 8080 port , Provide socket.io Connection ability
- Realization rdp agent , For ease of operation Windows The server
- Support web based Remote Desktop Services
- Provide file upload and download capabilities , Support in jmp Pass through sftp command , Support any sftp Client connection
- visit S3, To access files
- Deployed on every Linux Server
- jmp-agent Resident process
- jmp special pam modular
3.1.2 High availability design
3.2 Interaction diagram of each sub service of the springboard machine

Four 、 Core design ideas
4.1 Log on to the skip machine
- The user to use ssh The client logs in to jmp-ssh service , And jmp-ssh Service interaction .
- jmp-ssh Access to services ssh Account number during session establishment 、 Password after encryption 、 Secondary authentication information .
- jmp-ssh Service access jmp-api service , Submit account number 、 Password after encryption 、 Secondary authentication information , In order to know whether the user is logged in jmp Authority .

4.2 Log in to the target server
- Only if the user has logged in to jmp-ssh Or it has passed jmp-socket You can log in to the target server only after the front-end authentication of .
- The user is in jmp-ssh Pseudo terminal input provided ssh xxxx(xxxx Is the host name of the target server or IP Address ).
- jmp-ssh adopt ssh Connect to target server , Automatically carry user name information , Try to establish a session .
- Due to... On the target server jmp-agent Took over sshd Identification and authority authentication , therefore jmp.so obtain ssh User name during session establishment , The user name and the local computer IP Address information encryption , call jmp-api Interface for authority authentication .
- jmp-api According to the built-in policy , And query authorization table , Determine whether the user has login permission to the machine .
- jmp-agent Get the authentication result , For those who have authority , be ssh Session successfully established , Otherwise, the session establishment fails .
- jmp-ssh Get the result and reason of session establishment , Return to the user ssh terminal .

4.3 Command interaction
- Only if the user has logged in to a machine , To command interaction .
- When the user ssh Typing characters on the client , Pass on to jmp-ssh,jmp-ssh Determine whether the statement ends .
- When statement ends , be jmp-ssh According to the dangerous order rules of the machine , Match statements entered by the user , Decide to alarm 、 Intercept 、 adopt .
- jmp-ssh Pass the passed statement or the statement requiring alarm to the target server , The target server executes and returns the result .

4.4 Switching users / Privileged account
- Only if the user has logged in to a machine , It is possible to trigger the behavior of switching users .
- When the user ssh Client execution sudo xxxx、su、id And so on ,jmp-ssh Transparently transmit commands to the target server .
- On the target server sshd Process execution sudo xxxx、su、id And so on command , Because the target server has been jmp-agent Took over identity failure and authority authentication , Therefore, from jmp.so Get login user name 、 Current user name 、 Local address information 、 Target user name information , transfer jmp-api Interface for sudo Permission authentication .
- jmp-api Judge whether the user has the right to switch the machine to xx Account permissions ( If there is root jurisdiction ).
- sudo、su、id Wait for the process to pass jmp.so The authentication result is obtained , Decide whether to switch users .

4.5 Use web interaction
- Only if the user has completed login through the web page ( Such as sso) The situation of .
- Users access through web pages jmp-socket service .
- jmp-socket Service to get user name information 、 Website login sso Information , Submit to jmp-api, Generate a temporary login credential .
- jmp-socket visit jmp-ssh, Submit temporary login credentials .
- jmp-ssh Initiate secondary authentication for login , Wait for the user to complete the secondary authentication .
- jmp-socket After the user completes the second authentication , To undertake the ssh Role of client , And jmp-ssh Interaction .

4.6 Dangerous command interception
- jmp-ssh After the user has logged in to the target server , In this session , Load the dangerous command rules of the corresponding service of the target machine , Initialize regular matching logic .
- jmp-ssh At the end of the user input statement , According to the dangerous order rules of the machine , Match statements entered by the user .
- jmp-ssh Match the post strategy according to the dangerous command rules , Decide to do the following for this input : The alarm 、 Intercept 、 adopt .
- For passing ,jmp-ssh Pass the command to the target server .
- For alarm ,jmp-ssh Pass the command to the target server , But to the user 、 The immediate leader of the user 、jmp The system administrator sends a danger command alarm .
- For intercepted ,jmp-ssh Refuse to pass command , At the same time, the user 、 The immediate leader of the user 、jmp The system administrator sends a danger command alarm .

4.7 Not Linux The springboard of the server
- Windows The server
- MySQL Terminals and Redis terminal
- Network device management terminal
5、 ... and 、 Permission rules and approval link design
5.1 Default permissions

5.2 Approval link of permission application
- If you don't have default permissions , But you need to log in to the machine , Or you need to use ROOT jurisdiction , You need to apply .
- If you apply for permission for an organization , Then the organization ( department ) All members have the permission to apply for locks .

6、 ... and 、 The advantages of this realization idea
6.1 It is easy to operate , Better experience
6.2 Safe and reliable , Easy to audit
6.3 The responsibilities of the service room are clear
7、 ... and 、 Summary and prospect
边栏推荐
- Read PDF image and identify content
- An error is reported when uninstalling Oracle
- 六月集训(第28天) —— 动态规划
- Idea failed to connect to SQL Sever
- ==And eqauls()
- Teach you how to handle the reverse SVG mapping of JS
- The R language uses the avplots function in the car package to create added variable plots. In image interaction, manually identify (add) strong influence points that have a great impact on each predi
- Decorator
- 引入 flink-sql-mysql-cdc-2.2.1 好多依赖冲突,有解决的吗?
- Read PDF Text and write excel operation
猜你喜欢

How to view the web password saved by Google browser

接口自动化框架脚手架-参数化工具的实现

mysql打不开,闪退

Caffeine cache, the king of cache, has stronger performance than guava

How to distinguish and define DQL, DML, DDL and DCL in SQL

Redis sentinel cluster main database failure data recovery ideas # yyds dry goods inventory #

PMP examination key summary VIII - monitoring process group (2)

组合模式(Composite Pattern)

Explain final, finally, and finalize

为什么 Istio 要使用 SPIRE 做身份认证?
随机推荐
JVM family (2) - garbage collection
Discard Tkinter! Simple configuration to quickly generate cool GUI!
[Unity][ECS]学习笔记(三)
On the influence of small program on the digitalization of media industry
解决表单action属性传参时值为null的问题
最小栈<难度系数>
Understand 12 convolution methods (including 1x1 convolution, transpose convolution and deep separable convolution)
[Unity][ECS]学习笔记(一)
4 methods for exception handling
Generate token
Numpy array: join, flatten, and add dimensions
The boss asked me to write an app automation -- yaml file reading -- with the whole framework source code attached
Unity loads AssetBundle resources from the server and writes them to local memory, and loads the downloaded and saved AB resources from local memory to the scene
【NLP】今年高考英语AI得分134,复旦武大校友这项研究有点意思
Fabric.js 笔刷到底怎么用?
一文读懂 12种卷积方法(含1x1卷积、转置卷积和深度可分离卷积等)
TCP实战案例之即时通信、BS架构模拟
标识符的命名规则和规范
Inventory of excellent note taking software: good-looking and powerful visual note taking software, knowledge map tools heptabase, hydrogen map, walling, reflect, infranodus, tiddlywiki
Caffeine cache, the king of cache, has stronger performance than guava