-
Notifications
You must be signed in to change notification settings - Fork 786
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
Add option to run as a certain user on the Run Monkey page #838
Add option to run as a certain user on the Run Monkey page #838
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #838 +/- ##
========================================
Coverage 60.58% 60.58%
========================================
Files 166 166
Lines 4955 4955
========================================
Hits 3002 3002
Misses 1953 1953 Continue to review full report at Codecov.
|
Nice! It should be easy to backmerge to my latest changes, but if you run into any trouble, let me know. Also, why do we need the checkmark if it works fine with empty field? I don't think we need it, just inform that running as specific user is optional, but let's talk with @itaymmguardicore |
@VakarisZ, backmerged. Love the refactoring you did! :) @itaymmguardicore, what do you think about the checkbox? |
monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/commands/local_linux_curl.js
Outdated
Show resolved
Hide resolved
monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/commands/local_windows_cmd.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some issues which must be resolved. Powershell doesn't work with runas
and on linux it's better to use su
than runuser
monkey/monkey_island/cc/ui/src/components/pages/RunMonkeyPage/commands/local_linux_curl.js
Outdated
Show resolved
Hide resolved
38b7bba
to
d885324
Compare
.../monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunManually/LocalManualRunOptions.js
Outdated
Show resolved
Hide resolved
.../monkey_island/cc/ui/src/components/pages/RunMonkeyPage/RunManually/LocalManualRunOptions.js
Show resolved
Hide resolved
5cd022d
to
0f45837
Compare
if (username != '') | ||
command = `su - ${username} -c "${command}"`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use curly-braces for ifs. Easier to extend and read, even if it's a single sentence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this is a code duplication with other linux run method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved. Optional things to improve is: 1. reduce duplication between commands. 2. add curly braces around single sentence ifs
0f45837
to
55dae3f
Compare
Fixes #830
UPDATE:
Added checkbox for "Run as user"