Shell脚本和安全性 [英] Shell scripts and security

查看:80
本文介绍了Shell脚本和安全性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TLDP的《高级Bash脚本指南》指出,不应将外壳程序脚本用于"安全至关重要的情况" ,您需要在其中保证系统的完整性并防止入侵,破解和故意破坏."

TLDP's Advanced Bash Scripting Guide states that shell scripts shouldn't be used for "situations where security is important, where you need to guarantee the integrity of your system and protect against intrusion, cracking, and vandalism."

是什么使shell脚本不适合这种用例?

What makes shell scripts unsuitable for such a use case?

推荐答案

由于shell的可扩展性,很难验证shell脚本是否可以执行其预期的功能,并且很难在 中执行该功能.面对对抗性的投入. Shell的行为方式取决于环境以及其自身众多配置变量的设置.每个命令行都经过多个级别的扩展,评估和内插.一些shell构造在子流程中运行,而该构造包含的变量在父流程中扩展.在设计可能受到攻击的系统时,所有这些都与KISS原则背道而驰.

Because of the malleability of the shell, it is difficult to verify that a shell script performs its intended function and only that function in the face of adversarial input. The way the shell behaves depends on the environment, plus the settings of its own numerous configuration variables. Each command line is subject to multiple levels of expansion, evaluation and interpolation. Some shell constructs run in subprocesses while the variables the construct contains are expanded in the parent process. All of this is counter to the KISS principle when designing systems that might be attacked.

这篇关于Shell脚本和安全性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆