mirror of
				https://github.com/docker/docker-bench-security.git
				synced 2025-11-04 02:58:59 +00:00 
			
		
		
		
	use stat to verify permissions
Signed-off-by: Thomas Sjögren <konstruktoid@users.noreply.github.com>
This commit is contained in:
		
					parent
					
						
							
								f81bc4d6d2
							
						
					
				
			
			
				commit
				
					
						001811bf87
					
				
			
		
					 1 changed files with 1 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -402,8 +402,7 @@ fi
 | 
			
		|||
check_3_26="3.26 - Verify that Docker socket file permissions are set to 660"
 | 
			
		||||
file="/var/run/docker.sock"
 | 
			
		||||
if [ -S "$file" ]; then
 | 
			
		||||
  perms=$(ls -ld "$file" | awk '{print $1}')
 | 
			
		||||
  if [ "$perms" = "srw-rw----" ]; then
 | 
			
		||||
  if [ "$(stat -c %a $file)" -eq 660 ]; then
 | 
			
		||||
    pass "$check_3_26"
 | 
			
		||||
  else
 | 
			
		||||
    warn "$check_3_26"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue