Skip to content

Instantly share code, notes, and snippets.

@ferventcoder
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ferventcoder/4bfb2865a8dec14e0ae7 to your computer and use it in GitHub Desktop.
Save ferventcoder/4bfb2865a8dec14e0ae7 to your computer and use it in GitHub Desktop.
Managing Permissions on Windows Blog Post
acl { 'c:/temp':
permissions => [
{ identity => 'Administrator', rights => ['full'] },
{ identity => 'Users', rights => ['read','execute'] }
],
}
acl { 'c:/temp':
target => 'c:/temp',
target_type => 'file',
purge => 'false',
permissions => [
{ identity => 'Administrator', rights => ['full'], type=> 'allow', child_types => 'all', affects => 'all' },
{ identity => 'Users', rights => ['read','execute'], type=> 'allow', child_types => 'all', affects => 'all' }
],
owner => 'Administrators',
group => 'Users',
inherit_parent_permissions => 'true',
}
acl { 'c:/sensitive_data':
purge => true,
inherit_parent_permissions => false,
permissions => [
{ identity => 'Administrators', rights => ['full'] }
],
}
$website_location = 'C:\sites\thestuff'
$website_name = 'the.stuff'
$website_port = '80'
# add windows features
windowsfeature { 'Web-WebServer':
installmanagementtools => true,
} ->
windowsfeature { 'Web-Asp-Net45':
} ->
# remove default web site
iis::manage_site { 'Default Web Site':
ensure => absent,
site_path => 'any',
app_pool => 'DefaultAppPool',
} ->
# application in iis
iis::manage_app_pool { "${website_name}":
enable_32_bit => true,
managed_runtime_version => 'v4.0',
} ->
iis::manage_site { "${website_name}":
site_path => $website_location,
port => "${website_port}",
ip_address => '*',
app_pool => "${website_name}",
} ->
# lock down web directory
acl { "${website_location}":
purge => true,
inherit_parent_permissions => false,
permissions => [
{ identity => 'Administrators', rights => ['full'] },
{ identity => 'IIS_IUSRS', rights => ['read'] },
{ identity => 'IUSR', rights => ['read'] },
{ identity => "IIS APPPOOL\\${website_name}", rights => ['read'] }
],
} ->
acl { "${website_location}/App_Data":
permissions => [
{ identity => "IIS APPPOOL\\${website_name}", rights => ['modify'] },
{ identity => 'IIS_IUSRS', rights => ['modify'] }
],
}
acl { 'c:/granular_permissions':
permissions => [
{ identity => 'Administrators', rights => ['full'] },
{ identity => 'Bob', rights => ['mask_specific'], mask => '1507839' }
],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment