# README
apollo
🤖 An automated Linux system administration suite
✨ Installation
go get github.com/safinsingh/apollo
👨💻 Author
Linkedin: Safin Singh
GitHub: safinsingh
Dribbble: Safin Singh
YouTube: Safin Singh
🤝 Contributing
Contributions, PRs, issues and feature requests are welcome! Feel free to check out my issues page.
❤️ Show your support
Give a ⭐️ if this project helped you! Hope you enjoy it!
# Functions
AddAuthSudoer adds an authorized sudoer and suppresses its output.
AddAuthUser adds an authorized user and suppresses its output.
AddPkgs loops through a slice of packages and installs them.
BinBash sets a user's shell to /bin/bash.
BinFalse sets a user's shell to /bin/false.
CleanSplitSlice returns a cleaned up (no empty element) slice from a string and a delimiter.
Config configures a certain policy in a given file.
CopyConfig copies the content of a file and writes it to another.
ExpandSliceAtDelim is a utility function used to expands a slice to a string with a certain delimiter.
FailPrint prints a failing message.
FileExists returns a boolean containing whether the file exists or not.
FindStrInSlice returns whether any element in a slice is equal to a string.
GetFileName returns the name of a file from its absolute path.
GetGroup captures the /etc/group file.
GetIptables captures the iptables config.
GetLsof captures the result of lsof -i.
GetManual returns a slice with the manually installed packages on the system (assuming /var/log/installer/initial-status.gz is not compromised).
GetNetstat captures the output of netstat.
GetNonDef returns the non-default users on the system (UBU16 only).
GetPasswd captures the /etc/passwd file.
GetShadow captures the /etc/shadow file.
HandleErr is a global error handler for apollo.
InfoPrint prints a informative message.
ParseUsers parses a JSON file containing user definitions into an array of User.
ReadFileNoCmt reads a file and eliminates empty or commented out lines and returns a slice with the lines.
RemovePkgs loops through a slice of packages and purges them.
RemUnauthSudoer removes an authorized sudoer and suppresses its output.
RootCheck checks if an executable is being run as root.
SafeCopyConfig safely merges two configuration files with Config.
ShellCmd executes a bash command.
ShellCmdCapture executes a bash command and captures its output.
SuccessPrint prints a success message.
UserJSONToNames returns a slice of usernames from an array of Users.
WarnPrint prints a warning message.
WriteToBaseDir is a wrapper around ioutil.WriteFile that writes files to a baseline directory.