Skip to content

Use symbolic permissions in Ansible code#858

Merged
mcdonnnj merged 14 commits intodevelopfrom
improvement/do_not_use_implicit_permissions_in_ansible
May 22, 2025
Merged

Use symbolic permissions in Ansible code#858
mcdonnnj merged 14 commits intodevelopfrom
improvement/do_not_use_implicit_permissions_in_ansible

Conversation

@mcdonnnj
Copy link
Member

🗣 Description

This pull request replaces all uses of implicit permission (octal permissions representation) with symbolic permissions.

💭 Motivation and context

In addition to being easier to read this will also be required by the linter changes in #856. Since there is nothing stopping us from doing it "in advance" and due to the amount of Ansible code that lives in this repository I thought it would be helpful to break the change out into its own pull request.

🧪 Testing

Automated tests pass. I verified that no implicit permissions remain with

$ grep -rnE ': 0[0-7]{3}'

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All new and existing tests pass.

@mcdonnnj mcdonnnj requested review from a team and Copilot May 21, 2025 22:43
@mcdonnnj mcdonnnj self-assigned this May 21, 2025
@mcdonnnj mcdonnnj requested review from dav3r, felddy and jsf9k as code owners May 21, 2025 22:43
@mcdonnnj mcdonnnj added the improvement This issue or pull request will add or improve functionality, maintainability, or ease of use label May 21, 2025
@mcdonnnj mcdonnnj added the ansible Pull requests that update Ansible code label May 21, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR replaces all octal permission specifications with their symbolic equivalents across Ansible playbooks, roles, and Packer provisioning tasks to improve readability and comply with upcoming linter checks.

  • Replaced numeric mode: values with symbolic permission strings in various Ansible tasks.
  • Updated Packer provisioning playbooks similarly for consistency.
  • Ensured no implicit octal permissions remain according to the grep check.

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packer/ansible/create_cyhy_user.yml Replaced octal mode with symbolic permissions
packer/ansible/create_credentials_directory.yml Replaced octal mode with symbolic permissions
ansible/roles/swap/tasks/main.yml Replaced octal mode with symbolic permissions
ansible/roles/orchestrator/tasks/main.yml Replaced octal mode with symbolic permissions
ansible/roles/nessus/tasks/main.yml Replaced octal mode with symbolic permissions
ansible/roles/mongo/tasks/main.yml Replaced octal mode with symbolic permissions
ansible/roles/mgmt_ops/tasks/main.yml Replaced octal mode with symbolic permissions
ansible/roles/cyhy_reporter/tasks/main.yml Replaced octal mode with symbolic permissions
ansible/roles/cyhy_ops/tasks/main.yml Replaced octal mode with symbolic permissions
ansible/roles/cyhy_mailer/tasks/main.yml Replaced octal mode with symbolic permissions
ansible/roles/cyhy_feeds/tasks/main.yml Replaced octal mode with symbolic permissions
ansible/roles/cyhy_dashboard/tasks/main.yml Replaced octal mode with symbolic permissions
ansible/roles/cyhy_commander/tasks/main.yml Replaced octal mode with symbolic permissions
ansible/roles/cyhy_archive/tasks/main.yml Replaced octal mode with symbolic permissions
ansible/roles/code_gov_update/tasks/main.yml Replaced octal mode with symbolic permissions

Copy link
Member

@jsf9k jsf9k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So proactive!

@mcdonnnj mcdonnnj added this pull request to the merge queue May 22, 2025
Merged via the queue into develop with commit bf68759 May 22, 2025
9 checks passed
@mcdonnnj mcdonnnj deleted the improvement/do_not_use_implicit_permissions_in_ansible branch May 22, 2025 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ansible Pull requests that update Ansible code improvement This issue or pull request will add or improve functionality, maintainability, or ease of use

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants