← All recipes
Moderne licensed

Use restrictive file permissions

Recipe IDorg.openrewrite.golang.codequality.UseRestrictiveFilePermissionsArtifactgithub.com/moderneinc/recipes-go

Replace 0777 with 0755 in os.Chmod, os.MkdirAll and os.Mkdir, and with 0644 in os.WriteFile. Overly permissive file permissions are a security risk.

Single recipeProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.golang.codequality.UseRestrictiveFilePermissions

If the recipe isn’t available locally, install it with:

mod config recipes go install github.com/moderneinc/recipes-go