Movatterモバイル変換


[0]ホーム

URL:


  1. Home
  2. Mitigations
  3. Restrict File and Directory Permissions

Restrict File and Directory Permissions

Restricting file and directory permissions involves setting access controls at the file system level to limit which users, groups, or processes can read, write, or execute files. By configuring permissions appropriately, organizations can reduce the attack surface for adversaries seeking to access sensitive data, plant malicious code, or tamper with system files.

Enforce Least Privilege Permissions:

  • Remove unnecessary write permissions on sensitive files and directories.
  • Use file ownership and groups to control access for specific roles.

Example (Windows): Right-click the shared folder → Properties → Security tab → Adjust permissions for NTFS ACLs.

Harden File Shares:

  • Disable anonymous access to shared folders.
  • Enforce NTFS permissions for shared folders on Windows.

Example: Set permissions to restrict write access to critical files, such as system executables (e.g.,/bin or/sbin on Linux). Use tools likechown andchmod to assign file ownership and limit access.

On Linux, apply:
chmod 750 /etc/sensitive.conf
chown root:admin /etc/sensitive.conf

File Integrity Monitoring (FIM):

  • Use tools like Tripwire, Wazuh, or OSSEC to monitor changes to critical file permissions.

Audit File System Access:

  • Enable auditing to track permission changes or unauthorized access attempts.
  • Use auditd (Linux) or Event Viewer (Windows) to log activities.

Restrict Startup Directories:

  • Configure permissions to prevent unauthorized writes to directories likeC:\ProgramData\Microsoft\Windows\Start Menu.

Example: Restrict write access to critical directories like/etc/,/usr/local/, and Windows directories such asC:\Windows\System32.

  • On Windows, use icacls to modify permissions:icacls "C:\Windows\System32" /inheritance:r /grant:r SYSTEM:(OI)(CI)F
  • On Linux, monitor permissions using tools likelsattr orauditd.
ID: M1022
Version: 1.2
Created: 06 June 2019
Last Modified: 18 December 2024
Enterprise Layer
downloadview

Techniques Addressed by Mitigation

DomainIDNameUse
EnterpriseT1548Abuse Elevation Control Mechanism

The sudoers file should be strictly edited such that passwords are always required and that users can't spawn risky processes as users with higher privilege.

.003Sudo and Sudo Caching

The sudoers file should be strictly edited such that passwords are always required and that users can't spawn risky processes as users with higher privilege.

.006TCC Manipulation

When using an MDM, ensure the permissions granted are specific to the requirements of the binary. Full Disk Access should be restricted to only necessary binaries in alignment with policy.

EnterpriseT1098Account Manipulation

Restrict access to potentially sensitive files that deal with authentication and/or authorization.

.004SSH Authorized Keys

Restrict access to theauthorized_keys file.

EnterpriseT1547.003Boot or Logon Autostart Execution:Time Providers

Consider using Group Policy to configure and block additions/modifications to W32Time DLLs.[1]

.009Boot or Logon Autostart Execution:Shortcut Modification

Applying strict permissions to directories where shortcuts are stored, such as the startup folder, can prevent unauthorized modifications.

.013Boot or Logon Autostart Execution:XDG Autostart Entries

Restrict write access to XDG autostart entries to only select privileged users.

EnterpriseT1037Boot or Logon Initialization Scripts

Restrict write access to logon scripts to specific administrators.

.002Login Hook

Restrict write access to logon scripts to specific administrators.

.003Network Logon Script

Restrict write access to logon scripts to specific administrators.

.004RC Scripts

Limit privileges of user accounts so only authorized users can edit therc.common file.

.005Startup Items

Since StartupItems are deprecated, preventing all users from writing to the/Library/StartupItems directory would prevent any startup items from getting registered.

EnterpriseT1543Create or Modify System Process

Restrict read/write access to system-level process files to only select privileged users who have a legitimate need to manage system services.

.001Launch Agent

Set group policies to restrict file permissions to the~/launchagents folder.[2]

.002Systemd Service

Restrict read/write access to systemd unit files to only select privileged users who have a legitimate need to manage system services.

EnterpriseT1530Data from Cloud Storage

Use access control lists on storage systems and objects.

EnterpriseT1565Data Manipulation

Ensure least privilege principles are applied to important information resources to reduce exposure to data manipulation risk.

.001Stored Data Manipulation

Ensure least privilege principles are applied to important information resources to reduce exposure to data manipulation risk.

.003Runtime Data Manipulation

Prevent critical business and system processes from being replaced, overwritten, or reconfigured to load potentially malicious code.

EnterpriseT1546.004Event Triggered Execution:Unix Shell Configuration Modification

Making these files immutable and only changeable by certain administrators will limit the ability for adversaries to easily create user level persistence.

.013Event Triggered Execution:PowerShell Profile

Making PowerShell profiles immutable and only changeable by certain administrators will limit the ability for adversaries to easily create user level persistence.

EnterpriseT1048Exfiltration Over Alternative Protocol

Use access control lists on cloud storage systems and objects.

EnterpriseT1222File and Directory Permissions Modification

Applying more restrictive permissions to files and directories could prevent adversaries from modifying their access control lists. Additionally, ensure that user settings regarding local and remote symbolic links are properly set or disabled where unneeded.[3]

.001Windows File and Directory Permissions Modification

Applying more restrictive permissions to files and directories could prevent adversaries from modifying the access control lists.

.002Linux and Mac File and Directory Permissions Modification

Applying more restrictive permissions to files and directories could prevent adversaries from modifying the access control lists.

EnterpriseT1564.004Hide Artifacts:NTFS File Attributes

Consider adjusting read and write permissions for NTFS EA, though this should be tested to ensure routine OS operations are not impeded.[4]

EnterpriseT1574Hijack Execution Flow

Install software in write-protected locations. Set directory access controls to prevent file writes to the search paths for applications, both in the folders where applications are run from and the standard library folders.

.004Dylib Hijacking

Set directory access controls to prevent file writes to the search paths for applications, both in the folders where applications are run from and the standard dylib folders.

.007Path Interception by PATH Environment Variable

Ensure that proper permissions and directory access control are set to deny users the ability to write files to the top-level directoryC: and system directories, such asC:\Windows\, to reduce places where malicious files could be placed for execution. Require that all executables be placed in write-protected directories.

.008Path Interception by Search Order Hijacking

Ensure that proper permissions and directory access control are set to deny users the ability to write files to the top-level directoryC: and system directories, such asC:\Windows\, to reduce places where malicious files could be placed for execution. Require that all executables be placed in write-protected directories.

.009Path Interception by Unquoted Path

Ensure that proper permissions and directory access control are set to deny users the ability to write files to the top-level directoryC: and system directories, such asC:\Windows\, to reduce places where malicious files could be placed for execution. Require that all executables be placed in write-protected directories.

.014AppDomainManager

Install .NET applications and related software in write-protected locations. Set directory access controls to prevent file writes to the search paths for .NET applications, both in the folders where applications are run from and the standard resources folders.

EnterpriseT1562Impair Defenses

Ensure proper process and file permissions are in place to prevent adversaries from disabling or interfering with security/logging services.

.001Disable or Modify Tools

Ensure proper process and file permissions are in place to prevent adversaries from disabling or interfering with security services.

.002Disable Windows Event Logging

Ensure proper process and file permissions are in place to prevent adversaries from disabling or interfering with logging or deleting or modifying .evtx logging files. Ensure .evtx files, which are located atC:\Windows\system32\Winevt\Logs[5], have the proper file permissions for limited, legitimate access and audit policies for detection.

.004Disable or Modify System Firewall

Ensure proper process and file permissions are in place to prevent adversaries from disabling or modifying firewall settings.

.006Indicator Blocking

Ensure event tracers/forwarders[6], firewall policies, and other associated mechanisms are secured with appropriate permissions and access controls.

EnterpriseT1070Indicator Removal

Protect generated event files that are stored locally with proper permissions and authentication and limit opportunities for adversaries to increase privileges by preventing Privilege Escalation opportunities.

.001Clear Windows Event Logs

Protect generated event files that are stored locally with proper permissions and authentication and limit opportunities for adversaries to increase privileges by preventing Privilege Escalation opportunities.

.002Clear Linux or Mac System Logs

Protect generated event files that are stored locally with proper permissions and authentication and limit opportunities for adversaries to increase privileges by preventing Privilege Escalation opportunities.

.003Clear Command History

Preventing users from deleting or writing to certain files can stop adversaries from maliciously altering their~/.bash_history orConsoleHost_history.txt files.

.008Clear Mailbox Data

Protect generated event files that are stored locally with proper permissions and authentication and limit opportunities for adversaries to increase privileges by preventing Privilege Escalation opportunities.

.009Clear Persistence

Protect generated event files that are stored locally with proper permissions and authentication and limit opportunities for adversaries to increase privileges by preventing Privilege Escalation opportunities.

EnterpriseT1036Masquerading

Use file system access controls to protect folders such as C:\Windows\System32.

.003Rename Legitimate Utilities

Use file system access controls to protect folders such asC:\Windows\System32.

.005Match Legitimate Resource Name or Location

Use file system access controls to protect folders such asC:\Windows\System32.

EnterpriseT1556Modify Authentication Process

Restrict write access to the/Library/Security/SecurityAgentPlugins directory.

EnterpriseT1055.009Process Injection:Proc Memory

Restrict the permissions on sensitive files such as/proc/[pid]/maps or/proc/[pid]/mem.

EnterpriseT1563.001Remote Service Session Hijacking:SSH Hijacking

Ensure proper file permissions are set and harden system to prevent root privilege escalation opportunities.

EnterpriseT1053Scheduled Task/Job

Restrict access by setting directory and file permissions that are not specific to users or privileged accounts.

.006Systemd Timers

Restrict read/write access to systemd.timer unit files to only select privileged users who have a legitimate need to manage system services.

EnterpriseT1489Service Stop

Ensure proper process and file permissions are in place to inhibit adversaries from disabling or interfering with critical services.

EnterpriseT1553.003Subvert Trust Controls:SIP and Trust Provider Hijacking

Restrict storage and execution of SIP DLLs to protected directories, such as C:\Windows, rather than user directories.

EnterpriseT1218.002System Binary Proxy Execution:Control Panel

Restrict storage and execution of Control Panel items to protected directories, such asC:\Windows, rather than user directories.

EnterpriseT1569System Services

Ensure that high permission level service binaries cannot be replaced or modified by users with a lower permission level.

.002Service Execution

Ensure that high permission level service binaries cannot be replaced or modified by users with a lower permission level.

EnterpriseT1080Taint Shared Content

Protect shared folders by minimizing users who have write access.

EnterpriseT1552Unsecured Credentials

Restrict file shares to specific directories with access only to necessary users.

.001Credentials In Files

Restrict file shares to specific directories with access only to necessary users.

.004Private Keys

Ensure permissions are properly set on folders containing sensitive private keys to prevent unintended access. Additionally, on Cisco devices, set thenonexportable flag during RSA key pair generation.[7]

References

×

[8]ページ先頭

©2009-2026 Movatter.jp