CN115827153A - Method, device, equipment and medium for detecting brute force cracking of SSH (secure Shell) service in container - Google Patents

Method, device, equipment and medium for detecting brute force cracking of SSH (secure Shell) service in container Download PDF

Info

Publication number
CN115827153A
CN115827153A CN202211390133.5A CN202211390133A CN115827153A CN 115827153 A CN115827153 A CN 115827153A CN 202211390133 A CN202211390133 A CN 202211390133A CN 115827153 A CN115827153 A CN 115827153A
Authority
CN
China
Prior art keywords
container
brute force
port
login
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211390133.5A
Other languages
Chinese (zh)
Inventor
徐飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202211390133.5A priority Critical patent/CN115827153A/en
Publication of CN115827153A publication Critical patent/CN115827153A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention provides a method, a device, equipment and a readable medium for detecting brute force cracking of SSH (secure Shell) service in a container, wherein the method comprises the following steps: acquiring container ID list information and container port information, and setting brute force crack detection rules for each container; creating a pluggable authentication pam module for each container in the host; responding to the access of a port of the host container, selecting a corresponding pam module for authentication login based on port information, and recording a login event through the authentication pam module; and determining whether the container is subjected to brute force intrusion based on brute force detection rules of the container and the login event. By using the scheme of the invention, the detection of the SSH service brute force cracking of a plurality of containers in the host machine can be realized simultaneously by utilizing the port mapping mechanism of the container and the pam pluggable authentication module of the linux system without depending on the system rsyslog service on the premise of not creating a privileged container.

Description

Method, device, equipment and medium for detecting brute force cracking of SSH (secure Shell) service in container
Technical Field
The present invention relates to the field of computers, and more particularly, to a method, apparatus, device, and readable medium for brute force detection of SSH services in a container.
Background
The fail2ban is a piece of utility software on the linux system, can monitor the system log, then perform corresponding shielding action on error information (regular matching) matched with the log, can support a large number of services, such as sshd, apache, qmai, profitpd, sasl, etc., the implementation mechanism of the fail2ban is a filtering and screening device for log IPs, finds out these "misbehaving" IPs from the log according to different prison rules, once these IPs send requests of offending prison rules to reach a threshold value, the IPs can directly block and shield the IPs, and the time for shielding the IPs can be set for a long time to avoid the damage caused by accidental injury. The most important thing to use fail2ban is how to make effective prison rules according to the log, and after the rules are made, whether the rules are effective or not needs to be tested, and whether the rules are effective or not can achieve the expected purpose.
The docker container is an open-source application container engine, so that developers can package their applications and dependency packages in a uniform manner into a portable container and then distribute the package to any server (including popular Linux machines and windows machines) provided with the docker engine, and virtualization can be realized. After SSH (Secure Shell, a security protocol established on the basis of an application layer) service is opened in the docker container, fail2ban can be used for brute force cracking detection. However, when the fail2ban is directly installed and is not configured like a host using the container, it is found that the fail-safe is not effective. Because SSH services are opened when a docker container is used, but because no rsyslog is opened in the container, fail2ban dependent/var/log/auth. That is to say, the use of fail2ban is strongly dependent on the rsyslog service, however, the container without privilege added cannot open the function that the service cannot use iptables and the like, and if privilege is added to the container, the user of the container has the user right of the host root, which causes a great security risk.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a device, and a readable medium for detecting brute force cracking of an SSH service in a container, which can detect the brute force cracking of the SSH service of multiple containers in a host machine simultaneously by using a port mapping mechanism of the container itself and a pam pluggable authentication module of a linux system itself without depending on a system rsyslog service on the premise of not creating a privileged container.
In view of the above object, an aspect of the embodiments of the present invention provides a method for detecting brute force of an SSH service in a container, including the following steps:
acquiring container ID list information and container port information, and setting brute force cracking detection rules for each container;
creating a pluggable authentication pam module for each container in the host;
responding to the access of a port of the host container, selecting a corresponding pam module for authentication login based on port information, and recording a login event through the authentication pam module;
and determining whether the container is subjected to brute force intrusion based on brute force detection rules of the container and the login event.
According to an embodiment of the present invention, acquiring the container ID list information and the container port information, and setting a brute force detection rule for each container includes:
acquiring container ID list information and port information of each container, wherein the port information is information that an SSH service default 22 port screened after a docker port container ID command result is acquired is mapped to a port of a host;
and respectively setting brute force cracking detection rules for the containers in the container ID list based on the attributes and requirements of the containers, wherein the brute force cracking detection rules are that the login failure times reach a threshold value within a preset time period.
According to one embodiment of the invention, determining whether a container is brute-force invaded based on brute-force detection rules of the container and a login event comprises:
counting login failure times and time corresponding to the container ID recorded in the login event;
counting whether the login failure times reach a threshold value within a preset time period;
and determining that the container is subjected to brute force invasion in response to the fact that the login failure times reach a threshold value within a preset time period.
According to an embodiment of the present invention, further comprising:
and in response to the fact that the container is determined to be subjected to brute force cracking and invasion, shielding the IP address of the port of the login container, and sending corresponding alarm information.
In another aspect of the embodiments of the present invention, there is also provided an apparatus for brute force detection of an SSH service in a container, the apparatus including:
the acquisition module is configured to acquire container ID list information and container port information and set brute force cracking detection rules for each container;
a creation module configured to create a pluggable authentication pam module for each container in the host;
the recording module is configured to respond to the access of a port of the host container, select a corresponding pam module for authentication login based on port information, and record a login event through the authentication pam module;
a determination module configured to determine whether the container has been brute force intruded based on brute force detection rules for the container and the login event.
According to an embodiment of the invention, the obtaining module is further configured to:
acquiring container ID list information and port information of each container, wherein the port information is information that an SSH service default 22 port screened after a docker port container ID command result is acquired is mapped to a port of a host;
and respectively setting brute force cracking detection rules for the containers in the container ID list based on the attributes and requirements of the containers, wherein the brute force cracking detection rules are that the login failure times reach a threshold value within a preset time period.
According to one embodiment of the invention, the determination module is further configured to:
counting login failure times and time corresponding to the container ID recorded in the login event;
counting whether the login failure times reach a threshold value within a preset time period;
and determining that the container is subjected to brute force invasion in response to the fact that the login failure times reach a threshold value within a preset time period.
According to one embodiment of the invention, the system further comprises an alarm module configured to:
and in response to the fact that the container is determined to be subjected to brute force cracking and invasion, shielding the IP address of the port of the login container, and sending corresponding alarm information.
In another aspect of an embodiment of the present invention, there is also provided a computer apparatus including:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of any of the methods described above.
In another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium storing a computer program, which when executed by a processor implements the steps of any one of the above-mentioned methods.
The invention has the following beneficial technical effects: according to the method for detecting the brute force cracking of the SSH service in the container, provided by the embodiment of the invention, the list information of the ID of the container and the port information of the container are obtained, and brute force cracking detection rules are set for each container; creating a pluggable authentication pam module for each container in the host; responding to the access of a port of the host container, selecting a corresponding pam module for authentication login based on port information, and recording a login event through the authentication pam module; the technical scheme for determining whether the container is brute force cracked and invaded or not based on brute force crack detection rules of the container and login events can realize brute force crack detection of SSH services of a plurality of containers in a host machine at the same time by utilizing a port mapping mechanism of the container and a pam pluggable authentication module of a linux system without depending on system rsyslog services on the premise of not creating a privileged container.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a schematic flow chart diagram of a method of brute force detection of an SSH service in a container, according to one embodiment of the present invention;
FIG. 2 is a schematic diagram of a brute force detection system for an SSH service in a container, according to one embodiment of the invention;
FIG. 3 is a schematic diagram of brute force detection system communication for an SSH service in a container, according to one embodiment of the present invention;
FIG. 4 is a schematic diagram of an apparatus for brute force detection of SSH services in a container, according to one embodiment of the present invention;
FIG. 5 is a schematic diagram of a computer device according to one embodiment of the present invention;
fig. 6 is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
In view of the above objects, a first aspect of embodiments of the present invention proposes an embodiment of a method for brute force detection of an SSH service in a container. Fig. 1 shows a schematic flow diagram of the method.
As shown in fig. 1, the method may include the steps of:
s1, acquiring the ID list information and the port information of the container, and setting brute force cracking detection rules for each container. The method comprises the steps of obtaining container ID list information and port information of each container, wherein the port information is information that 22 ports are screened out by default and mapped to a port of a host by SSH service after a docker port container ID command result is obtained, then setting brute force cracking detection rules for the containers in a container ID list respectively based on the property and the requirement of the containers, wherein the brute force cracking detection rules are that the number of login failures reaches a threshold value in a preset time period, for example, the detection duration and the threshold value are set, for example, the detection duration is 1 minute, the threshold value is 10 times, namely, the SSH login failures within 1 minute are 10 times, namely, the SSH login failures are considered to be brute force cracking, and a plurality of containers can be configured with the same rule or different rules.
S2, a pluggable authentication pam module is created for each container in the host.
And S3, responding to the access of the port of the host container, selecting a corresponding pam module for authentication login based on the port information, and recording a login event through the authentication pam module. Creating a pluggable authentication PAM module for each container, using different PAM modules according to different accessed ports during host login authentication, wherein for example, a container A is mapped to be 4321, the pluggable authentication module is PAM-A, when a port of a host 4321 is accessed, calling the PAM-A module, recording login events of the 4321 port by using the PAM-A module, and recording information such as login time, login users, remote IP addresses, success of login and the like.
And S4, determining whether the container is subjected to brute force invasion or not based on brute force crack detection rules of the container and the login event. And counting the login failure times and time corresponding to the container ID recorded in the login event, counting whether the login failure times reach a threshold value within a preset time period, and if the login failure times reach the threshold value within the preset time period, determining that the container is violently cracked and invaded. And if the container is determined to be cracked and invaded violently, shielding the IP address of the port of the login container and sending corresponding alarm information.
The method of the present invention can be implemented by using a system as shown in fig. 2, where the system includes a brute force cracking detection agent end deployed in a container, and a brute force cracking detection management end deployed by a host, a container cluster management system and a host. One to a plurality of Docker containers are deployed in the host machine, and each Docker container is internally provided with a Docker daemon process and a Docker containerization application (a Web application, a database application and the like). The brute force cracking detection management end is communicated with the container cluster management system, can acquire container ID list information and container port information (the port information is information that 22 SSH service default ports screened after a docker port container ID command result is acquired are mapped to ports of a host), and supports rules for configuring brute force cracking detection for different container ID lists, such as setting detection duration and threshold values, wherein the detection duration is 1 minute, the threshold value is 10 times, namely SSH login failure of 10 times within 1 minute is considered brute force cracking, and a plurality of containers can be configured with the same rules and can also be configured with different rules. As shown in fig. 3, the brute force cracking detection management end communicates with the brute force cracking detection Agent end, issues the configured rule and the obtained port to the Agent end of the specific container, and issues a message in the form of:
Figure BDA0003931689110000061
Figure BDA0003931689110000071
the Agent end creates a pluggable authentication PAM module for each container, different PAM modules are used according to different accessed ports when a host machine is logged in and authenticated, for example, a mapping port of a container A is 4321, the pluggable authentication module is PAM-A, when the port of the host machine 4321 is accessed, the PAM-A module is called, the PAM-A module records login events of the 4321 port, login time, login users, remote IP addresses, login success and failure information and the like are uploaded to a brute force crack detection management end, the brute force crack detection management end screens out login failure events to calculate after receiving the login events, and if preset rules are met, SSH service in the container is considered to be brute force cracked and invaded.
By using the technical scheme of the invention, the detection of the SSH service brute force cracking of a plurality of containers in the host machine can be realized simultaneously by utilizing the port mapping mechanism of the container and the pam pluggable authentication module of the linux system without depending on the system rsyslog service on the premise of not creating a privileged container.
In a preferred embodiment of the present invention, the acquiring the container ID list information and the container port information, and setting the brute force detection rule for each container includes:
acquiring container ID list information and port information of each container, wherein the port information is information that an SSH service default 22 port screened after a docker port container ID command result is acquired is mapped to a port of a host;
and respectively setting brute force cracking detection rules for the containers in the container ID list based on the attributes and requirements of the containers, wherein the brute force cracking detection rules are that the login failure times reach a threshold value within a preset time period.
In a preferred embodiment of the present invention, determining whether a container has been brute-force intruded based on the brute-force detection rules of the container and the login event comprises:
counting the login failure times and time corresponding to the container ID recorded in the login event;
counting whether the login failure times reach a threshold value within a preset time period;
and determining that the container is subjected to brute force invasion in response to the fact that the login failure times reach a threshold value within a preset time period.
In a preferred embodiment of the present invention, the method further comprises:
and in response to the fact that the container is determined to be subjected to brute force cracking and invasion, shielding the IP address of the port of the login container, and sending corresponding alarm information.
By using the technical scheme of the invention, the detection of the SSH service brute force cracking of a plurality of containers in the host machine can be realized simultaneously by utilizing the port mapping mechanism of the container and the pam pluggable authentication module of the linux system without depending on the system rsyslog service on the premise of not creating a privileged container.
It should be noted that, as will be understood by those skilled in the art, all or part of the processes in the methods of the above embodiments may be implemented by instructing relevant hardware through a computer program, and the above programs may be stored in a computer-readable storage medium, and when executed, the programs may include the processes of the embodiments of the methods as described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
Furthermore, the method disclosed according to an embodiment of the present invention may also be implemented as a computer program executed by a CPU, and the computer program may be stored in a computer-readable storage medium. The computer program, when executed by the CPU, performs the above-described functions defined in the method disclosed in the embodiments of the present invention.
In view of the above objects, in a second aspect of the embodiments of the present invention, there is provided an apparatus for brute force detection of an SSH service in a container, as shown in fig. 4, the apparatus 200 includes:
the acquisition module is configured to acquire container ID list information and container port information and set brute force cracking detection rules for each container;
a creation module configured to create a pluggable authentication pam module for each container in the host;
the recording module is configured to respond to the port of the host container being accessed, select a corresponding pam module for authentication login based on the port information, and record a login event through the authentication pam module;
a determination module configured to determine whether the container has been brute force intruded based on brute force detection rules for the container and the login event.
In a preferred embodiment of the present invention, the obtaining module is further configured to:
acquiring container ID list information and port information of each container, wherein the port information is information that an SSH service default 22 port screened after a docker port container ID command result is acquired is mapped to a port of a host;
and respectively setting brute force crack detection rules for the containers in the container ID list based on the attributes and the requirements of the containers, wherein the brute force crack detection rules are that the login failure times reach a threshold value within a preset time period.
In a preferred embodiment of the present invention, the determining module is further configured to:
counting login failure times and time corresponding to the container ID recorded in the login event;
counting whether the login failure times reach a threshold value within a preset time period;
and determining that the container is subjected to brute force invasion in response to the fact that the login failure times reach a threshold value within a preset time period.
In a preferred embodiment of the present invention, the system further comprises an alarm module, wherein the alarm module is configured to:
and in response to the fact that the container is determined to be subjected to brute force cracking and invasion, shielding the IP address of the port of the login container, and sending corresponding alarm information.
In view of the above object, a third aspect of the embodiments of the present invention provides a computer device. Fig. 5 is a schematic diagram of an embodiment of a computer device provided by the present invention. As shown in fig. 5, an embodiment of the present invention includes the following means: at least one processor 21; and a memory 22, the memory 22 storing computer instructions 23 executable on the processor, the instructions when executed by the processor implementing the method of:
acquiring container ID list information and container port information, and setting brute force crack detection rules for each container;
creating a pluggable authentication pam module for each container in the host;
responding to the access of a port of the host container, selecting a corresponding pam module for authentication login based on port information, and recording a login event through the authentication pam module;
and determining whether the container is subjected to brute force intrusion based on brute force detection rules of the container and the login event.
In a preferred embodiment of the present invention, the acquiring the container ID list information and the container port information, and setting the brute force detection rule for each container includes:
acquiring container ID list information and port information of each container, wherein the port information is information that an SSH service default 22 port screened after a docker port container ID command result is acquired is mapped to a port of a host;
and respectively setting brute force cracking detection rules for the containers in the container ID list based on the attributes and requirements of the containers, wherein the brute force cracking detection rules are that the login failure times reach a threshold value within a preset time period.
In a preferred embodiment of the present invention, determining whether a container has been brute-force intruded based on the brute-force detection rules of the container and the login event comprises:
counting login failure times and time corresponding to the container ID recorded in the login event;
counting whether the login failure times reach a threshold value within a preset time period;
and in response to the number of login failures reaching a threshold value within a preset time period, determining that the container is subjected to brute force cracking invasion.
In a preferred embodiment of the present invention, the method further comprises:
and in response to the fact that the container is determined to be subjected to brute force cracking and invasion, shielding the IP address of the port of the login container, and sending corresponding alarm information.
In view of the above object, a fourth aspect of the embodiments of the present invention proposes a computer-readable storage medium. FIG. 6 is a schematic diagram illustrating an embodiment of a computer-readable storage medium provided by the present invention. As shown in fig. 6, the computer readable storage medium 31 stores a computer program 32 which, when executed by a processor, performs the method of:
acquiring container ID list information and container port information, and setting brute force crack detection rules for each container;
creating a pluggable authentication pam module for each container in the host;
responding to the access of a port of the host container, selecting a corresponding pam module for authentication login based on port information, and recording a login event through the authentication pam module;
and determining whether the container is subjected to brute force intrusion based on brute force detection rules of the container and the login event.
In a preferred embodiment of the present invention, the acquiring the container ID list information and the container port information, and setting the brute force detection rule for each container includes:
acquiring container ID list information and port information of each container, wherein the port information is information that an SSH service default 22 port screened after a docker port container ID command result is acquired is mapped to a port of a host;
and respectively setting brute force cracking detection rules for the containers in the container ID list based on the attributes and requirements of the containers, wherein the brute force cracking detection rules are that the login failure times reach a threshold value within a preset time period.
In a preferred embodiment of the present invention, determining whether a container has been brute-force intruded based on the brute-force detection rules of the container and the login event comprises:
counting login failure times and time corresponding to the container ID recorded in the login event;
counting whether the login failure times reach a threshold value within a preset time period;
and determining that the container is subjected to brute force invasion in response to the fact that the login failure times reach a threshold value within a preset time period.
In a preferred embodiment of the present invention, the method further comprises:
and in response to the fact that the container is determined to be subjected to brute force cracking and invasion, shielding the IP address of the port of the login container, and sending corresponding alarm information.
Furthermore, the methods disclosed according to embodiments of the present invention may also be implemented as a computer program executed by a processor, which may be stored in a computer-readable storage medium. Which when executed by a processor performs the above-described functions defined in the methods disclosed in embodiments of the invention.
Further, the above method steps and system elements may also be implemented using a controller and a computer readable storage medium for storing a computer program for causing the controller to implement the functions of the above steps or elements.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
In one or more exemplary designs, the functions may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. Also, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, digital Versatile Disc (DVD), floppy disk, blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also combinations between technical features in the above embodiments or in different embodiments are possible, and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements and the like that may be made without departing from the spirit or scope of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. A method for brute force detection of SSH services in a container, comprising the steps of:
acquiring container ID list information and container port information, and setting brute force cracking detection rules for each container;
creating a pluggable authentication pam module for each container in the host;
responding to the access of a port of the host container, selecting a corresponding pam module for authentication login based on port information, and recording a login event through the authentication pam module;
and determining whether the container is subjected to brute force invasion or not based on brute force crack detection rules of the container and the login event.
2. The method of claim 1, wherein obtaining container ID list information and container port information and setting brute force detection rules for each container comprises:
acquiring container ID list information and port information of each container, wherein the port information is information that an SSH service default 22 port screened after a docker port container ID command result is acquired is mapped to a port of a host;
and respectively setting brute force cracking detection rules for the containers in the container ID list based on the attributes and requirements of the containers, wherein the brute force cracking detection rules are that the login failure times reach a threshold value within a preset time period.
3. The method of claim 1, wherein determining whether the container has been brute force intrusion based on the brute force detection rules for the container and the login event comprises:
counting login failure times and time corresponding to the container ID recorded in the login event;
counting whether the login failure times reach a threshold value within a preset time period;
and determining that the container is subjected to brute force invasion in response to the fact that the login failure times reach a threshold value within a preset time period.
4. The method of claim 1, further comprising:
and in response to the fact that the container is determined to be subjected to brute force cracking and invasion, shielding the IP address of the port of the login container, and sending corresponding alarm information.
5. An apparatus for brute force detection of SSH services in a container, the apparatus comprising:
an acquisition module configured to acquire container ID list information and container port information, and set brute force cracking detection rules for each container;
a creation module configured to create a pluggable authentication pam module for each container in a host;
the recording module is configured to respond to that a port of the host container is accessed, select a corresponding pam module for authentication login based on port information, and record a login event through the authentication pam module;
a determination module configured to determine whether the container has been brute force intruded based on brute force detection rules for the container and the login event.
6. The apparatus of claim 5, wherein the acquisition module is further configured to:
acquiring container ID list information and port information of each container, wherein the port information is information that an SSH service default 22 port screened after a docker port container ID command result is acquired is mapped to a port of a host;
and respectively setting brute force cracking detection rules for the containers in the container ID list based on the attributes and requirements of the containers, wherein the brute force cracking detection rules are that the login failure times reach a threshold value within a preset time period.
7. The apparatus of claim 5, wherein the determination module is further configured to:
counting login failure times and time corresponding to the container ID recorded in the login event;
counting whether the login failure times reach a threshold value within a preset time period;
and determining that the container is subjected to brute force invasion in response to the fact that the login failure times reach a threshold value within a preset time period.
8. The apparatus of claim 5, further comprising an alert module configured to:
and in response to the fact that the container is determined to be subjected to brute force cracking and invasion, shielding the IP address of the port of the login container, and sending corresponding alarm information.
9. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method of any one of claims 1 to 4.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 4.
CN202211390133.5A 2022-11-08 2022-11-08 Method, device, equipment and medium for detecting brute force cracking of SSH (secure Shell) service in container Pending CN115827153A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211390133.5A CN115827153A (en) 2022-11-08 2022-11-08 Method, device, equipment and medium for detecting brute force cracking of SSH (secure Shell) service in container

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211390133.5A CN115827153A (en) 2022-11-08 2022-11-08 Method, device, equipment and medium for detecting brute force cracking of SSH (secure Shell) service in container

Publications (1)

Publication Number Publication Date
CN115827153A true CN115827153A (en) 2023-03-21

Family

ID=85527089

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211390133.5A Pending CN115827153A (en) 2022-11-08 2022-11-08 Method, device, equipment and medium for detecting brute force cracking of SSH (secure Shell) service in container

Country Status (1)

Country Link
CN (1) CN115827153A (en)

Similar Documents

Publication Publication Date Title
US10154066B1 (en) Context-aware compromise assessment
EP1805641B1 (en) A method and device for questioning a plurality of computerized devices
Tien et al. KubAnomaly: Anomaly detection for the Docker orchestration platform with neural network approaches
US9311476B2 (en) Methods, systems, and media for masquerade attack detection by monitoring computer user behavior
US8782796B2 (en) Data exfiltration attack simulation technology
US20160127417A1 (en) Systems, methods, and devices for improved cybersecurity
US11582242B2 (en) System, computer program product and method for risk evaluation of API login and use
US20220060507A1 (en) Privilege assurance of enterprise computer network environments using attack path detection and prediction
US11856015B2 (en) Anomalous action security assessor
US11481478B2 (en) Anomalous user session detector
US20220060509A1 (en) Privilege assurance of enterprise computer network environments using lateral movement detection and prevention
CN114598525A (en) IP automatic blocking method and device for network attack
US11818160B2 (en) Predicting cyber risk for assets with limited scan information using machine learning
US20150026806A1 (en) Mitigating a Cyber-Security Attack By Changing a Network Address of a System Under Attack
US20230362142A1 (en) Network action classification and analysis using widely distributed and selectively attributed sensor nodes and cloud-based processing
CN115827153A (en) Method, device, equipment and medium for detecting brute force cracking of SSH (secure Shell) service in container
CN111241547A (en) Detection method, device and system for unauthorized vulnerability
CN112118241B (en) Audit penetration testing method, testing node server, management server and system
CN114285664A (en) Abnormal user identification method, system, device and medium
Jayasekara Security operations & incident management: Case study analysis
US11403395B1 (en) Method of using a dynamic rule engine with an application
KR102580469B1 (en) Method for management for cyber security threat and attack surface and apparatus for performing the method
US20230336591A1 (en) Centralized management of policies for network-accessible devices
US20230214533A1 (en) Computer-implemented systems and methods for application identification and authentication
CN117118753A (en) Network attack protection method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination