Merge pull request #1299 from guardicore/delimiter-windows-certificate

island: Add delimiter to windows create_certificate
This commit is contained in:
Mike Salvatore 2021-07-06 09:23:30 -04:00 committed by GitHub
commit b17b85d7e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -20,13 +20,13 @@ copy "%mydir%windows\openssl.cfg" "%mydir%bin\openssl\openssl.cfg"
:: Change file permissions :: Change file permissions
SET adminsIdentity="BUILTIN\Administrators" SET adminsIdentity="BUILTIN\Administrators"
FOR /f %%O IN ('whoami') DO SET ownIdentity=%%O FOR /f "delims=''" %%O IN ('whoami') DO SET ownIdentity=%%O
FOR %%F IN ("%mydir%cc\server.key", "%mydir%cc\server.csr", "%mydir%cc\server.crt") DO ( FOR %%F IN ("%mydir%cc\server.key", "%mydir%cc\server.csr", "%mydir%cc\server.crt") DO (
:: Remove all others and add admins rule (with full control) :: Remove all others and add admins rule (with full control)
echo y| cacls %%F" /p %adminsIdentity%:F echo y| cacls %%F /p %adminsIdentity%:F
:: Add user rule (with read) :: Add user rule (with read)
echo y| cacls %%F /e /p %ownIdentity%:R echo y| cacls %%F /e /p "%ownIdentity%":R
) )