Enhanced Linux kernel intrusion detection Security (II)

Source: Internet
Author: User
Linux Kernel intrusion detection security enhancement implementation (II)-Linux general technology-Linux programming and kernel information. The following is a detailed description. IV. Implementation

This section describes how to create a reference monitor in a linux system. In the beginning, we will describe an access control function, which includes the data structure definition of the access control database (ACD) added to the kernel. This new system call Reads, writes, and upgrades ACD and reference function. The check_rootproc code is also attached.

   4.1 authentication functions

The access control database includes a reference monitor for each system call. Here, only two main data structures work. One is setuid_acd, which is used to check system calls to setuid, and the other is execve_acd to check system calls to execve. The two structures are listed below.
CODE:/* setuid_acd */

Static char rpasswd [LEN_PWD];

/* Execve_acd */

Typedef struct setuid_proc_id {

Char comm [16];

Unsigned long count;

} Suidpid_t;

Typedef struct setuid_program {

Suidpid_t suidp_id;

Suidp_t * next;/* next program */

} Suidp_t;

Typedef struct exe_file_id {

_ Kernel_dev_t device;/* device number r */

Unsigned long inode;/* inode node number */

_ Kernel_off_t size;/* size */

_ Kernel_time_t modif:/* modification time */

} Efid_t;

Typedef struct executable_file {

Efid_t efid;/* File identification time information */

Int prog_nr;/* Number of programs that can call exe */

Suidp_t * programs;/* List of certification programs */

} Efile_t;

Typedef struct executable_file_list {

Efile_t lst [NR_EXE];

Unsigned int total;/* total Number of exe files in the list */

} Eflst_t;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.