mirror of
https://github.com/cliffe/SecGen.git
synced 2026-02-20 13:50:45 +00:00
SecGen function: add directory (creates directory + any parent directories using mkdir -p)
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
define secgen_functions::create_directory($path){
|
||||
exec { "secgen_create_directory_$path":
|
||||
path => '/bin:/sbin:/usr/bin:/usr/sbin',
|
||||
command => "mkdir -p $path"
|
||||
}
|
||||
}
|
||||
@@ -41,9 +41,9 @@ define secgen_functions::install_setgid_binary (
|
||||
}
|
||||
|
||||
# Create challenge directory
|
||||
file { "create_$challenge_directory":
|
||||
::secgen_functions::create_directory { "create_$challenge_directory":
|
||||
path => $challenge_directory,
|
||||
ensure => directory,
|
||||
notify => File["create_$compile_directory"],
|
||||
}
|
||||
|
||||
# Move contents of the module's files directory into compile directory
|
||||
@@ -58,7 +58,7 @@ define secgen_functions::install_setgid_binary (
|
||||
exec { "gcc_$challenge_name-$compile_directory":
|
||||
cwd => $compile_directory,
|
||||
command => "/usr/bin/make",
|
||||
require => File["create_$challenge_directory", "create_$compile_directory"]
|
||||
require => File["create_$compile_directory"]
|
||||
}
|
||||
|
||||
# Move the compiled binary into the challenge directory
|
||||
|
||||
@@ -39,9 +39,9 @@ define secgen_functions::install_setuid_root_binary (
|
||||
$modules_source = "puppet:///modules/$source_module_name"
|
||||
|
||||
# Create challenge directory
|
||||
file { "create_$challenge_directory":
|
||||
::secgen_functions::create_directory { "create_$challenge_directory":
|
||||
path => $challenge_directory,
|
||||
ensure => directory,
|
||||
notify => File["create_$compile_directory"],
|
||||
}
|
||||
|
||||
# Move contents of the module's files directory into compile directory
|
||||
@@ -56,7 +56,7 @@ define secgen_functions::install_setuid_root_binary (
|
||||
exec { "gcc_$challenge_name-$compile_directory":
|
||||
cwd => $compile_directory,
|
||||
command => "/usr/bin/make",
|
||||
require => [File["create_$challenge_directory", "create_$compile_directory"], Package['build-essential', 'gcc-multilib']]
|
||||
require => [File["create_$compile_directory"], Package['build-essential', 'gcc-multilib']]
|
||||
}
|
||||
|
||||
# Move the compiled binary into the challenge directory
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
<system_name>group_challenges</system_name>
|
||||
<base platform="linux" type="server"/>
|
||||
|
||||
<!--TODO: use same pattern for all type=".*pwnable_binary" -->
|
||||
|
||||
<!-- 1) Default uses an account and drops the binary in the users home directory -->
|
||||
<vulnerability type="pwnable_binary">
|
||||
<input into="group">
|
||||
@@ -27,7 +25,7 @@
|
||||
<!--<value/>-->
|
||||
<!--</input>-->
|
||||
<!--<input into="storage_directory">-->
|
||||
<!--<value>/home</value>-->
|
||||
<!--<value>/test/hidden/challenges</value>-->
|
||||
<!--</input>-->
|
||||
<!--</vulnerability>-->
|
||||
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
<system_name>reverse_me</system_name>
|
||||
<base platform="linux" type="server"/>
|
||||
|
||||
<!--TODO: use same pattern for all type=".*pwnable_binary" -->
|
||||
|
||||
<!-- 1) Default uses an account and drops the binary in the users home directory
|
||||
(username/pw: challenges/password) -->
|
||||
<vulnerability type="pwnable_binary"/>
|
||||
@@ -21,7 +19,7 @@
|
||||
<!--<value/>-->
|
||||
<!--</input>-->
|
||||
<!--<input into="storage_directory">-->
|
||||
<!--<value>/home</value>-->
|
||||
<!--<value>/test/hidden/challenges</value>-->
|
||||
<!--</input>-->
|
||||
<!--</vulnerability>-->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user