Windows - 运维篇
第三章 利用cmd自带的icacls命令导出文件的ACL权限
系列文章回顾
第一章 迁移WinSrv系统到虚拟机
第二章 本地安全策略+xcopy实现实时备份文件夹内容
下章内容
背景
1. 为方便梳理和统计SMB存储服务器上的文件夹权限,使用Win32的icacls命令对文件夹进行文件权限ACL导出。此例以Windows Server 2016搭建了SMB文件共享服务,在此系统上利用icacls命令实现文件ACL权限的导出。
2. 为方便梳理和统计文件夹权限ACL列表,使用Python编写了一个cmd程序,该程序功能是调用icacls命令实现递归遍历文件夹和导出文件ACL到Excel表格。
利用cmd自带的icacls命令导出文件的ACL权限
1. 文件权限ACL说明
官方原文 | 翻译+解释 |
---|---|
F - Full access | F - 完全控制 |
M - Modify access | M - 修改 |
RX - Read and execute access | RX - 读取和执行 |
R - Read-only access | R - 读取 |
W - Write-only access | W - 写入 |
D - Delete | D - 删除 |
RC - Read control (read permissions) | Rc - 读取权限 |
WDAC - Write DAC (change permissions) | WDAC - 更改权限 |
WO - Write owner (take ownership) | WO - 取得所有权 |
S - Synchronize | S - 同步 |
AS - Access system security | AS - 访问系统安全性 |
MA - Maximum allowed | MA - 允许的最大数量 |
GR - Generic read | GR - 泛型读取 |
GW - Generic write | GW - 泛型写入 |
GE - Generic execute | GE - 泛型执行 |
GA - Generic all | GA - 全部通用 |
RD - Read data/list directory | RD - 列出文件夹/读取数据 |
WD - Write data/add file | WD - 创建文件/写入数据 |
AD - Append data/add subdirectory | AD - 创建文件夹/附加数据 |
REA - Read extended attributes | REA - 读取扩展属性 |
WEA - Write extended attributes | WEA - 写入扩展属性 |
X - Execute/traverse | X - 遍历文件夹/执行文件 |
DC - Delete child | DC - 删除子文件夹及文件 |
RA - Read attributes | RA - 读取属性 |
WA - Write attributes | WA - 写入属性 |
2. 文件权限继承关系说明
官方原文 | 翻译+解释 |
---|---|
(I) - Inherit. ACE inherited from the parent container. | (I) - 继承。 ACE 继承自父容器 |
(OI) - Object inherit. Objects in this container will inherit this ACE. Applies only to directories. | (OI) - 对象继承。 此容器中的对象将继承此 ACE。 仅适用于目录 |
(CI) - Container inherit. Containers in this parent container will inherit this ACE. Applies only to directories. | (CI) - 容器继承。 此父容器中的容器将继承此 ACE。 仅适用于目录 |
(IO) - Inherit only. ACE inherited from the parent container, but does not apply to the object itself. Applies only to directories. | (IO) - 仅继承。 ACE 继承自父容器,但不适用于对象本身。 仅适用于目录 |
(NP) - Do not propagate inherit. ACE inherited by containers and objects from the parent container, but does not propagate to nested containers. Applies only to directories. | (NP) - 不传播继承。 ACE 由容器和对象从父容器继承,但不传播到嵌套容器。 仅适用于目录 |
3. 执行icacls命令的回显
py写的cmd工具调用icacls命令
1. 工具的参数列表如下
- py工具的文章链接: python+icacls 制作Win系统文件权限ACL导出小工具