Skip to content

Commit

Permalink
AWS AppSec Finding: Default CloudWatch Agent Configuration Not Optimi…
Browse files Browse the repository at this point in the history
…zed for Security (#950)
  • Loading branch information
bhanuba authored Nov 9, 2023
1 parent e72dba6 commit 1ce2478
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tool/processors/agentconfig/agentConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func whichRunAsUser(ctx *runtime.Context, config *data.Config) {

answer := util.Choice("Which user are you planning to run the agent?",
1,
[]string{RUNASUSER_ROOT, RUNASUSER_CWAGENT, RUNASUSER_OTHERS})
[]string{RUNASUSER_CWAGENT, RUNASUSER_ROOT, RUNASUSER_OTHERS})

if answer == RUNASUSER_OTHERS {
answer = util.Ask("Please specify your own user(remember the user must exist before the agent running):")
Expand Down
6 changes: 3 additions & 3 deletions tool/processors/agentconfig/agentConfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ func TestProcessor_Process(t *testing.T) {

testutil.Type(inputChan, "")
Processor.Process(ctx, conf)
assert.Equal(t, RUNASUSER_ROOT, conf.AgentConfig.Runasuser)
assert.Equal(t, RUNASUSER_CWAGENT, conf.AgentConfig.Runasuser)

testutil.Type(inputChan, "1")
Processor.Process(ctx, conf)
assert.Equal(t, RUNASUSER_ROOT, conf.AgentConfig.Runasuser)
assert.Equal(t, RUNASUSER_CWAGENT, conf.AgentConfig.Runasuser)

testutil.Type(inputChan, "2")
Processor.Process(ctx, conf)
assert.Equal(t, RUNASUSER_CWAGENT, conf.AgentConfig.Runasuser)
assert.Equal(t, RUNASUSER_ROOT, conf.AgentConfig.Runasuser)

testutil.Type(inputChan, "3", "testuser")
Processor.Process(ctx, conf)
Expand Down

0 comments on commit 1ce2478

Please sign in to comment.