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

Agent IP addresses #48

Merged
merged 5 commits into from
Mar 9, 2021
Merged

Agent IP addresses #48

merged 5 commits into from
Mar 9, 2021

Conversation

raviserota
Copy link
Contributor

… the host.

Copy link
Contributor

@mchan143 mchan143 left a comment

Choose a reason for hiding this comment

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

Looks solid overall, just a note about some code repetition that seems present with getHostIPAddrs(). If it's possible to lift them out as a utility function instead, I think it'd be cleaner.

agent/agent_util.go Outdated Show resolved Hide resolved
}
return ipAddrs, nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks pretty similar to getLocalIPv4Addresses() in proxy_receiver_http.go, do you think you can lift both out to reduce code repetition?
Possible untested solution: move getLocalIPv4Addresses() from proxy_receiver_http.go to proxy_util.go, update the function call in getReachableUrls() to just GetLocalIPv4Addresses(), then call proxy.GetLocalIPv4Addresses() in agent.go.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. I didn't know about that code. I'll try and pull it out, probably add it to agent_util.go since its functionality would be used outside of proxy.

@raviserota raviserota changed the title Modfied agent to retrieve a list of non-loopback IPv4 addresses up on… Agent IP addresses Mar 3, 2021
Copy link

@unkempthenry unkempthenry left a comment

Choose a reason for hiding this comment

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

note: depends on mitre/caldera#2056

@unkempthenry unkempthenry assigned wbooth and unassigned unkempthenry Mar 4, 2021
@wbooth wbooth merged commit 5b0d43c into master Mar 9, 2021
@wbooth wbooth deleted the virts-1801-agent-ip-addresses branch March 9, 2021 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants