什么牌子的蛋白质粉比较好| 屈光度是什么意思| 世界上最贵的烟是什么烟| 小猫的胡须有什么作用| 小厮是什么意思| 什么是比热容| 孔雀的尾巴像什么| 冬虫夏草生长在什么地方| 大便次数多吃什么药| 7月6号是什么星座| 眼睛老是流眼泪是什么原因| 气什么意思| 能力很强的动物是什么| 口若什么什么| 推特是什么意思| 血液科是看什么病| 人体自由基是什么| 身体出现小红点是什么原因| 免疫组化检查是什么| 蝴蝶什么意思| 转注是什么意思| bv是什么牌子| 1994属什么| 瞿读什么| 子宫内膜炎是什么原因造成的| 11月8日什么星座| 母亲节一般送什么礼物| 客串是什么意思| 胎盘宫底后壁是什么意思| 裸钻是什么| 眼睛有眼屎是什么原因| 左侧淋巴结肿大是什么原因| 大蒜泡酒治什么病| 地头蛇比喻什么样的人| 春肖是什么生肖| 感冒发烧挂什么科| 睡觉口苦是什么原因| 女人血虚吃什么补最快| 什么什么的天空| 老人怕冷是什么原因| 青蛙什么| doosan挖掘机是什么牌子| 作价是什么意思| 胃痉挛吃什么药| 梦见仙鹤是什么意思| 肚子里的蛔虫是什么意思| 线索细胞是什么| 杜牧字什么号什么| 清胃火吃什么药| 防空警报是什么| 咖啡因是什么东西| 为情所困是什么意思| 月令是什么意思| 仲夏夜是什么时候| 社保缴纳基数是什么意思| 六个口是什么字| 梦见鞭炮是什么意思| 宾字五行属什么| 抗凝血是什么意思| 尿红细胞阳性什么意思| 蜈蚣长什么样子| 狗改不了吃屎是什么意思| 亚甲减是什么意思| 头孢是什么药| 尿常规能查出什么病| 吃什么可以提高新陈代谢| 吸尘器什么牌子好| hdv是什么病毒| 大运什么意思| 嘴唇发白是什么原因引起的| 牙囊肿是什么病严重吗| 亲热是什么意思| 慢性萎缩性胃炎吃什么药可以根治| 低蛋白血症是什么意思| 医生会诊是什么意思| 三牛读什么| fox什么意思| vr间隙是什么意思| 八字不合是什么生肖| 今是什么结构| 12月16是什么星座| 番茄和西红柿有什么区别| 蒙奇奇是什么动物| 河南南阳产什么玉| 冬瓜不能和什么一起吃| 后腰左侧疼痛是什么原因男性| 为什么手上会起小水泡| 苏字五行属什么| 后脑勺疼吃什么药| 肚子一直咕咕叫是什么原因| 送老人什么礼物最好| phc是什么意思| 此物非彼物是什么意思| gold什么意思| 雄鱼是什么鱼| 更年期出汗多是什么原因| 胃肠化是什么意思| 钝感力什么意思| 夜晚尿频尿多是什么原因| 9月24号什么星座| 元素是什么| 路由器坏了有什么症状| 狼藉是什么意思| 脓血症是什么病严重吗| 喝铁观音茶有什么好处| 拉屎出血是什么原因| 孩子记忆力差是什么原因| 来曲唑片是什么药| 什么食物补血效果最好最快| 十一月五号是什么星座| 老年人尿血是什么原因| 倭瓜是什么瓜| 鼻炎用什么药效果好| 李幼斌是什么军衔| 血糖高吃什么药| 母螳螂为什么要吃公螳螂| 身份证尾号代表什么| 头七有什么讲究| 原教旨主义是什么意思| 原浆是什么意思| 偷鸡不成蚀把米什么意思| 抽血抽不出来是什么原因| 吃什么可以提高免疫力和抵抗力| 三个羊念什么| 男士补肾吃什么| 早上三点是什么时辰| 孕期能吃什么| 寓言故事有什么特点| 术后吃什么水果| 什么春什么什么| 司马光和司马迁是什么关系| 伊朗用什么货币| 脾切除后有什么影响和后遗症| 为什么会长湿疹| 做梦梦见掉头发是什么意思| 拉肚子吃什么食物比较好| 冬至要注意什么| 什么满天下| 智齿什么时候拔最好| 什么东西能加不能减| 轶字五行属什么| 小腿长痣代表什么意思| 氪金是什么意思| 亲近是什么意思| 什么干什么燥| 胃疼什么症状| 人生苦短是什么意思| 腿血栓什么症状| 氨气对人体有什么危害| 幡然醒悟是什么意思| 肚子咕咕叫吃什么药| 朱元璋长什么样| 什么是义眼| 什么组词| 四月二十五是什么星座| 88年属什么的| 太古里是什么意思| 软组织感染是什么意思| 扁桃体发炎引起的发烧吃什么药| 肾阴虚是什么原因造成的| 肝郁气滞吃什么药好| 鲁迅是著名的什么家| 什么是血栓| 做美甲师容易得什么病| 肾积水是什么意思| 慢性宫颈炎吃什么药| p是什么意思医学| 维生素d滴剂什么时候吃最好| 反馈是什么意思| 梦到小男孩是什么意思| 龋病是什么意思| 成都市市长是什么级别| 肠炎吃什么药好的快| 二个月不来月经是什么原因| 藿香正气水是什么| 肃穆是什么意思| 喷砂是什么意思| 生姜泡醋有什么功效| 手机为什么没信号| 胸闷气短吃什么药疗效比较好| 米西米西什么意思| 肝虚火旺吃什么中成药| 武警是干什么的| 混圈是什么意思| 检查前列腺做什么检查| 钙片什么时候吃| 标准工资指什么| 吊膀子是什么意思| 智商125是什么水平| 刘备和刘表什么关系| 太多的理由太多的借口是什么歌| 王字加一笔是什么字| 2003属什么生肖| 烧高香是什么意思| 黄瓜什么时候种植| 小儿鼻炎用什么药好| 疰夏是什么意思| 血糖高吃什么降血糖| 玉米有什么营养价值| 什么是卵巢囊肿| 人为什么要吃饭| 自慰用什么| 指鹿为马的反义词是什么| 声东击西什么意思| 微创人流和无痛人流有什么区别| 为什么会得肠胃炎| 酮体是什么| 泛醇是什么| 书店买不到的书是什么书| 大连六院是什么医院| s和m是什么意思| 养胃喝什么茶好| 用什么药可以缩阴紧致| 醋泡花生米有什么功效| 糖醋里脊是什么肉| 腿疼吃什么药| 生活质量是什么意思| 宝宝流鼻涕吃什么药| 汤力水是什么| 为什么会自言自语| 变异性哮喘什么症状| 阿华田是什么饮料| 什么是有氧运动包括哪些| 玻璃结节是什么意思| 隔夜茶为什么不能喝| 乌鸦嘴是什么意思| 长期低烧是什么原因| 夹腿有什么坏处吗| alex是什么意思| 风湿因子高是什么原因引起的| 枕大神经痛吃什么药| 口干什么原因| 女大四岁有什么说法| 牙齿黄用什么牙膏| 眼神迷离什么意思| 备孕吃什么| 促排是什么意思| 嗔什么意思| 千里莺啼什么映什么| 黑洞里面是什么| 蓝风铃香水什么味道| 学生近视配什么镜片好| 外痔疮是什么样子图片| 甲亢病有什么症状| 女性小腹疼痛是什么原因| 荔枝对身体有什么好处| 今年是什么命| 野生蜂蜜有什么好处和作用| 黑便是什么原因| 锅烧是什么| 感冒咳嗽吃什么药止咳效果好| 太阳是什么颜色的| 胆红素三个指标都高是什么原因| 狗翻肠子什么症状| 女性漏尿是什么原因| 因果关系是什么意思| 高血压饮食上注意什么| 曲安奈德针治疗什么| 低密度脂蛋白胆固醇高是什么意思| 吃什么补气养血最快| 宝宝佛适合什么人戴| 什么东西有脚却不能走路| 什么食物黄体酮含量高| 朝鲜为什么那么落后| 百度

Chapter?20.?NetBSD Veriexec subsystem

Table of Contents

20.1. How it works
20.2. Signatures file
20.3. Generating fingerprints
20.4. Strict levels
20.5. Veriexec and layered file systems
20.6. Kernel configuration

Veriexec is NetBSD's file integrity subsystem. It's kernel based, hence can provide some protection even in the case of a root compromise.

20.1.?How it works

Veriexec works by loading a specification file, also called the signatures file, to the kernel. This file contains information about files Veriexec should monitor, as well as their digital fingerprint (along with the hashing algorithm used to produce this fingerprint), and various flags that will be discussed later.

At the moment, the following hashing algorithms are supported by Veriexec: MD5, SHA1, SHA256, SHA384, SHA512, and RMD160.

20.2.?Signatures file

An entry in the Veriexec signatures file looks like this:

	/path/to/file algorithm fingerprint flags

Where the first element, the path, must always be an absolute path. The algorithm is one of the algorithms listed above, and fingerprint is the ASCII fingerprint.

20.3.?Generating fingerprints

You can generate ASCII fingerprints for each algorithm using the following tools:

Table?20.1.?Veriexec fingerprints tools

Algorithm Tool
MD5 /usr/bin/cksum -a md5
SHA1 /usr/bin/cksum -a sha1
SHA256 /usr/bin/cksum -a sha256
SHA384 /usr/bin/cksum -a sha384
SHA512 /usr/bin/cksum -a sha512
RMD160 /usr/bin/cksum -a rmd160

For example, to generate a MD5 fingerprint for /bin/ls:

	% cksum -a md5 < /bin/ls
	a8b525da46e758778564308ed9b1e493

And to generate a SHA512 fingerprint for /bin/ps:

	% cksum -a sha512 < /bin/ps
	381d4ad64fd47800897446a2026eca42151e03adeae158db5a34d12c529559113d928a9fef9a7c4615d257688d1da4645db004081030d7f080bb7198067eb890

Each entry may be associated with zero or more flags. Currently, these flags indicate how the file the entry is describing should be accessed. Note that this access type is enforced only in strict level 2 (IPS mode) and above.

The access types you can use are DIRECT, INDIRECT, and FILE.

  • DIRECT access means that the file is executed directly, and not invoked as an interpreter for some script, or opened with an editor. Usually, most programs you use will be accessed using this mode:

    	% ls /tmp
    	% cp ~/foo /tmp/bar
    	% rm ~/foo
  • INDIRECT access means that the file is executed indirectly, and is invoked to interpret a script. This happens usually when scripts have a #! magic as their first line. For example, if you have a script with the following as its first line:

    	#!/bin/sh

    And you run it as:

    	% ./script.sh

    Then /bin/sh will be executed indirectly -- it will be invoked to interpret the script.

  • FILE entries refer to everything which is not (or should not) be an executable. This includes shared libraries, configuration files, etc.

    Some examples for Veriexec signature file entries:

    	/bin/ls         MD5 dc2e14dc84bdefff4bf9777958c1b20b DIRECT
    	/usr/bin/perl   MD5 914aa8aa47ebd79ccd7909a09ed61f81 INDIRECT
    	/etc/pf.conf    MD5 950e1dd6fcb3f27df1bf6accf7029f7d FILE

Veriexec allows you to specify more than one way to access a file in an entry. For example, even though /usr/bin/perl is mostly used as an interpreter, it may be desired to be able to execute it directly, too:

	/usr/bin/perl MD5 914aa8aa47ebd79ccd7909a09ed61f81 DIRECT, INDIRECT

Shell scripts using #! magic to be executable also require two access types: We need them to be DIRECT so we can execute them, and we need them to be FILE so that the kernel can feed their contents to the interpreter they define:

	/usr/src/build.sh MD5 e80dbb4c047ecc1d84053174c1e9264a DIRECT, FILE

To make it easier to create signature files, and to make the signature files themselves more readable, Veriexec allows you to use the following aliases:

Table?20.2.?Veriexec access type aliases

Alias Expansion
PROGRAM DIRECT
INTERPRETER INDIRECT
SCRIPT DIRECT, FILE
LIBRARY FILE

After you have generated a signatures file, you should save it as /etc/signatures, and enable Veriexec in rc.conf:

	veriexec=YES

20.4.?Strict levels

Since different people might want to use Veriexec for different purposes, we also define four strict levels, ranging 0-3, and named learning, IDS, IPS, and lockdown modes.

In strict level 0, learning mode, Veriexec will act passively and simply warn about any anomalies. Combined with verbose level 1, running the system in this mode can help you fine-tune the signatures file. This is also the only strict level in which you can load new entries to the kernel.

Strict level 1, or IDS mode, will deny access to files with a fingerprint mismatch. This mode suits mostly to users who simply want to prevent access to files which might've been maliciously modified by an attacker.

Strict level 2, IPS mode, takes a step towards trying to protect the integrity of monitored files. In addition to preventing access to files with a fingerprint mismatch, it will also deny write access and prevent the removal of monitored files, and enforce the way monitored files are accessed. (as the signatures file specifies).

Lockdown mode (strict level 3) can be used in highly critical situations such as custom made special-purpose machines, or as a last line of defense after an attacker compromised the system and we want to prevent traces from being removed, so we can perform post-mortem analysis. It will prevent the creation of new files, and deny access to files not monitored by Veriexec.

It's recommended to first run Veriexec in strict level 0 and verbose level 1 to fine-tune your signatures file, ensuring that desired applications run correctly, and only then raise the strict level (and lower the verbosity level). You can use /etc/sysctl.conf to auto raise the strict level to the desired level after a reboot:

	kern.veriexec.strict=1

20.5.?Veriexec and layered file systems

Veriexec can be used on NFS file systems on the client side and on layered file systems such as the union file system. The files residing on these file systems need only be specified in the /etc/signatures file and that the file systems be mounted prior to the fingerprints being loaded.

If you are going to use layered file systems then you must ensure that you include the fingerprint for files you want protected at every layer. If you fail to do this someone could overwrite a file protected by Veriexec by using a different layer in a layered file system stack. This limitation may be removed in later versions of NetBSD.

It's recommended that if you are not going to use layered file systems nor NFS then these features should be disabled in they kernel configuration. If you need to use layered file systems then you must follow the instructions in the previous paragraph and ensure that the files you want protected have fingerprints at all layers. Also you should raise securelevel to 2 after all mounts are done:

	kern.securelevel=2

To prevent new layers being mounted which could compromise Veriexec's protection.

20.6.?Kernel configuration

To use Veriexec, aside from creating a signatures file, you should enable (uncomment) it in your kernel's config file: (e.g. /usr/src/sys/arch/i386/conf/GENERIC):

	pseudo-device veriexec

Then, you need to enable the hashing algorithms you wish to support:

	options VERIFIED_EXEC_FP_MD5
	options VERIFIED_EXEC_FP_SHA1
	options VERIFIED_EXEC_FP_RMD160
	options VERIFIED_EXEC_FP_SHA512
	options VERIFIED_EXEC_FP_SHA384
	options VERIFIED_EXEC_FP_SHA256

Depending on your operating system version and platform, these may already be enabled. Once done, rebuild and reinstall your kernel, see Chapter?34, Compiling the kernel for further instructions.

If you do not have the Veriexec device /dev/veriexec, you can create it manually by running the following command:

# cd /dev
# sh MAKEDEV veriexec 
锌中毒是什么症状 月经迟迟不来是什么原因 血hcg是什么意思 卵巢结节是什么意思 年金是什么
员工体检费计入什么科目 感觉心慌是什么原因 心脏大是什么病严重吗 栀子花什么季节开花 闺六月是什么意思
贴图是什么意思 佐餐是什么意思 双肺纹理增多增粗是什么病 chocker是什么 炉甘石是什么东西
手关节疼痛挂什么科 香砂六君丸治什么病 濒死感是什么感觉 泰山在什么地方 前戏是什么
霉菌反复发作是什么原因hcv8jop0ns3r.cn 什么是夜盲症hcv8jop0ns4r.cn 高血脂挂什么科hcv8jop4ns4r.cn 耳石症挂什么科hcv9jop1ns2r.cn 正月初一是什么生肖hcv7jop9ns8r.cn
冷得直什么hcv7jop6ns5r.cn 结肠炎是什么原因引起的hcv7jop9ns5r.cn 腹泻吃什么药hcv8jop6ns8r.cn 百香果和什么不能一起吃hcv7jop9ns9r.cn 睡觉流口水是什么毛病hcv7jop5ns6r.cn
surprise是什么意思hcv8jop6ns3r.cn 12年义务教育什么时候开始hcv8jop2ns2r.cn 九斗一簸箕有什么说法hcv8jop4ns8r.cn 证候是什么意思hcv8jop0ns8r.cn 平方是什么意思adwl56.com
梦见很多小蛇是什么意思hebeidezhi.com nas是什么hcv8jop2ns0r.cn 为什么会一直拉肚子ff14chat.com 带状疱疹是什么病hcv9jop5ns6r.cn 再接再厉什么意思hcv8jop1ns9r.cn
百度