Difference between revisions of "Securing Truxton Services"
| Line 59: | Line 59: | ||
* [https://web.archive.org/web/20200719210404/https://support.microsoft.com/en-us/help/914392/best-practices-and-guidance-for-writers-of-service-discretionary-acces Microsoft Guidlines] | * [https://web.archive.org/web/20200719210404/https://support.microsoft.com/en-us/help/914392/best-practices-and-guidance-for-writers-of-service-discretionary-acces Microsoft Guidlines] | ||
* [https://web.archive.org/web/20150810083345/http://networkadminkb.com/KB/a152/how-to-read-a-sddl-string.aspx How to Read SDDL] | * [https://web.archive.org/web/20150810083345/http://networkadminkb.com/KB/a152/how-to-read-a-sddl-string.aspx How to Read SDDL] | ||
| + | |||
| + | =PostgreSQL Logon without MD5= | ||
| + | By default, [https://www.postgresql.org/ PostgreSQL] uses the [https://en.wikipedia.org/wiki/MD5 MD5] hashing algorithm for password authentication. | ||
| + | The problem is MD5 is no longer approved for use in [https://csrc.nist.gov/publications/detail/fips/140/3/final FIPS] certified systems. | ||
| + | Luckily, PostgreSQL will allow you to use a different method called [https://tools.ietf.org/html/rfc7677 SCRAM] which uses [https://en.wikipedia.org/wiki/SHA-2 SHA-256] as the algorithm for hashing passwords. | ||
| + | |||
| + | Now you are left with a bit of a [https://en.wikipedia.org/wiki/Chicken_or_the_egg chicken-or-the-egg] situation. | ||
| + | If you change the algorithm to SCRAM then you can't log on with the MD5 stored in the database. | ||
| + | The trick to successfully switching to SCRAM from MD5 is to tell PostgreSQL to use SCRAM to obfuscate all '''new''' passwords while logged in with MD5. | ||
| + | The steps are as follows: | ||
| + | |||
| + | # Install PostgreSQL Server | ||
| + | # | ||
| + | |||
| + | ==External links== | ||
| + | * [https://blog.dbi-services.com/migrating-your-users-from-md5-to-scram-authentication-in-postgresql/ Steps] | ||
Revision as of 22:05, 4 May 2021
If you must operate in a more "locked down" mode, FISMA for instance, you must change how Truxton's services run.
Contents
How Secure Truxton Services
To find out what the permissions are for a service, use the sc sdshow command:
sc sdshow Les
sc sdshow Truxton
sc sdshow TruxtonDatabaseOn my machine, it produces this lovely string:
D:(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BU)(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)
You can use the Powershell ConvertFrom-SddlString command to convert it to something humanly readable.
ConvertFrom-SddlString -Sddl "D:(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BU)(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)" | Foreach-Object {$_.DiscretionaryAcl}
A better way to begin to understand it is by adding spaces and line breaks:
D: (A;;CC DC LC SW RP WP DT LO CR SD RC WD WO;;;BU) (A;;CC LC SW RP WP DT LO CR RC;;;SY) (A;;CC DC LC SW RP WP DT LO CR SD RC WD WO;;;BA) (A;;CC LC SW LO CR RC;;;IU) (A;;CC LC SW LO CR RC;;;SU)
The most common permissions to alter are DC, WD and WO.
| Code | Meaning |
|---|---|
| DC | Change Configuration (aka Write Data) |
| WD | Change Permissions (aka Write Descriptor) |
| WO | Take Ownership (aka Write Owner) |
It looks like the BuiltIn Users is the culprit. Let's change the BU part to get rid of those:
(A;;CC LC SW RP WP DT LO CR SD RC;;;BU)
Start a command prompt as Administrator then:
sc sdset Les D:(A;;CCLCSWRPWPDTLOCRSDRC;;;BU)(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)
sc sdset Truxton D:(A;;CCLCSWRPWPDTLOCRSDRC;;;BU)(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)
sc sdset TruxtonDatabase D:(A;;CCLCSWRPWPDTLOCRSDRC;;;BU)(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)
External links
PostgreSQL Logon without MD5
By default, PostgreSQL uses the MD5 hashing algorithm for password authentication. The problem is MD5 is no longer approved for use in FIPS certified systems. Luckily, PostgreSQL will allow you to use a different method called SCRAM which uses SHA-256 as the algorithm for hashing passwords.
Now you are left with a bit of a chicken-or-the-egg situation. If you change the algorithm to SCRAM then you can't log on with the MD5 stored in the database. The trick to successfully switching to SCRAM from MD5 is to tell PostgreSQL to use SCRAM to obfuscate all new passwords while logged in with MD5. The steps are as follows:
- Install PostgreSQL Server