Merge branch 'master' into patch-9

This commit is contained in:
Liz Rice 2019-05-30 12:14:34 +02:00 committed by GitHub
commit 6b0b012425
Failed to generate hash of commit
2 changed files with 4 additions and 3 deletions

View file

@ -262,7 +262,7 @@ groups:
audit: "mount | grep /tmp"
tests:
test_items:
- flag: "tmpfs on /tmp type tmpfs "
- flag: "tmpfs on /tmp type tmpfs"
set: true
remediation: |
For new installations, during installation create a custom partition setup and specify a separate partition for `/tmp` .

View file

@ -102,13 +102,14 @@ func GetLSM() (lsm string, err error) {
}
func getPlatformVersion(output, platform string) string {
flagRe := regexp.MustCompile("version_id" + `=([^ \n]*)`)
flagRe := regexp.MustCompile(`version[_id]*=([^ \n]*)`)
vals := flagRe.FindStringSubmatch(output)
if len(vals) > 1 {
switch platform {
case "rhel":
return vals[1][:1] // Get the major version only, examaple: 7.6 will return 7
case "ubuntu":
return vals[1][:2] // Get the major version only, examaple: 18.04 will return 18
default:
return ""
}