security

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnforceFilePermissions

func EnforceFilePermissions(path string, mode os.FileMode) error

EnforceFilePermissions sets path to the given mode via os.Chmod. Returns an error if the file does not exist or chmod fails.

Types

type PermissionFinding

type PermissionFinding struct {
	Path         string
	CurrentMode  os.FileMode
	RequiredMode os.FileMode
	Reason       string
}

PermissionFinding describes a file whose current permissions differ from what the security policy requires.

func AuditProjectPermissions

func AuditProjectPermissions(projectDir string) ([]PermissionFinding, error)

AuditProjectPermissions walks projectDir and checks each file against the sensitivePatterns map. Files whose current mode is more permissive than required are reported as PermissionFinding values.

Directories are skipped; only regular files are evaluated.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL