diff --git a/.env b/.env index 21f74e2..aff3d58 100644 --- a/.env +++ b/.env @@ -4,38 +4,8 @@ CLICKHOUSE_VERSION=24.1.6 BUILDPLATFORM=linux/arm64 LOGS=./test_data -# TODO change this from loggies APP_LOGS=./loggies CONFIG_DIR=./deployment CONFIG_FILE=./config.hjson SYSLOG_ADDRESS=localhost:514 DB_ADDRESS=localhost:9000 - -# docker compose build --env-file .env.production -# cp ./.env.production /opt/rita/.env - - -# --- -# - name: Example playbook for Ubuntu -# hosts: default -# become: true -# tasks: -# - name: Create a directory if it does not exist -# ansible.builtin.file: -# path: /etc/rita -# state: directory -# mode: '0644' -# - name: Another symbolic mode example, adding some permissions and removing others -# ansible.builtin.copy: -# src: ~/repos/rita-v2/.env.production -# dest: /etc/rita/.env -# owner: root -# group: root -# mode: u+rw,g-wx,o-rwx -# - name: Another symbolic mode example, adding some permissions and removing others -# ansible.builtin.copy: -# src: ~/repos/rita-v2/deployment/* -# dest: /etc/rita -# owner: root -# group: root -# mode: u+rw,g-wx,o-rwx \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d283eb..cf8bf75 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,7 @@ jobs: with: # list of Docker images to use as base name for tags images: | - ghcr.io/activecm/rita-v2 + ghcr.io/activecm/rita # generate Docker tags based on the following events/attributes tags: | type=schedule diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 8099763..e3effe9 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -4,7 +4,7 @@ networks: rita-network: {} services: rita: - image: ghcr.io/activecm/rita-v2:latest + image: ghcr.io/activecm/rita:latest build: . depends_on: - clickhouse diff --git a/installer/build_image.sh b/installer/build_image.sh index fee1f81..5936070 100755 --- a/installer/build_image.sh +++ b/installer/build_image.sh @@ -1,5 +1,5 @@ # local test script to build RITA as an amd64 Docker image and export it to a file VERSION=$(git describe --always --abbrev=0 --tags) -sudo docker buildx build --platform linux/amd64 --tag ghcr.io/activecm/rita-v2:"$VERSION" ../ -docker save -o rita-v2-"$VERSION"-image.tar ghcr.io/activecm/rita-v2:"$VERSION" \ No newline at end of file +sudo docker buildx build --platform linux/amd64 --tag ghcr.io/activecm/rita:"$VERSION" ../ +docker save -o rita-"$VERSION"-image.tar ghcr.io/activecm/rita:"$VERSION" \ No newline at end of file diff --git a/installer/generate_installer.sh b/installer/generate_installer.sh index 1f0399f..9e60a28 100755 --- a/installer/generate_installer.sh +++ b/installer/generate_installer.sh @@ -67,7 +67,7 @@ cp ../README.md "$INSTALL_OPT"/README if [ "$(uname)" == "Darwin" ]; then sed -i'.bak' "s/REPLACE_ME/${VERSION}/g" "$BASE_DIR/install_rita.yml" # WAS $ANSIBLE_PLAYBOOKS sed -i'.bak' "s/REPLACE_ME/${VERSION}/g" "$BASE_DIR/install_rita.sh" - sed -i'.bak' "s#ghcr.io/activecm/rita-v2:latest#ghcr.io/activecm/rita-v2:${VERSION}#g" "$INSTALL_OPT/docker-compose.yml" + sed -i'.bak' "s#ghcr.io/activecm/rita:latest#ghcr.io/activecm/rita:${VERSION}#g" "$INSTALL_OPT/docker-compose.yml" rm "$BASE_DIR/install_rita.yml.bak" rm "$BASE_DIR/install_rita.sh.bak" @@ -75,7 +75,7 @@ if [ "$(uname)" == "Darwin" ]; then else sed -i "s/REPLACE_ME/${VERSION}/g" "$BASE_DIR/install_rita.yml" # WAS $ANSIBLE_PLAYBOOKS sed -i "s/REPLACE_ME/${VERSION}/g" "$BASE_DIR/install_rita.sh" - sed -i "s#ghcr.io/activecm/rita-v2:latest#ghcr.io/activecm/rita-v2:${VERSION}#g" "$INSTALL_OPT/docker-compose.yml" + sed -i "s#ghcr.io/activecm/rita:latest#ghcr.io/activecm/rita:${VERSION}#g" "$INSTALL_OPT/docker-compose.yml" fi @@ -83,8 +83,8 @@ fi # TODO remove when repo is public ./build_image.sh -cp "./rita-v2-$VERSION-image.tar" "$ANSIBLE_FILES" # was $INSTALL_OPT -rm "./rita-v2-$VERSION-image.tar" +cp "./rita-$VERSION-image.tar" "$ANSIBLE_FILES" # was $INSTALL_OPT +rm "./rita-$VERSION-image.tar" # create tar # TODO the inner folder is named stage, should be rita-$VERSION diff --git a/installer/install_scripts/install_rita.yml b/installer/install_scripts/install_rita.yml index e5e8bfa..1410314 100644 --- a/installer/install_scripts/install_rita.yml +++ b/installer/install_scripts/install_rita.yml @@ -23,11 +23,8 @@ become: true vars: - rita_version: "REPLACE_ME" #FIXME - replace with the right version - #rita_container_image: hello-world # Test container to confirm that we can install images. - #rita_container_image: activecm/rita # Confirm exact image name to pull - #rita_container_image: activecm/rita:4.3.1 - rita_container_image: "ghcr.io/activecm/rita-v2:{{ rita_version }}" + rita_version: "REPLACE_ME" + rita_container_image: "ghcr.io/activecm/rita:{{ rita_version }}" clickhouse_container_image: clickhouse/clickhouse-server:latest ansible_python_interpreter: /bin/python3 # Centos 7 defaults to using python2, so we force python 3. This change does not break any other distros @@ -510,15 +507,14 @@ rescue: - name: "RITA Install: Transfer RITA container image to target system" copy: - # TODO remove -v2 - src: "rita-v2-{{ rita_version }}-image.tar" + src: "rita-{{ rita_version }}-image.tar" dest: /opt/rita owner: root group: root mode: 0644 - name: "Install {{ rita_container_name }} container image from file" community.docker.docker_image_load: - path: "/opt/rita/rita-v2-{{ rita_version }}-image.tar" + path: "/opt/rita/rita-{{ rita_version }}-image.tar" register: load_result #This final one prints a list of the loaded images if we use the above 2 stanzas to load from a file. - name: "RITA Install: Print loaded image names." diff --git a/installer/test_installed.sh b/installer/test_installed.sh index bf3b4ad..52a04e7 100755 --- a/installer/test_installed.sh +++ b/installer/test_installed.sh @@ -25,8 +25,8 @@ fi [ -d /etc/rita/threat_intel_feeds ] || { echo >&2 "/threat_intel_feeds should be in /etc/rita"; exit 1; } # verify that sed worked during installer generation -if [ "$(grep -c "image: ghcr.io/activecm/rita-v2:${VERSION}" /opt/rita/docker-compose.yml)" -ne 1 ]; then - echo "/opt/rita/docker-compose.yml should have ghcr.io/activecm/rita-v2:${VERSION} set as the image definition for the rita service." +if [ "$(grep -c "image: ghcr.io/activecm/rita:${VERSION}" /opt/rita/docker-compose.yml)" -ne 1 ]; then + echo "/opt/rita/docker-compose.yml should have ghcr.io/activecm/rita:${VERSION} set as the image definition for the rita service." exit 1 fi diff --git a/integration/get_beacon_info.py b/integration/get_beacon_info.py index 8b7ff5e..baf7ea8 100644 --- a/integration/get_beacon_info.py +++ b/integration/get_beacon_info.py @@ -34,7 +34,7 @@ logType='tsv' # dst='165.227.216.194' # path = './test_data/proxy' -path = '/Users/lisa/Desktop/go_ws/rita-v2/test_data/valid_tsv' +path = './test_data/valid_tsv' # path = '/home/parallels/Desktop/chris/dnscat2-ja3-strobe-agent' order = ['ts','uid','id.orig_h','id.orig_p','id.resp_h','id.resp_p','proto','service','duration','orig_bytes','resp_bytes','conn_state','local_orig','local_resp','missed_bytes','history','orig_pkts','orig_ip_bytes','resp_pkts','resp_ip_bytes','tunnel_parents','agent_hostname','agent_uuid'] # size = 'multiple' diff --git a/integration/threat_intel_test.go b/integration/threat_intel_test.go index bb11f5e..defc392 100644 --- a/integration/threat_intel_test.go +++ b/integration/threat_intel_test.go @@ -81,11 +81,8 @@ func (it *ThreatIntelSuite) TestFileFeeds() { checkThreatIntel(t, db) } -// TODO check this test works once repo is public func (it *ThreatIntelSuite) TestOnlineFeeds() { t := it.T() - // TODO remove - t.SkipNow() dbName := "threat_intel_online_feed" // Get current commit hash @@ -96,7 +93,7 @@ func (it *ThreatIntelSuite) TestOnlineFeeds() { require.NotEmpty(t, commitHash) // Get online feed by pulling the file feed from Github - feedURL := "https://github.com/activecm/rita-v2/blob/" + commitHash + "/integration/threat_intel_feeds/feed.txt" + feedURL := "https://github.com/activecm/rita/blob/" + commitHash + "/integration/threat_intel_feeds/feed.txt" // set up file system interface afs := afero.NewMemMapFs()