From c012b2026d4908e8533e6d3c3d8b89d36b11f168 Mon Sep 17 00:00:00 2001 From: Dan Fedele Date: Mon, 12 Jun 2023 16:48:51 -0400 Subject: Now using ansible roles. also removed linpeass --- roles/package-mgmt/README.md | 38 ++++++++++++++++++ roles/package-mgmt/defaults/main.yml | 2 + roles/package-mgmt/handlers/main.yml | 2 + roles/package-mgmt/meta/main.yml | 52 ++++++++++++++++++++++++ roles/package-mgmt/tasks/main.yml | 76 ++++++++++++++++++++++++++++++++++++ roles/package-mgmt/tests/inventory | 2 + roles/package-mgmt/tests/test.yml | 5 +++ roles/package-mgmt/vars/main.yml | 6 +++ 8 files changed, 183 insertions(+) create mode 100644 roles/package-mgmt/README.md create mode 100644 roles/package-mgmt/defaults/main.yml create mode 100644 roles/package-mgmt/handlers/main.yml create mode 100644 roles/package-mgmt/meta/main.yml create mode 100644 roles/package-mgmt/tasks/main.yml create mode 100644 roles/package-mgmt/tests/inventory create mode 100644 roles/package-mgmt/tests/test.yml create mode 100644 roles/package-mgmt/vars/main.yml (limited to 'roles/package-mgmt') diff --git a/roles/package-mgmt/README.md b/roles/package-mgmt/README.md new file mode 100644 index 0000000..225dd44 --- /dev/null +++ b/roles/package-mgmt/README.md @@ -0,0 +1,38 @@ +Role Name +========= + +A brief description of the role goes here. + +Requirements +------------ + +Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. + +Role Variables +-------------- + +A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. + +Dependencies +------------ + +A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. + +Example Playbook +---------------- + +Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: + + - hosts: servers + roles: + - { role: username.rolename, x: 42 } + +License +------- + +BSD + +Author Information +------------------ + +An optional section for the role authors to include contact information, or a website (HTML is not allowed). diff --git a/roles/package-mgmt/defaults/main.yml b/roles/package-mgmt/defaults/main.yml new file mode 100644 index 0000000..57adef2 --- /dev/null +++ b/roles/package-mgmt/defaults/main.yml @@ -0,0 +1,2 @@ +--- +# defaults file for package-mgmt diff --git a/roles/package-mgmt/handlers/main.yml b/roles/package-mgmt/handlers/main.yml new file mode 100644 index 0000000..ef24490 --- /dev/null +++ b/roles/package-mgmt/handlers/main.yml @@ -0,0 +1,2 @@ +--- +# handlers file for package-mgmt diff --git a/roles/package-mgmt/meta/main.yml b/roles/package-mgmt/meta/main.yml new file mode 100644 index 0000000..c572acc --- /dev/null +++ b/roles/package-mgmt/meta/main.yml @@ -0,0 +1,52 @@ +galaxy_info: + author: your name + description: your role description + company: your company (optional) + + # If the issue tracker for your role is not on github, uncomment the + # next line and provide a value + # issue_tracker_url: http://example.com/issue/tracker + + # Choose a valid license ID from https://spdx.org - some suggested licenses: + # - BSD-3-Clause (default) + # - MIT + # - GPL-2.0-or-later + # - GPL-3.0-only + # - Apache-2.0 + # - CC-BY-4.0 + license: license (GPL-2.0-or-later, MIT, etc) + + min_ansible_version: 2.1 + + # If this a Container Enabled role, provide the minimum Ansible Container version. + # min_ansible_container_version: + + # + # Provide a list of supported platforms, and for each platform a list of versions. + # If you don't wish to enumerate all versions for a particular platform, use 'all'. + # To view available platforms and versions (or releases), visit: + # https://galaxy.ansible.com/api/v1/platforms/ + # + # platforms: + # - name: Fedora + # versions: + # - all + # - 25 + # - name: SomePlatform + # versions: + # - all + # - 1.0 + # - 7 + # - 99.99 + + galaxy_tags: [] + # List tags for your role here, one per line. A tag is a keyword that describes + # and categorizes the role. Users find roles by searching for tags. Be sure to + # remove the '[]' above, if you add tags to this list. + # + # NOTE: A tag is limited to a single word comprised of alphanumeric characters. + # Maximum 20 tags per role. + +dependencies: [] + # List your role dependencies here, one per line. Be sure to remove the '[]' above, + # if you add dependencies to this list. diff --git a/roles/package-mgmt/tasks/main.yml b/roles/package-mgmt/tasks/main.yml new file mode 100644 index 0000000..2b6360e --- /dev/null +++ b/roles/package-mgmt/tasks/main.yml @@ -0,0 +1,76 @@ +--- +# tasks file for package-mgmt +- name: Add Docker repo key + ansible.builtin.shell: curl -fsSL {{ docker_repo_key }} | gpg --dearmor --batch --yes -o /etc/apt/trusted.gpg.d/docker-ce-keyring.gpg + +- name: Add Docker repo + ansible.builtin.apt_repository: + repo: "{{ docker_repo }}" + state: present + +- name: Add Sublime Text repo + ansible.builtin.apt_repository: + repo: "{{ sublime_repo }}" + state: present + +- name: Ensuring all packages are up to date + ansible.builtin.apt: + update_cache: yes + upgrade: dist + +- name: Installing one-off packages from package manager + ansible.builtin.package: + name: + - bloodhound + - build-essential + - bytecode-viewer + - clang + - cmake + - crackmapexec + - curl + - default-jdk + - default-jre + - docker + - docker-compose + - eog + - feroxbuster + - flex + - forensics-extra + - gawk + - gdb + - gdbserver + - ghidra + - git + - gobuster + - golang-go + - jq + - jxplorer + - libffi-dev + - liblzma-dev + - libssl-dev + - libxml2-dev + - ltrace + - ncat + - neo4j + - ntpdate + - mingw-w64 + - patch + - powershell + - python3 + - python3-dev + - python3-pip + - p7zip-full + - remmina + - rlwrap + - samba + - seclists + - steghide + - strace + - sublime-text + - terminator + - tmux + - xclip + - xfce4-terminal + - zaproxy + - zlib1g-dev + state: latest diff --git a/roles/package-mgmt/tests/inventory b/roles/package-mgmt/tests/inventory new file mode 100644 index 0000000..878877b --- /dev/null +++ b/roles/package-mgmt/tests/inventory @@ -0,0 +1,2 @@ +localhost + diff --git a/roles/package-mgmt/tests/test.yml b/roles/package-mgmt/tests/test.yml new file mode 100644 index 0000000..929b029 --- /dev/null +++ b/roles/package-mgmt/tests/test.yml @@ -0,0 +1,5 @@ +--- +- hosts: localhost + remote_user: root + roles: + - package-mgmt diff --git a/roles/package-mgmt/vars/main.yml b/roles/package-mgmt/vars/main.yml new file mode 100644 index 0000000..8bb393e --- /dev/null +++ b/roles/package-mgmt/vars/main.yml @@ -0,0 +1,6 @@ +--- +# vars file for package-mgmt +docker_repo_key: "https://download.docker.com/linux/debian/gpg" +docker_repo: "deb [arch=amd64] https://download.docker.com/linux/debian bullseye stable" +sublime_repo_key: "https://download.sublimetext.com/sublimehq-pub.gpg" +sublime_repo: "deb https://download.sublimetext.com/ apt/stable/" -- cgit v1.2.3 From 9bf3e9ec191e0baf9baf8f0d7f553a0fa0c28e69 Mon Sep 17 00:00:00 2001 From: Dan Fedele Date: Mon, 12 Jun 2023 17:44:36 -0400 Subject: Smooshed some bugs --- roles/package-mgmt/tasks/main.yml | 109 ++++++++++++++++++++------------------ 1 file changed, 56 insertions(+), 53 deletions(-) (limited to 'roles/package-mgmt') diff --git a/roles/package-mgmt/tasks/main.yml b/roles/package-mgmt/tasks/main.yml index 2b6360e..ca5381e 100644 --- a/roles/package-mgmt/tasks/main.yml +++ b/roles/package-mgmt/tasks/main.yml @@ -8,6 +8,9 @@ repo: "{{ docker_repo }}" state: present +- name: Add Sublime Text repo key + ansible.builtin.shell: curl -fsSL {{ sublime_repo_key }} | gpg --dearmor --batch --yes -o /etc/apt/trusted.gpg.d/sublime-text-keyring.gpg + - name: Add Sublime Text repo ansible.builtin.apt_repository: repo: "{{ sublime_repo }}" @@ -21,56 +24,56 @@ - name: Installing one-off packages from package manager ansible.builtin.package: name: - - bloodhound - - build-essential - - bytecode-viewer - - clang - - cmake - - crackmapexec - - curl - - default-jdk - - default-jre - - docker - - docker-compose - - eog - - feroxbuster - - flex - - forensics-extra - - gawk - - gdb - - gdbserver - - ghidra - - git - - gobuster - - golang-go - - jq - - jxplorer - - libffi-dev - - liblzma-dev - - libssl-dev - - libxml2-dev - - ltrace - - ncat - - neo4j - - ntpdate - - mingw-w64 - - patch - - powershell - - python3 - - python3-dev - - python3-pip - - p7zip-full - - remmina - - rlwrap - - samba - - seclists - - steghide - - strace - - sublime-text - - terminator - - tmux - - xclip - - xfce4-terminal - - zaproxy - - zlib1g-dev - state: latest + - bloodhound + - build-essential + - bytecode-viewer + - clang + - cmake + - crackmapexec + - curl + - default-jdk + - default-jre + - docker + - docker-compose + - eog + - feroxbuster + - flex + - forensics-extra + - gawk + - gdb + - gdbserver + - ghidra + - git + - gobuster + - golang-go + - jq + - jxplorer + - libffi-dev + - liblzma-dev + - libssl-dev + - libxml2-dev + - ltrace + - ncat + - neo4j + - ntpdate + - mingw-w64 + - patch + - powershell + - python3 + - python3-dev + - python3-pip + - p7zip-full + - remmina + - rlwrap + - samba + - seclists + - steghide + - strace + - sublime-text + - terminator + - tmux + - xclip + - xfce4-terminal + - zaproxy + - zlib1g-dev + state: latest -- cgit v1.2.3 From 5610d030dda5d14ff62fb1a5eddcd1f3683fd6b8 Mon Sep 17 00:00:00 2001 From: Dan Fedele Date: Tue, 13 Jun 2023 10:53:59 -0400 Subject: Modified various readmes --- roles/package-mgmt/README.md | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) (limited to 'roles/package-mgmt') diff --git a/roles/package-mgmt/README.md b/roles/package-mgmt/README.md index 225dd44..2c23fcf 100644 --- a/roles/package-mgmt/README.md +++ b/roles/package-mgmt/README.md @@ -1,38 +1,9 @@ Role Name ========= -A brief description of the role goes here. - -Requirements ------------- - -Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required. +This role will handle any OS-level patching and package installs, including the installation of keys for repositories and such. This role typically takes a while to run because I always make sure I am patched and up to date before doing anything, and then of course the individual packages just take a while to install. Role Variables -------------- -A description of the settable variables for this role should go here, including any variables that are in defaults/main.yml, vars/main.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (ie. hostvars, group vars, etc.) should be mentioned here as well. - -Dependencies ------------- - -A list of other roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles. - -Example Playbook ----------------- - -Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too: - - - hosts: servers - roles: - - { role: username.rolename, x: 42 } - -License -------- - -BSD - -Author Information ------------------- - -An optional section for the role authors to include contact information, or a website (HTML is not allowed). +I have added the URLs to the specific keys I am using to install the repositories for things like Docker and Sublime Text. -- cgit v1.2.3 From dfa9f2398bd614f73a0df92cbcfd561c609a2f3b Mon Sep 17 00:00:00 2001 From: Dan Fedele Date: Tue, 13 Jun 2023 10:56:49 -0400 Subject: Wording change --- roles/package-mgmt/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'roles/package-mgmt') diff --git a/roles/package-mgmt/README.md b/roles/package-mgmt/README.md index 2c23fcf..01452d7 100644 --- a/roles/package-mgmt/README.md +++ b/roles/package-mgmt/README.md @@ -1,4 +1,4 @@ -Role Name +Package Mgmt ========= This role will handle any OS-level patching and package installs, including the installation of keys for repositories and such. This role typically takes a while to run because I always make sure I am patched and up to date before doing anything, and then of course the individual packages just take a while to install. -- cgit v1.2.3