From 9a4a505eecba79f40f0a12b612b5c11803718362 Mon Sep 17 00:00:00 2001 From: moth Date: Fri, 9 Jan 2026 18:06:31 -0700 Subject: [PATCH 1/5] De-master-ize the codebase ^____^ (#833) --- Contributing.md | 68 ++++++++++++++++------------ Readme.md | 97 +++++++++++++++++++++------------------- config/running.go | 4 +- docs/RITA Gittiquette.md | 37 +++++++++------ docs/Releases.md | 18 ++++---- docs/Upgrading.md | 11 ++--- etc/rita.yaml | 2 +- go.mod | 2 +- install.sh | 4 +- pkg/blacklist/service.go | 12 ++--- test.Dockerfile | 2 +- 11 files changed, 142 insertions(+), 115 deletions(-) diff --git a/Contributing.md b/Contributing.md index 35eec57e..b4304958 100644 --- a/Contributing.md +++ b/Contributing.md @@ -1,55 +1,65 @@ # Contributing to RITA + --- + ## Want to help? We would love that! + Here are some ways to get involved, ranging in difficulty from easiest to hardest ## Bug Hunting + Run the software and tell us when it breaks. We are happy to receive bug reports Just be sure to do the following: -* Check if the bug is already accounted for on the -[Github issue tracker](https://github.com/activecm/rita/issues) - * If an issue already exists, add the relevant info in a comment - * If not, create an issue and include the relevant info -* Give very specific descriptions of how to reproduce the bug -* Include the output of `rita --version` -* Include a description of your hardware (e.g. CPU, RAM, filesystems) -* Tell us about the size of the test and the physical resources available + +- Check if the bug is already accounted for on the + [Github issue tracker](https://github.com/activecm/rita/issues) + - If an issue already exists, add the relevant info in a comment + - If not, create an issue and include the relevant info +- Give very specific descriptions of how to reproduce the bug +- Include the output of `rita --version` +- Include a description of your hardware (e.g. CPU, RAM, filesystems) +- Tell us about the size of the test and the physical resources available ## Contributing Code + There are several ways to contribute code to the RITA project. Before diving in, follow the [Manual Installation Instructions](docs/Manual%20Installation.md) -* Work on bug fixes: - * Find an issue you would like to work on in the Github tracker, especially [unassigned issues marked "good first issue"](https://github.com/activecm/rita/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+no%3Aassignee) - * Leave a comment letting us know you would like to work on it -* Add new features: - * If you would like to become involved in the development effort, open a new issue or continue a discussion on an existing issue +- Work on bug fixes: + - Find an issue you would like to work on in the Github tracker, especially [unassigned issues marked "good first issue"](https://github.com/activecm/rita/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+no%3Aassignee) + - Leave a comment letting us know you would like to work on it +- Add new features: + - If you would like to become involved in the development effort, open a new issue or continue a discussion on an existing issue ### Running Static Tests -* You must have a RITA [development environment](https://github.com/activecm/rita/blob/master/docs/Manual%20Installation.md#installing-golang) set up and [golangci-lint](https://github.com/golangci/golangci-lint#install) installed to run the tests. -* Check the [Makefile](https://github.com/activecm/rita/blob/master/Makefile) for all options. Currently you can run `make test`, `make static-test`, and `make unit-test`. There is also `make integration-test` and docker variants that will require you install docker as well. + +- You must have a RITA [development environment](https://github.com/activecm/rita-legacy/blob/main/docs/Manual%20Installation.md#installing-golang) set up and [golangci-lint](https://github.com/golangci/golangci-lint#install) installed to run the tests. +- Check the [Makefile](https://github.com/activecm/rita-legacy/blob/main/Makefile) for all options. Currently you can run `make test`, `make static-test`, and `make unit-test`. There is also `make integration-test` and docker variants that will require you install docker as well. ### Reviewing Automated Test Results -Automated tests are run against each pull request. Build results may be viewed [here](https://github.com/activecm/rita/actions). + +Automated tests are run against each pull request. Build results may be viewed [here](https://github.com/activecm/rita-legacy/actions). ### Gittiquette Summary -* In order to contribute to RITA, you must [fork it](https://github.com/activecm/rita/fork). -* Once you have a forked repo you will need to clone it to a very specific path which corresponds to _the original repo location_. This is due to the way packages are imported in Go programs. - * `git clone [your forked repo git url]` -* Add `https://github.com/activecm/rita` as a new remote so you can pull new changes. - * `git remote add upstream https://github.com/activecm/rita` -* Split a branch off of master . - * `git checkout -b [your new feature]` -* When your work is finished, pull the latest changes from the upstream master and rebase your changes on it. - * `git checkout master; git pull -r upstream master` - * `git checkout [your new feature]; git rebase master` -* Push your commits to your repo and submit a pull request on Github. + +- In order to contribute to RITA, you must [fork it](https://github.com/activecm/rita-legacy/fork). +- Once you have a forked repo you will need to clone it to a very specific path which corresponds to _the original repo location_. This is due to the way packages are imported in Go programs. + - `git clone [your forked repo git url]` +- Add `https://github.com/activecm/rita-legacy` as a new remote so you can pull new changes. + - `git remote add upstream https://github.com/activecm/rita-legacy` +- Split a branch off of main. + - `git checkout -b [your new feature]` +- When your work is finished, pull the latest changes from the upstream main and rebase your changes on it. + - `git checkout main; git pull -r upstream main` + - `git checkout [your new feature]; git rebase main` +- Push your commits to your repo and submit a pull request on Github. Further info can be found in the [Gittiquette doc](docs/RITA%20Gittiquette.md) under the guidelines and contributors sections. ### Common Issues -* Building Rita using `go build` or `go install` yields a RITA version of `UNDEFINED` - * Use `make` or `make install` instead + +- Building Rita using `go build` or `go install` yields a RITA version of `UNDEFINED` + - Use `make` or `make install` instead diff --git a/Readme.md b/Readme.md index 9fa56ae5..8cb8dad6 100644 --- a/Readme.md +++ b/Readme.md @@ -11,9 +11,10 @@ Sponsored by [Active Countermeasures](https://activecountermeasures.com/). RITA is an open source framework for network traffic analysis. The framework ingests [Zeek Logs](https://www.zeek.org/) in TSV format, and currently supports the following major features: - - **Beaconing Detection**: Search for signs of beaconing behavior in and out of your network - - **DNS Tunneling Detection** Search for signs of DNS based covert channels - - **Blacklist Checking**: Query blacklists to search for suspicious domains and hosts + +- **Beaconing Detection**: Search for signs of beaconing behavior in and out of your network +- **DNS Tunneling Detection** Search for signs of DNS based covert channels +- **Blacklist Checking**: Query blacklists to search for suspicious domains and hosts ## Install @@ -27,11 +28,11 @@ Download the latest `install.sh` file [here](https://github.com/activecm/rita/re Then choose one of the following install methods: -* `sudo ./install.sh` will install RITA as well as supported versions of Zeek and MongoDB. This is suitable if you want to get started as quickly as possible or you don't already have Zeek or MongoDB. +- `sudo ./install.sh` will install RITA as well as supported versions of Zeek and MongoDB. This is suitable if you want to get started as quickly as possible or you don't already have Zeek or MongoDB. -* `sudo ./install.sh --disable-zeek --disable-mongo` will install RITA only, without Zeek or MongoDB. You may also use these flags individually. - * If you choose not to install Zeek you will need to [provide your own logs](#obtaining-data-generating-zeek-logs). - * If you choose not to install MongoDB you will need to configure RITA to [use your existing MongoDB server](docs/Mongo%20Configuration.md). +- `sudo ./install.sh --disable-zeek --disable-mongo` will install RITA only, without Zeek or MongoDB. You may also use these flags individually. + - If you choose not to install Zeek you will need to [provide your own logs](#obtaining-data-generating-zeek-logs). + - If you choose not to install MongoDB you will need to configure RITA to [use your existing MongoDB server](docs/Mongo%20Configuration.md). ### Docker Install @@ -51,35 +52,41 @@ See [this guide](docs/Upgrading.md) for upgrade instructions. RITA's config file is located at `/etc/rita/config.yaml` though you can specify a custom path on individual commands with the `-c` command line flag. -* The `Filtering: InternalSubnets` section *must* be configured or you will not see any results in certain modules (e.g. beacons, long connections). If your network uses the standard RFC1918 internal IP ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) you don't need to do anything as the default `InternalSubnets` section already has these. Otherwise, adjust this section to match your environment. RITA's main purpose is to find the signs of a compromised internal system talking to an external system and will automatically exclude internal to internal connections and external to external connections from parts of the analysis. +- The `Filtering: InternalSubnets` section _must_ be configured or you will not see any results in certain modules (e.g. beacons, long connections). If your network uses the standard RFC1918 internal IP ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) you don't need to do anything as the default `InternalSubnets` section already has these. Otherwise, adjust this section to match your environment. RITA's main purpose is to find the signs of a compromised internal system talking to an external system and will automatically exclude internal to internal connections and external to external connections from parts of the analysis. You may also wish to change the defaults for the following option: -* `Filtering: AlwaysInclude` - Ranges listed here are exempt from the filtering applied by the `InternalSubnets` setting. The main use for this is to include internal DNS servers so that you can see the source of any DNS queries made. + +- `Filtering: AlwaysInclude` - Ranges listed here are exempt from the filtering applied by the `InternalSubnets` setting. The main use for this is to include internal DNS servers so that you can see the source of any DNS queries made. Note that any value listed in the `Filtering` section should be in CIDR format. So a single IP of `192.168.1.1` would be written as `192.168.1.1/32`. #### Obtaining Data (Generating Zeek Logs) - * **Option 1**: Generate PCAPs outside of Zeek - * Generate PCAP files with a packet sniffer ([tcpdump](http://www.tcpdump.org/), [wireshark](https://www.wireshark.org/), etc.) - * (Optional) Merge multiple PCAP files into one PCAP file - * `mergecap -w outFile.pcap inFile1.pcap inFile2.pcap` - * Generate Zeek logs from the PCAP files - * ```zeek -r pcap_to_log.pcap local "Log::default_rotation_interval = 1 day"``` +- **Option 1**: Generate PCAPs outside of Zeek + + - Generate PCAP files with a packet sniffer ([tcpdump](http://www.tcpdump.org/), [wireshark](https://www.wireshark.org/), etc.) + - (Optional) Merge multiple PCAP files into one PCAP file + - `mergecap -w outFile.pcap inFile1.pcap inFile2.pcap` + - Generate Zeek logs from the PCAP files + - `zeek -r pcap_to_log.pcap local "Log::default_rotation_interval = 1 day"` + +- **Option 2**: Install Zeek and let it monitor an interface directly [[instructions](https://docs.zeek.org/en/master/quickstart/index.html)] + + - You may wish to [compile Zeek from source](https://docs.zeek.org/en/master/install/install.html) for performance reasons. [This script](https://github.com/activecm/bro-install) can help automate the process. + - The automated installer for RITA installs pre-compiled Zeek binaries by default + - Provide the `--disable-zeek` flag when running the installer if you intend to compile Zeek from source + - To take advantage of the feature for monitoring long-running, open connections (default is 1 hour or more), you will need to install our [zeek-open-connections plugin](https://github.com/activecm/zeek-open-connections/). We recommend installing the package with Zeek's package manager _zkg_. Newer versions of Zeek (4.0.0 or greater) will come bundled with _zkg_. If you do not have _zkg_ installed, you can [manually install](https://docs.zeek.org/projects/package-manager/en/stable/quickstart.html) it. Once you have _zkg_ installed, run the following commands to install the package - * **Option 2**: Install Zeek and let it monitor an interface directly [[instructions](https://docs.zeek.org/en/master/quickstart/index.html)] - * You may wish to [compile Zeek from source](https://docs.zeek.org/en/master/install/install.html) for performance reasons. [This script](https://github.com/activecm/bro-install) can help automate the process. - * The automated installer for RITA installs pre-compiled Zeek binaries by default - * Provide the `--disable-zeek` flag when running the installer if you intend to compile Zeek from source - * To take advantage of the feature for monitoring long-running, open connections (default is 1 hour or more), you will need to install our [zeek-open-connections plugin](https://github.com/activecm/zeek-open-connections/). We recommend installing the package with Zeek's package manager _zkg_. Newer versions of Zeek (4.0.0 or greater) will come bundled with _zkg_. If you do not have _zkg_ installed, you can [manually install](https://docs.zeek.org/projects/package-manager/en/stable/quickstart.html) it. Once you have _zkg_ installed, run the following commands to install the package - * ```zkg refresh``` - * ```zkg install zeek/activecm/zeek-open-connections``` + - `zkg refresh` + - `zkg install zeek/activecm/zeek-open-connections` - Next, edit your site/local.zeek file so that it contains the following line - * ```@load packages ``` + Next, edit your site/local.zeek file so that it contains the following line - Finally, run the following - * ```zeekctl deploy``` + - `@load packages ` + + Finally, run the following + + - `zeekctl deploy` #### Importing and Analyzing Data With RITA @@ -117,30 +124,28 @@ rita import --rolling /opt/zeek/logs/$(date --date='-1 hour' +\%Y-\%m-\%d)/ data RITA cycles data into and out of rolling databases in "chunks". You can think of each chunk as one hour, and the default being 24 chunks in a dataset. This gives the ability to always have the most recent 24 hours' worth of data available. But chunks are generic enough to accommodate non-default Zeek logging configurations or data retention times as well. See the [Rolling Datasets](docs/Rolling%20Datasets.md) documentation for advanced options. - > :grey_exclamation: **Note:** `dataset_name` is simply a name of your choosing. We recommend a descriptive name such as the hostname or location of where the data was captured. Stick with letters, numbers, and underscores. Periods and other special characters are not allowed. - #### Examining Data With RITA - * Use the **show-X** commands - * `show-databases`: Print the datasets currently stored - * `show-beacons`: Print hosts which show signs of C2 software - * `show-bl-hostnames`: Print blacklisted hostnames which received connections - * `show-bl-source-ips`: Print blacklisted IPs which initiated connections - * `show-bl-dest-ips`: Print blacklisted IPs which received connections - * `show-exploded-dns`: Print dns analysis. Exposes covert dns channels - * `show-long-connections`: Print long connections and relevant information - * `show-strobes`: Print connections which occurred with excessive frequency - * `show-useragents`: Print user agent information - * By default, RITA displays data in CSV format - * `-d [DELIM]` delimits the data by `[DELIM]` instead of a comma - * Strings can be provided instead of single characters if desired, e.g. `rita show-beacons -d "---" dataset_name` - * `-H` displays the data in a human readable format - * This takes precedence over the `-d` option - * Piping the human readable results through `less -S` prevents word wrapping - * Ex: `rita show-beacons dataset_name -H | less -S` - * Create a html report with `html-report` +- Use the **show-X** commands + - `show-databases`: Print the datasets currently stored + - `show-beacons`: Print hosts which show signs of C2 software + - `show-bl-hostnames`: Print blacklisted hostnames which received connections + - `show-bl-source-ips`: Print blacklisted IPs which initiated connections + - `show-bl-dest-ips`: Print blacklisted IPs which received connections + - `show-exploded-dns`: Print dns analysis. Exposes covert dns channels + - `show-long-connections`: Print long connections and relevant information + - `show-strobes`: Print connections which occurred with excessive frequency + - `show-useragents`: Print user agent information +- By default, RITA displays data in CSV format + - `-d [DELIM]` delimits the data by `[DELIM]` instead of a comma + - Strings can be provided instead of single characters if desired, e.g. `rita show-beacons -d "---" dataset_name` + - `-H` displays the data in a human readable format + - This takes precedence over the `-d` option + - Piping the human readable results through `less -S` prevents word wrapping + - Ex: `rita show-beacons dataset_name -H | less -S` +- Create a html report with `html-report` ### Getting help diff --git a/config/running.go b/config/running.go index 4caf942a..c43ea0b9 100644 --- a/config/running.go +++ b/config/running.go @@ -64,8 +64,8 @@ func initRunningConfig(static *StaticCfg, running *RunningCfg) error { if err != nil { fmt.Println("\t[!] Version error: please ensure that you cloned the git repo and are using make to build.") fmt.Println("\t[!] See the following resources for further information:") - fmt.Println("\t[>] https://github.com/activecm/rita/blob/master/Contributing.md#common-issues") - fmt.Println("\t[>] https://github.com/activecm/rita/blob/master/docs/Manual%20Installation.md") + fmt.Println("\t[>] https://github.com/activecm/rita-legacy/blob/main/Contributing.md#common-issues") + fmt.Println("\t[>] https://github.com/activecm/rita-legacy/blob/main/docs/Manual%20Installation.md") } return err } diff --git a/docs/RITA Gittiquette.md b/docs/RITA Gittiquette.md index e5406173..46184f5c 100644 --- a/docs/RITA Gittiquette.md +++ b/docs/RITA Gittiquette.md @@ -1,6 +1,7 @@ # RITA Gittiquette ## Commit Guidelines + - Do not split a single piece of work across multiple commits - Too many commits makes the git log unreadable - Do not merge several pieces of work into a single commit @@ -11,29 +12,34 @@ - Reading a description as long as a code diff takes time ## Branch Guidelines -- Do not edit the master branch directly - - The master branch is the sole point of truth for RITA -- Do only branch features off of the master branch + +- Do not edit the main branch directly + - The main branch is the sole point of truth for RITA +- Do only branch features off of the main branch - Branching features off of others complicates the git log and prevents rebasing - Do rebase feature branches before submitting a pull request - Rebasing solves merge conflicts at the feature branch level ## Github Guidelines + - Do make sure your public commits leave the code in a working state - Fighting bugs is easier when each set of changes is testable -- Do merge branches to master with a "squash and merge" +- Do merge branches to main with a "squash and merge" - Squashing ensures the git history is tidy - Merge commits create a paper trail and ease the reverting of features ## Contributors + ### Setting up a forked repo -- If you do not have direct write permissions to the RITA project, you will need to [fork it](https://github.com/activecm/rita/fork). + +- If you do not have direct write permissions to the RITA project, you will need to [fork it](https://github.com/activecm/rita-legacy/fork). - Once you have a forked repo you will need to clone it to a very specific path which corresponds to _the original repo location_. This is due to the way packages are imported in Go programs. - `git clone [your forked repo git url]` -- Add `https://github.com/activecm/rita` as a new remote so you can pull new changes. - - `git remote add upstream https://github.com/activecm/rita` +- Add `https://github.com/activecm/rita-legacy` as a new remote so you can pull new changes. + - `git remote add upstream https://github.com/activecm/rita-legacy` ### Creating a feature[1] + - Create an issue on the activecm/rita tracker - Create a feature branch to work on - `git branch [your new feature]` @@ -42,24 +48,26 @@ - Work, commit, test, repeat - `git add [files]` - `git commit [short descriptive message]` -- Pull down the latest changes in upstream master - - `git checkout master` - - `git pull -r upstream master` -- Rebase the feature branch on master[2] +- Pull down the latest changes in upstream main + - `git checkout main` + - `git pull -r upstream main` +- Rebase the feature branch on main[2] - `git checkout [your new feature]` - - `git rebase master` + - `git rebase main` - Push your new commits to Github - `git push origin [your new feature]` - Open a pull request using Github’s interface ## Maintainers + ### Handling a pull request[3] + - Read through the changes proposed and the linked issue - Check for correctness - Check for style - Check if the feature branch has only the intended commits and doesn't cause any merge conflicts - Checkout the feature branch - - `git remote add [other username] https://github.com/[other username]/rita.git` + - `git remote add [other username] https://github.com/[other username]/rita-legacy.git` - `git fetch [other username]` - `git checkout [other username]/[feature branch name]` - `git checkout -b [feature branch name]` @@ -68,9 +76,10 @@ - Leave a code review with comments, requested changes, or an approval on Github - Optionally, make changes yourself and push to the contributor's branch - Merge with the "Squash and merge" option, leaving a descriptive comment in the commit message -- Copy the descriptive comment to the latest [release draft](https://github.com/activecm/rita/releases) +- Copy the descriptive comment to the latest [release draft](https://github.com/activecm/rita-legacy/releases) ## Recommended Reading + 1. [A great introduction to git.](http://rogerdudler.github.io/git-guide/) 2. [Rebasing can be conceptually tricky. Atlassian provides a nice write up on the topic.](https://www.atlassian.com/git/tutorials/merging-vs-rebasing) 3. [When merging with Github, you are presented with several options. Github describes these options here.](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-request-merges) diff --git a/docs/Releases.md b/docs/Releases.md index 0ed248fb..2cec6dbd 100644 --- a/docs/Releases.md +++ b/docs/Releases.md @@ -3,15 +3,17 @@ Steps for creating a RITA release. - Update the `install.sh` script so that the `_RITA_VERSION` variable reflects the desired version tag - - Create a branch with this change and go through the pull request process - - Ensure that all tests pass on this branch - - Note: after merging this pull request, the master install script will break until the release files are built and uploaded. + + - Create a branch with this change and go through the pull request process + - Ensure that all tests pass on this branch + - Note: after merging this pull request, the main install script will break until the release files are built and uploaded. - Go to the [releases](https://github.com/activecm/rita/releases) page - - Click `Draft a new release` or pick the already existing draft - - Select the new `[version]` tag - - Fill out the title and description with recent changes - - If the config file changed, give a thorough description of the needed changes - - Publish the release + + - Click `Draft a new release` or pick the already existing draft + - Select the new `[version]` tag + - Fill out the title and description with recent changes + - If the config file changed, give a thorough description of the needed changes + - Publish the release - Keep refreshing the release page until the `rita` binary and `install.sh` script are automatically added. You can keep an eye on the progress on the [actions page](https://github.com/activecm/rita/actions) diff --git a/docs/Upgrading.md b/docs/Upgrading.md index 6c339cf3..41154fb8 100644 --- a/docs/Upgrading.md +++ b/docs/Upgrading.md @@ -11,17 +11,18 @@ You will likely need to update your config file as well. See the [Updating RITA' ## Upgrading Between Minor or Patch Versions -If you are upgrading within the same major version (e.g. v2.0.0 to v2.0.1, or v3.0.0 to v3.1.0) all you need to do is download the newest RITA binary and replace the one on your system. Alternatively, you can download and run the `install.sh` file from the [releases page](https://github.com/activecm/rita/releases) that corresponds with the version of RITA you wish to install. +If you are upgrading within the same major version (e.g. v2.0.0 to v2.0.1, or v3.0.0 to v3.1.0) all you need to do is download the newest RITA binary and replace the one on your system. Alternatively, you can download and run the `install.sh` file from the [releases page](https://github.com/activecm/rita-legacy/releases) that corresponds with the version of RITA you wish to install. You may not need to update your config file at all as RITA includes sane default settings for any new config value. This means that if your config file is missing a value, RITA will still have a default to use. However, if you need to customize any of these new values you'll have to update to the newer config file. ## Updating RITA's Config File -In some cases you may also need to update your config file to a newer version. You can always find the latest config file in [`etc/rita.yml`](https://github.com/activecm/rita/blob/master/etc/rita.yaml). If you use the `install.sh` script, the correct version of the config file will be downloaded for you to `/etc/rita/config.yaml.new`. +In some cases you may also need to update your config file to a newer version. You can always find the latest config file in [`etc/rita.yml`](https://github.com/activecm/rita-legacy/blob/main/etc/rita.yaml). If you use the `install.sh` script, the correct version of the config file will be downloaded for you to `/etc/rita/config.yaml.new`. To update the config file, transfer over any values you customized in your existing config to the equivalent section of the new config. Then save a backup of your existing `/etc/rita/config.yaml` before you replace it with the new version. Here are other useful tips for comparing differences between configs: -* Check the release notes for each of the versions of RITA for details on config file changes. -* Run `diff /etc/rita/config.yaml /etc/rita/config.yaml.new` to see a summary of both your customizations and any changes to the new config. -* Use `rita test-config` to see the config values RITA is using while it runs. This includes any default values set when your config file doesn't specify them. You can also specify a custom config file to further compare the differences like this: `rita test-config --config /etc/rita/config.yaml.new`. \ No newline at end of file + +- Check the release notes for each of the versions of RITA for details on config file changes. +- Run `diff /etc/rita/config.yaml /etc/rita/config.yaml.new` to see a summary of both your customizations and any changes to the new config. +- Use `rita test-config` to see the config values RITA is using while it runs. This includes any default values set when your config file doesn't specify them. You can also specify a custom config file to further compare the differences like this: `rita test-config --config /etc/rita/config.yaml.new`. diff --git a/etc/rita.yaml b/etc/rita.yaml index 95b9e331..7bc5d916 100644 --- a/etc/rita.yaml +++ b/etc/rita.yaml @@ -110,7 +110,7 @@ BlackListed: # to disable checks against them. feodotracker.abuse.ch: true - # This is the name of the database which will be created as a master list of + # This is the name of the database which will be created as a primary list of # blacklisted ips and hostnames by rita-blacklist BlacklistDatabase: "rita-bl" diff --git a/go.mod b/go.mod index e42159f4..656ec86c 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.17 // If urfave/cli is updated from v1.20.0 the corresponding autocomplete file // should be updated in etc/bash_completion.d/rita -// https://github.com/urfave/cli/blob/master/autocomplete/bash_autocomplete +// https://github.com/urfave/cli/blob/main/autocomplete/bash_autocomplete require ( github.com/activecm/mgorus v0.1.1 diff --git a/install.sh b/install.sh index 970a5fb2..5b6e3bac 100755 --- a/install.sh +++ b/install.sh @@ -563,7 +563,7 @@ __install_rita() { chmod 755 "$_CONFIG_PATH" mkdir -p /etc/bash_completion.d/ - curl -sSL "https://raw.githubusercontent.com/urfave/cli/master/autocomplete/bash_autocomplete" -o "/etc/bash_completion.d/rita" + curl -sSL "https://raw.githubusercontent.com/urfave/cli/main/autocomplete/bash_autocomplete" -o "/etc/bash_completion.d/rita" } # INFORMATION GATHERING @@ -720,7 +720,7 @@ Usage: Options: -h|--help Show this help message. -r|--reinstall Force reinstalling RITA. - -v|--version Specify the version tag of RITA to install instead of master. + -v|--version Specify the version tag of RITA to install instead of main. --disable-zeek|--disable-bro Disable automatic installation of Zeek IDS. --disable-mongo Disable automatic installation of MongoDB. HEREDOC diff --git a/pkg/blacklist/service.go b/pkg/blacklist/service.go index 23453698..ded3e9cd 100644 --- a/pkg/blacklist/service.go +++ b/pkg/blacklist/service.go @@ -23,11 +23,11 @@ import ( // return &Service{} // } -//BuildBlacklistedCollections builds the blacklist master reference collection -//and checks the uconn documents against that collection +// BuildBlacklistedCollections builds the blacklist primary reference collection +// and checks the uconn documents against that collection func BuildBlacklistedCollections(db *database.DB, conf *config.Config, logger *log.Logger) { // build the blacklist reference collection from provided blacklist sources - // this will be the master list ips and hostnames will be checked against + // this will be the primary list ips and hostnames will be checked against buildBlacklistReferenceCollection(db, conf, logger) // // build src ip collection @@ -92,7 +92,7 @@ func buildBlacklistReferenceCollection(db *database.DB, conf *config.Config, log } -//getSourceLists gathers the blacklists to check against +// getSourceLists gathers the blacklists to check against func getSourceLists(conf *config.Config) []list.List { //build up the lists var blacklists []list.List @@ -116,7 +116,7 @@ func getSourceLists(conf *config.Config) []list.List { return blacklists } -//buildCustomBlacklists gathers a custom blacklist from a url or file path +// buildCustomBlacklists gathers a custom blacklist from a url or file path func buildCustomBlacklists(entryType list.BlacklistedEntryType, paths []string) []list.List { var blacklists []list.List for _, path := range paths { @@ -131,7 +131,7 @@ func buildCustomBlacklists(entryType list.BlacklistedEntryType, paths []string) return blacklists } -//provide a closure over path to read the file into a line separated blacklist +// provide a closure over path to read the file into a line separated blacklist func tryOpenFileThenURL(path string) func() (io.ReadCloser, error) { return func() (io.ReadCloser, error) { _, err := os.Stat(path) diff --git a/test.Dockerfile b/test.Dockerfile index b7514e30..d039fca5 100644 --- a/test.Dockerfile +++ b/test.Dockerfile @@ -5,7 +5,7 @@ FROM golang:1.17 RUN apt-get update && apt-get install -y git make ca-certificates wget build-essential WORKDIR /go # install testing dependencies -RUN wget -O - -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \ +RUN wget -O - -q https://raw.githubusercontent.com/golangci/golangci-lint/main/install.sh \ | sh -s v1.41.1 WORKDIR /go/src/github.com/activecm/rita From 6429c5eae67711702738a3a1636a81ceda64545d Mon Sep 17 00:00:00 2001 From: moth Date: Fri, 9 Jan 2026 19:00:03 -0700 Subject: [PATCH 2/5] Update Package Names (#835) * Add CODEOWNERS file * Remove duplicate import * Update package references to rita-legacy --- .github/CODEOWNERS | 1 + .github/workflows/test.yml | 8 +-- .gitignore | 2 +- Contributing.md | 4 +- Dockerfile | 8 +-- Makefile | 2 +- Readme.md | 7 ++- commands/clean.go | 2 +- commands/commands.go | 2 +- commands/delete-database.go | 4 +- commands/import.go | 14 +++--- commands/import_test.go | 2 +- commands/reporting.go | 4 +- commands/show-beacons-proxy.go | 4 +- commands/show-beacons-sni.go | 4 +- commands/show-beacons.go | 4 +- commands/show-bl-hostname.go | 4 +- commands/show-bl-ip.go | 4 +- commands/show-databases.go | 2 +- commands/show-explodedDns.go | 4 +- commands/show-long-connections.go | 6 +-- commands/show-open-connections.go | 4 +- commands/show-strobes.go | 4 +- commands/show-user-agents.go | 4 +- commands/test-config.go | 4 +- commands/update-check.go | 14 +++--- database/db.go | 28 +++++------ database/meta.go | 32 ++++++------ database/writer.go | 2 +- docker-compose.yml | 4 +- docs/Manual Installation.md | 27 +++++----- docs/Releases.md | 4 +- go.mod | 7 +-- go.sum | 12 ----- install.sh | 4 +- parser/conn.go | 10 ++-- parser/dns.go | 6 +-- parser/files/indexing.go | 17 +++---- parser/files/reading.go | 20 ++++---- parser/files/repository.go | 36 +++++++------- parser/filter.go | 4 +- parser/filter_test.go | 2 +- parser/fsimporter.go | 40 +++++++-------- parser/http.go | 10 ++-- parser/open_conn.go | 10 ++-- parser/parsetypes/conn.go | 6 +-- parser/parsetypes/dns.go | 6 +-- parser/parsetypes/http.go | 6 +-- parser/parsetypes/open_conn.go | 6 +-- parser/parsetypes/parsetypes.go | 8 +-- parser/parsetypes/ssl.go | 6 +-- parser/repository.go | 16 +++--- parser/ssl.go | 16 +++--- pkg/beacon/analyzer.go | 8 +-- pkg/beacon/dissector.go | 6 +-- pkg/beacon/mongodb.go | 12 ++--- pkg/beacon/mongodb_test.go | 9 ++-- pkg/beacon/repository.go | 6 +-- pkg/beacon/results.go | 10 ++-- pkg/beacon/siphon.go | 6 +-- pkg/beacon/sorter.go | 8 +-- pkg/beacon/summarizer.go | 6 +-- pkg/beaconproxy/analyzer.go | 8 +-- pkg/beaconproxy/dissector.go | 6 +-- pkg/beaconproxy/mongodb.go | 12 ++--- pkg/beaconproxy/repository.go | 6 +-- pkg/beaconproxy/results.go | 4 +- pkg/beaconproxy/siphon.go | 6 +-- pkg/beaconproxy/sorter.go | 16 +++--- pkg/beaconproxy/summarizer.go | 6 +-- pkg/beaconsni/analyzer.go | 6 +-- pkg/beaconsni/dissector.go | 6 +-- pkg/beaconsni/mongodb.go | 12 ++--- pkg/beaconsni/repository.go | 6 +-- pkg/beaconsni/results.go | 4 +- pkg/beaconsni/siphon.go | 4 +- pkg/beaconsni/sorter.go | 6 +-- pkg/beaconsni/summarizer.go | 6 +-- pkg/blacklist/analyzer.go | 6 +-- pkg/blacklist/mongodb.go | 8 +-- pkg/blacklist/repository.go | 2 +- pkg/blacklist/results.go | 32 ++++++------ pkg/blacklist/service.go | 4 +- pkg/certificate/analyzer.go | 4 +- pkg/certificate/mongodb.go | 6 +-- pkg/certificate/mongodb_test.go | 7 +-- pkg/certificate/repository.go | 2 +- pkg/data/ip.go | 74 ++++++++++++++-------------- pkg/data/ip_test.go | 2 +- pkg/explodeddns/analyzer.go | 4 +- pkg/explodeddns/mongodb.go | 6 +-- pkg/explodeddns/mongodb_test.go | 3 +- pkg/explodeddns/results.go | 6 +-- pkg/host/analyzer.go | 4 +- pkg/host/mongodb.go | 6 +-- pkg/host/mongodb_test.go | 7 +-- pkg/host/repository.go | 2 +- pkg/hostname/analyzer.go | 4 +- pkg/hostname/mongodb.go | 6 +-- pkg/hostname/mongodb_test.go | 7 +-- pkg/hostname/repository.go | 2 +- pkg/remover/analyzer.go | 12 ++--- pkg/remover/mongodb.go | 6 +-- pkg/remover/writer.go | 20 ++++---- pkg/sniconn/analyzer.go | 6 +-- pkg/sniconn/mongodb.go | 10 ++-- pkg/sniconn/repository.go | 4 +- pkg/uconn/analyzer.go | 6 +-- pkg/uconn/mongodb.go | 10 ++-- pkg/uconn/mongodb_test.go | 7 +-- pkg/uconn/repository.go | 4 +- pkg/uconn/results.go | 2 +- pkg/uconn/summarizer.go | 6 +-- pkg/uconnproxy/analyzer.go | 4 +- pkg/uconnproxy/mongodb.go | 6 +-- pkg/uconnproxy/mongodb_test.go | 7 +-- pkg/uconnproxy/repository.go | 2 +- pkg/useragent/analyzer.go | 4 +- pkg/useragent/mongodb.go | 10 ++-- pkg/useragent/mongodb_test.go | 7 +-- pkg/useragent/repository.go | 4 +- pkg/useragent/results.go | 10 ++-- pkg/useragent/summarizer.go | 6 +-- reporting/report-beacons.go | 6 +-- reporting/report-beaconsproxy.go | 6 +-- reporting/report-beaconssni.go | 6 +-- reporting/report-bl-dest-ips.go | 6 +-- reporting/report-bl-hostnames.go | 6 +-- reporting/report-bl-source-ips.go | 6 +-- reporting/report-explodedDns.go | 6 +-- reporting/report-long-connections.go | 8 +-- reporting/report-strobes.go | 6 +-- reporting/report-useragents.go | 6 +-- reporting/report.go | 6 +-- resources/logging.go | 4 +- resources/resources.go | 4 +- resources/testing.go | 16 +++--- rita.go | 4 +- 138 files changed, 551 insertions(+), 554 deletions(-) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..3a480974 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @activecm/lumberghs diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eea45bf5..aebc4799 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,8 +4,8 @@ on: pull_request: # Run tests except if only markdown files are changed paths: - - '**' - - '!*.md' + - "**" + - "!*.md" jobs: test: @@ -25,8 +25,8 @@ jobs: # docker container create --name rita --entrypoint /bin/sleep quay.io/activecm/rita:test 5m # docker container start rita # docker container exec rita tar cf vendor.tar vendor - # docker container cp rita:/go/src/github.com/activecm/rita/rita ./rita - # docker container cp rita:/go/src/github.com/activecm/rita/vendor.tar ./vendor.tar + # docker container cp rita:/go/src/github.com/activecm/rita-legacy/rita ./rita + # docker container cp rita:/go/src/github.com/activecm/rita-legacy/vendor.tar ./vendor.tar # docker container stop rita # tar xf vendor.tar # - run: make integration-test diff --git a/.gitignore b/.gitignore index b5542270..134555c0 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,6 @@ *.swo *.exe /.vscode/ -/rita +/rita-legacy /vendor/ /rita-html-report/ diff --git a/Contributing.md b/Contributing.md index b4304958..16b04f43 100644 --- a/Contributing.md +++ b/Contributing.md @@ -15,7 +15,7 @@ reports Just be sure to do the following: - Check if the bug is already accounted for on the - [Github issue tracker](https://github.com/activecm/rita/issues) + [Github issue tracker](https://github.com/activecm/rita-legacy/issues) - If an issue already exists, add the relevant info in a comment - If not, create an issue and include the relevant info - Give very specific descriptions of how to reproduce the bug @@ -29,7 +29,7 @@ There are several ways to contribute code to the RITA project. Before diving in, follow the [Manual Installation Instructions](docs/Manual%20Installation.md) - Work on bug fixes: - - Find an issue you would like to work on in the Github tracker, especially [unassigned issues marked "good first issue"](https://github.com/activecm/rita/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+no%3Aassignee) + - Find an issue you would like to work on in the Github tracker, especially [unassigned issues marked "good first issue"](https://github.com/activecm/rita-legacy/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22+no%3Aassignee) - Leave a comment letting us know you would like to work on it - Add new features: - If you would like to become involved in the development effort, open a new issue or continue a discussion on an existing issue diff --git a/Dockerfile b/Dockerfile index 529b3d39..ca5eaf36 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM golang:1.17-alpine as rita-builder +FROM golang:1.17-alpine AS rita-builder RUN apk add --no-cache git make ca-certificates wget build-base -WORKDIR /go/src/github.com/activecm/rita +WORKDIR /go/src/github.com/activecm/rita-legacy # cache dependencies COPY go.mod go.sum ./ @@ -24,7 +24,7 @@ RUN make CGO_ENABLED=$CGO_ENABLED GOARCH=$GOARCH GOOS=$GOOS FROM scratch WORKDIR / -COPY --from=rita-builder /go/src/github.com/activecm/rita/etc/rita.yaml /etc/rita/config.yaml -COPY --from=rita-builder /go/src/github.com/activecm/rita/rita /rita +COPY --from=rita-builder /go/src/github.com/activecm/rita-legacy/etc/rita.yaml /etc/rita/config.yaml +COPY --from=rita-builder /go/src/github.com/activecm/rita-legacy/rita /rita ENTRYPOINT ["/rita"] diff --git a/Makefile b/Makefile index b9e2631b..28f0f811 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ VERSION := $(shell git describe --abbrev=0 --tags) EXACT_VERSION := $(shell git describe --always --long --dirty --tags) PREFIX ?= /usr/local -LDFLAGS := -ldflags='-X github.com/activecm/rita/config.Version=${VERSION} -X github.com/activecm/rita/config.ExactVersion=${EXACT_VERSION}' +LDFLAGS := -ldflags='-X github.com/activecm/rita-legacy/config.Version=${VERSION} -X github.com/activecm/rita-legacy/config.ExactVersion=${EXACT_VERSION}' TESTFLAGS := -p=1 -v # go source files SRC := $(shell find . -path ./vendor -prune -o -type f -name '*.go' -print) diff --git a/Readme.md b/Readme.md index 8cb8dad6..69d13ffa 100644 --- a/Readme.md +++ b/Readme.md @@ -1,4 +1,7 @@ -# RITA (Real Intelligence Threat Analytics) +> :exclamation: **Important Notice** :exclamation: +> This repository has been archived and is no longer maintained. The project has undergone a complete rewrite and significant improvements. The new version of this project can be found [here](https://github.com/activecm/rita). + +# RITA (Real Intelligence Threat Analytics) (Legacy) [![RITA Logo](rita-logo.png)](https://www.activecountermeasures.com/free-tools/rita/) @@ -24,7 +27,7 @@ Please see our recommended [System Requirements](docs/System%20Requirements.md) RITA provides an install script that works on Ubuntu 20.04 LTS, Debian 11, Security Onion, and CentOS 7. -Download the latest `install.sh` file [here](https://github.com/activecm/rita/releases/latest) and make it executable: `chmod +x ./install.sh` +Download the latest `install.sh` file [here](https://github.com/activecm/rita-legacy/releases/latest) and make it executable: `chmod +x ./install.sh` Then choose one of the following install methods: diff --git a/commands/clean.go b/commands/clean.go index c9699243..3633487b 100644 --- a/commands/clean.go +++ b/commands/clean.go @@ -3,7 +3,7 @@ package commands import ( "fmt" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/resources" "github.com/globalsign/mgo/bson" "github.com/urfave/cli" ) diff --git a/commands/commands.go b/commands/commands.go index 5427abc4..09920ccc 100644 --- a/commands/commands.go +++ b/commands/commands.go @@ -3,7 +3,7 @@ package commands import ( "runtime" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/resources" log "github.com/sirupsen/logrus" "github.com/urfave/cli" ) diff --git a/commands/delete-database.go b/commands/delete-database.go index 8c45b41f..9ec1b323 100644 --- a/commands/delete-database.go +++ b/commands/delete-database.go @@ -8,8 +8,8 @@ import ( "regexp" "strings" - "github.com/activecm/rita/resources" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/resources" + "github.com/activecm/rita-legacy/util" "github.com/urfave/cli" ) diff --git a/commands/import.go b/commands/import.go index 44a8e4bc..490c3f7a 100644 --- a/commands/import.go +++ b/commands/import.go @@ -5,11 +5,11 @@ import ( "fmt" "strings" - "github.com/activecm/rita/config" - "github.com/activecm/rita/parser" - "github.com/activecm/rita/pkg/remover" - "github.com/activecm/rita/resources" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/parser" + "github.com/activecm/rita-legacy/pkg/remover" + "github.com/activecm/rita-legacy/resources" + "github.com/activecm/rita-legacy/util" log "github.com/sirupsen/logrus" "github.com/urfave/cli" ) @@ -56,7 +56,7 @@ type ( } ) -//NewImporter .... +// NewImporter .... func NewImporter(c *cli.Context) *Importer { return &Importer{ configFile: getConfigFilePath(c), @@ -69,7 +69,7 @@ func NewImporter(c *cli.Context) *Importer { } } -//parseArgs handles parsing the positional import arguments +// parseArgs handles parsing the positional import arguments func (i *Importer) parseArgs() error { if len(i.args) < 2 { return cli.NewExitError("\n\t[!] Both and are required.", -1) diff --git a/commands/import_test.go b/commands/import_test.go index 9fce959f..6b0eb192 100644 --- a/commands/import_test.go +++ b/commands/import_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/activecm/rita/config" + "github.com/activecm/rita-legacy/config" ) func TestParseFlags(t *testing.T) { diff --git a/commands/reporting.go b/commands/reporting.go index 05385061..add64135 100644 --- a/commands/reporting.go +++ b/commands/reporting.go @@ -1,8 +1,8 @@ package commands import ( - "github.com/activecm/rita/reporting" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/reporting" + "github.com/activecm/rita-legacy/resources" "github.com/urfave/cli" ) diff --git a/commands/show-beacons-proxy.go b/commands/show-beacons-proxy.go index 8d48357a..66655ce8 100644 --- a/commands/show-beacons-proxy.go +++ b/commands/show-beacons-proxy.go @@ -5,8 +5,8 @@ import ( "os" "strings" - "github.com/activecm/rita/pkg/beaconproxy" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/pkg/beaconproxy" + "github.com/activecm/rita-legacy/resources" "github.com/olekukonko/tablewriter" "github.com/urfave/cli" ) diff --git a/commands/show-beacons-sni.go b/commands/show-beacons-sni.go index 95249a23..2eac56b7 100644 --- a/commands/show-beacons-sni.go +++ b/commands/show-beacons-sni.go @@ -5,8 +5,8 @@ import ( "os" "strings" - "github.com/activecm/rita/pkg/beaconsni" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/pkg/beaconsni" + "github.com/activecm/rita-legacy/resources" "github.com/olekukonko/tablewriter" "github.com/urfave/cli" ) diff --git a/commands/show-beacons.go b/commands/show-beacons.go index 05a9fdb1..f91ceea0 100644 --- a/commands/show-beacons.go +++ b/commands/show-beacons.go @@ -5,8 +5,8 @@ import ( "os" "strings" - "github.com/activecm/rita/pkg/beacon" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/pkg/beacon" + "github.com/activecm/rita-legacy/resources" "github.com/olekukonko/tablewriter" "github.com/urfave/cli" ) diff --git a/commands/show-bl-hostname.go b/commands/show-bl-hostname.go index a9d5e60a..3ea34312 100644 --- a/commands/show-bl-hostname.go +++ b/commands/show-bl-hostname.go @@ -7,8 +7,8 @@ import ( "strconv" "strings" - "github.com/activecm/rita/pkg/blacklist" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/pkg/blacklist" + "github.com/activecm/rita-legacy/resources" "github.com/olekukonko/tablewriter" "github.com/urfave/cli" ) diff --git a/commands/show-bl-ip.go b/commands/show-bl-ip.go index ca453610..e125961d 100644 --- a/commands/show-bl-ip.go +++ b/commands/show-bl-ip.go @@ -7,8 +7,8 @@ import ( "strconv" "strings" - "github.com/activecm/rita/pkg/blacklist" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/pkg/blacklist" + "github.com/activecm/rita-legacy/resources" "github.com/olekukonko/tablewriter" "github.com/urfave/cli" ) diff --git a/commands/show-databases.go b/commands/show-databases.go index 1732662c..285617b0 100644 --- a/commands/show-databases.go +++ b/commands/show-databases.go @@ -3,7 +3,7 @@ package commands import ( "fmt" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/resources" "github.com/urfave/cli" ) diff --git a/commands/show-explodedDns.go b/commands/show-explodedDns.go index a9b6e063..cd6c984e 100644 --- a/commands/show-explodedDns.go +++ b/commands/show-explodedDns.go @@ -6,8 +6,8 @@ import ( "os" "strings" - "github.com/activecm/rita/pkg/explodeddns" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/pkg/explodeddns" + "github.com/activecm/rita-legacy/resources" "github.com/olekukonko/tablewriter" "github.com/urfave/cli" ) diff --git a/commands/show-long-connections.go b/commands/show-long-connections.go index 84a50ee0..1bce504c 100644 --- a/commands/show-long-connections.go +++ b/commands/show-long-connections.go @@ -6,9 +6,9 @@ import ( "strings" "time" - "github.com/activecm/rita/pkg/uconn" - "github.com/activecm/rita/resources" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/pkg/uconn" + "github.com/activecm/rita-legacy/resources" + "github.com/activecm/rita-legacy/util" "github.com/olekukonko/tablewriter" "github.com/urfave/cli" ) diff --git a/commands/show-open-connections.go b/commands/show-open-connections.go index 7908713e..9db9ae99 100644 --- a/commands/show-open-connections.go +++ b/commands/show-open-connections.go @@ -7,8 +7,8 @@ import ( "strings" "time" - "github.com/activecm/rita/pkg/uconn" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/pkg/uconn" + "github.com/activecm/rita-legacy/resources" "github.com/olekukonko/tablewriter" "github.com/urfave/cli" ) diff --git a/commands/show-strobes.go b/commands/show-strobes.go index 9fd4a2db..42ba8648 100644 --- a/commands/show-strobes.go +++ b/commands/show-strobes.go @@ -5,8 +5,8 @@ import ( "os" "strings" - "github.com/activecm/rita/pkg/beacon" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/pkg/beacon" + "github.com/activecm/rita-legacy/resources" "github.com/olekukonko/tablewriter" "github.com/urfave/cli" ) diff --git a/commands/show-user-agents.go b/commands/show-user-agents.go index fab09684..76c70b47 100644 --- a/commands/show-user-agents.go +++ b/commands/show-user-agents.go @@ -5,8 +5,8 @@ import ( "os" "strings" - "github.com/activecm/rita/pkg/useragent" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/pkg/useragent" + "github.com/activecm/rita-legacy/resources" "github.com/olekukonko/tablewriter" "github.com/urfave/cli" ) diff --git a/commands/test-config.go b/commands/test-config.go index 904ee43e..82543cf1 100644 --- a/commands/test-config.go +++ b/commands/test-config.go @@ -4,8 +4,8 @@ import ( "fmt" "os" - "github.com/activecm/rita/config" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/resources" "github.com/urfave/cli" yaml "gopkg.in/yaml.v2" diff --git a/commands/update-check.go b/commands/update-check.go index d9142258..c1cd2454 100644 --- a/commands/update-check.go +++ b/commands/update-check.go @@ -6,19 +6,19 @@ import ( "strings" "time" - "github.com/activecm/rita/config" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/resources" "github.com/blang/semver" "github.com/google/go-github/github" log "github.com/sirupsen/logrus" "github.com/urfave/cli" ) -//Strings used for informing the user of a new version. -var informFmtStr = "\nTheres a new %s version of RITA %s available at:\nhttps://github.com/activecm/rita/releases\n" +// Strings used for informing the user of a new version. +var informFmtStr = "\nTheres a new %s version of RITA %s available at:\nhttps://github.com/activecm/rita-legacy/releases\n" var versions = []string{"Major", "Minor", "Patch"} -//GetVersionPrinter prints the version info +// GetVersionPrinter prints the version info func GetVersionPrinter() func(*cli.Context) { return func(c *cli.Context) { fmt.Printf("%s version %s\n", c.App.Name, c.App.Version) @@ -27,7 +27,7 @@ func GetVersionPrinter() func(*cli.Context) { } // UpdateCheck Performs a check for the new version of RITA against the git repository and -//returns a string indicating the new version if available +// returns a string indicating the new version if available func updateCheck(configFile string) string { res := resources.InitResources(configFile) delta := res.Config.S.UserConfig.UpdateCheckFrequency @@ -99,7 +99,7 @@ func getRemoteVersion() (semver.Version, error) { // Assembles a notice for the user informing them of an upgrade. // The return value is printed regardless so, "" is returned on errror. -//func informUser( verStr string, index int ) string { +// func informUser( verStr string, index int ) string { func informUser(local semver.Version, remote semver.Version) string { return fmt.Sprintf(informFmtStr, versions[versionDiffIndex(remote, local)], diff --git a/database/db.go b/database/db.go index d8753ef7..cb7c6efb 100644 --- a/database/db.go +++ b/database/db.go @@ -4,23 +4,23 @@ import ( "fmt" "github.com/activecm/mgosec" - "github.com/activecm/rita/config" + "github.com/activecm/rita-legacy/config" "github.com/blang/semver" "github.com/globalsign/mgo" "github.com/globalsign/mgo/bson" log "github.com/sirupsen/logrus" ) -//MinMongoDBVersion is the lower, inclusive bound on the -//versions of MongoDB compatible with RITA +// MinMongoDBVersion is the lower, inclusive bound on the +// versions of MongoDB compatible with RITA var MinMongoDBVersion = semver.Version{ Major: 4, Minor: 2, Patch: 0, } -//MaxMongoDBVersion is the upper, exclusive bound on the -//versions of MongoDB compatible with RITA +// MaxMongoDBVersion is the upper, exclusive bound on the +// versions of MongoDB compatible with RITA var MaxMongoDBVersion = semver.Version{ Major: 4, Minor: 3, @@ -34,7 +34,7 @@ type DB struct { selected string } -//NewDB constructs a new DB struct +// NewDB constructs a new DB struct func NewDB(conf *config.Config, log *log.Logger) (*DB, error) { // Jump into the requested database session, err := connectToMongoDB(conf, log) @@ -52,7 +52,7 @@ func NewDB(conf *config.Config, log *log.Logger) (*DB, error) { }, nil } -//connectToMongoDB connects to MongoDB possibly with authentication and TLS +// connectToMongoDB connects to MongoDB possibly with authentication and TLS func connectToMongoDB(conf *config.Config, logger *log.Logger) (*mgo.Session, error) { connString := conf.S.MongoDB.ConnectionString authMechanism := conf.R.MongoDB.AuthMechanismParsed @@ -95,18 +95,18 @@ func connectToMongoDB(conf *config.Config, logger *log.Logger) (*mgo.Session, er } -//SelectDB selects a database for analysis +// SelectDB selects a database for analysis func (d *DB) SelectDB(db string) { d.selected = db } -//GetSelectedDB retrieves the currently selected database for analysis +// GetSelectedDB retrieves the currently selected database for analysis func (d *DB) GetSelectedDB() string { return d.selected } -//CollectionExists returns true if collection exists in the currently -//selected database +// CollectionExists returns true if collection exists in the currently +// selected database func (d *DB) CollectionExists(table string) bool { ssn := d.Session.Copy() defer ssn.Close() @@ -125,8 +125,8 @@ func (d *DB) CollectionExists(table string) bool { return false } -//CreateCollection creates a new collection in the currently selected -//database with the required indexes +// CreateCollection creates a new collection in the currently selected +// database with the required indexes func (d *DB) CreateCollection(name string, indexes []mgo.Index) error { // Make a copy of the current session session := d.Session.Copy() @@ -155,7 +155,7 @@ func (d *DB) CreateCollection(name string, indexes []mgo.Index) error { return nil } -//AggregateCollection builds a collection via a MongoDB pipeline +// AggregateCollection builds a collection via a MongoDB pipeline func (d *DB) AggregateCollection(sourceCollection string, session *mgo.Session, pipeline []bson.D) *mgo.Iter { diff --git a/database/meta.go b/database/meta.go index 77e14791..a9ae306c 100644 --- a/database/meta.go +++ b/database/meta.go @@ -5,8 +5,8 @@ import ( "sync" "time" - "github.com/activecm/rita/config" - "github.com/activecm/rita/parser/files" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/parser/files" "github.com/blang/semver" "github.com/globalsign/mgo" "github.com/globalsign/mgo/bson" @@ -63,7 +63,7 @@ func NewMetaDB(config *config.Config, dbHandle *mgo.Session, return metaDB } -//GetRollingSettings gets the current rolling settings +// GetRollingSettings gets the current rolling settings func (m *MetaDB) GetRollingSettings(db string) (exists bool, isRolling bool, currChunk int, totalChunks int, err error) { // pull down dataset record from metadatabase result, err := m.GetDBMetaInfo(db) @@ -81,8 +81,8 @@ func (m *MetaDB) GetRollingSettings(db string) (exists bool, isRolling bool, cur return } -//SetRollingSettings ensures that a given db is marked as rolling, -//ensures that total_chunks matches numchunks, and sets the current_chunk to chunk. +// SetRollingSettings ensures that a given db is marked as rolling, +// ensures that total_chunks matches numchunks, and sets the current_chunk to chunk. func (m *MetaDB) SetRollingSettings(db string, chunk int, numchunks int) error { // pull down dataset record from metadatabase result, err := m.GetDBMetaInfo(db) @@ -129,7 +129,7 @@ func (m *MetaDB) SetRollingSettings(db string, chunk int, numchunks int) error { return nil } -//LastCheck returns most recent version check +// LastCheck returns most recent version check func (m *MetaDB) LastCheck() (time.Time, semver.Version) { ssn := m.dbHandle.Copy() defer ssn.Close() @@ -196,7 +196,7 @@ func (m *MetaDB) AddNewDB(name string, currentChunk, totalChunks int) error { return nil } -//DBExists returns whether or not a metadatabase record has been created for a database +// DBExists returns whether or not a metadatabase record has been created for a database func (m *MetaDB) DBExists(name string) (bool, error) { _, err := m.GetDBMetaInfo(name) if err != nil && err != mgo.ErrNotFound { @@ -477,8 +477,8 @@ func (m *MetaDB) GetDatabases() []string { } -//CheckCompatibleAnalyze checks if a database was analyzed with a version of -//RITA which is compatible with the running version +// CheckCompatibleAnalyze checks if a database was analyzed with a version of +// RITA which is compatible with the running version func (m *MetaDB) CheckCompatibleAnalyze(targetDatabase string) (bool, error) { dbData, err := m.GetDBMetaInfo(targetDatabase) if err != nil { @@ -543,7 +543,7 @@ func (m *MetaDB) GetFiles(database string) ([]files.IndexedFile, error) { return toReturn, nil } -//AddNewFilesToIndex adds indexed files to the files the metaDB using the bulk API +// AddNewFilesToIndex adds indexed files to the files the metaDB using the bulk API func (m *MetaDB) AddNewFilesToIndex(files []*files.IndexedFile) error { m.lock.Lock() defer m.lock.Unlock() @@ -573,10 +573,10 @@ func (m *MetaDB) AddNewFilesToIndex(files []*files.IndexedFile) error { return nil } -//FilterOutPreviouslyIndexedFiles checks all indexedFiles passed in to ensure -//that they have not previously been imported into the same database. -//The files are compared based on their hashes (md5 of first 15000 bytes) -//and the database they are slated to be imported into. +// FilterOutPreviouslyIndexedFiles checks all indexedFiles passed in to ensure +// that they have not previously been imported into the same database. +// The files are compared based on their hashes (md5 of first 15000 bytes) +// and the database they are slated to be imported into. func (m *MetaDB) FilterOutPreviouslyIndexedFiles(indexedFiles []*files.IndexedFile, targetDatabase string) []*files.IndexedFile { @@ -608,8 +608,8 @@ func (m *MetaDB) FilterOutPreviouslyIndexedFiles(indexedFiles []*files.IndexedFi return toReturn } -//RemoveFilesByChunk removes FilesTable entries for a given database chunk. -//This helps provide the ability to re-import a given chunk. +// RemoveFilesByChunk removes FilesTable entries for a given database chunk. +// This helps provide the ability to re-import a given chunk. func (m *MetaDB) RemoveFilesByChunk(database string, cid int) error { m.lock.Lock() defer m.lock.Unlock() diff --git a/database/writer.go b/database/writer.go index eebfd222..722845bc 100644 --- a/database/writer.go +++ b/database/writer.go @@ -3,7 +3,7 @@ package database import ( "sync" - "github.com/activecm/rita/config" + "github.com/activecm/rita-legacy/config" "github.com/globalsign/mgo" "github.com/globalsign/mgo/bson" log "github.com/sirupsen/logrus" diff --git a/docker-compose.yml b/docker-compose.yml index 6a70622f..5d4be3d6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3' +version: "3" services: db: @@ -7,7 +7,7 @@ services: - db:/data/db/ rita: - image: quay.io/activecm/rita:${VERSION:-latest} + image: quay.io/activecm/rita-legacy:${VERSION:-latest} build: . links: # give db an alias of "localhost" so that RITA's default config works unchanged diff --git a/docs/Manual Installation.md b/docs/Manual Installation.md index f065cfe0..4fa55388 100644 --- a/docs/Manual Installation.md +++ b/docs/Manual Installation.md @@ -1,11 +1,10 @@ - ### Installation This guide walks through installing several components. -* [Zeek](https://www.zeek.org) -* [MongoDB](https://www.mongodb.com) -* [RITA](https://github.com/activecm/rita/) +- [Zeek](https://www.zeek.org) +- [MongoDB](https://www.mongodb.com) +- [RITA](https://github.com/activecm/rita-legacy/) #### Zeek @@ -19,14 +18,15 @@ Installing Zeek is recommended. RITA needs Zeek logs as input so if you already RITA requires Mongo for storing and processing data. The current supported version is 4.2, but anything >= 4.0.0 may work. 1. Follow the MongoDB installation guide at https://docs.mongodb.com/v4.2/installation/ - * Alternatively, this is a direct link to the [download page](https://www.mongodb.com/try/download/community). Be sure to choose version 4.2 + - Alternatively, this is a direct link to the [download page](https://www.mongodb.com/try/download/community). Be sure to choose version 4.2 1. Ensure MongoDB is running before running RITA. #### RITA You have a few options for installing RITA. + 1. The main install script. You can disable Zeek and Mongo from being installed with the `--disable-zeek` and `--disable-mongo` flags. -1. A prebuilt binary is available for download on [RITA's release page](https://github.com/activecm/rita/releases). In this case you will need to download the config file from the same release and create some directories manually, as described below in the "Configuring the system" section. +1. A prebuilt binary is available for download on [RITA's release page](https://github.com/activecm/rita-legacy/releases). In this case you will need to download the config file from the same release and create some directories manually, as described below in the "Configuring the system" section. 1. Compile RITA manually from source. See below. ##### Installing Golang @@ -37,9 +37,9 @@ In order to compile RITA manually you will need to install [Golang](https://gola At this point you can build RITA from source code. -1. ```git clone https://github.com/activecm/rita.git``` -1. ```cd rita``` -1. ```make``` (Note that you will need to have `make` installed. You can use your system's package manager to install it.) +1. `git clone https://github.com/activecm/rita-legacy.git` +1. `cd rita` +1. `make` (Note that you will need to have `make` installed. You can use your system's package manager to install it.) This will yield a `rita` binary in the current directory. You can use `make install` to install the binary to `/usr/local/bin/rita` or `PREFIX=/ make install` to install to a different location (`/bin/rita` in this case). @@ -47,10 +47,11 @@ This will yield a `rita` binary in the current directory. You can use `make inst RITA requires a few directories to be created for it to function correctly. -1. ```sudo mkdir /etc/rita && sudo chmod 755 /etc/rita``` -1. ```sudo mkdir -p /var/lib/rita/logs && sudo chmod -R 755 /var/lib/rita``` +1. `sudo mkdir /etc/rita && sudo chmod 755 /etc/rita` +1. `sudo mkdir -p /var/lib/rita/logs && sudo chmod -R 755 /var/lib/rita` Copy the config file from your local RITA source code. -* ```sudo cp etc/rita.yaml /etc/rita/config.yaml && sudo chmod 666 /etc/rita/config.yaml``` -At this point, you can modify the config file as needed and test using the ```rita test-config``` command. There will be empty quotes or 0's assigned to empty fields. [RITA's readme](../Readme.md#configuration-file) has more information on changing the configuration. +- `sudo cp etc/rita.yaml /etc/rita/config.yaml && sudo chmod 666 /etc/rita/config.yaml` + +At this point, you can modify the config file as needed and test using the `rita test-config` command. There will be empty quotes or 0's assigned to empty fields. [RITA's readme](../Readme.md#configuration-file) has more information on changing the configuration. diff --git a/docs/Releases.md b/docs/Releases.md index 2cec6dbd..b4fcd343 100644 --- a/docs/Releases.md +++ b/docs/Releases.md @@ -8,7 +8,7 @@ Steps for creating a RITA release. - Ensure that all tests pass on this branch - Note: after merging this pull request, the main install script will break until the release files are built and uploaded. -- Go to the [releases](https://github.com/activecm/rita/releases) page +- Go to the [releases](https://github.com/activecm/rita-legacy/releases) page - Click `Draft a new release` or pick the already existing draft - Select the new `[version]` tag @@ -16,4 +16,4 @@ Steps for creating a RITA release. - If the config file changed, give a thorough description of the needed changes - Publish the release -- Keep refreshing the release page until the `rita` binary and `install.sh` script are automatically added. You can keep an eye on the progress on the [actions page](https://github.com/activecm/rita/actions) +- Keep refreshing the release page until the `rita` binary and `install.sh` script are automatically added. You can keep an eye on the progress on the [actions page](https://github.com/activecm/rita-legacy/actions) diff --git a/go.mod b/go.mod index 656ec86c..128623d3 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ -module github.com/activecm/rita +module github.com/activecm/rita-legacy -go 1.17 +go 1.22 // If urfave/cli is updated from v1.20.0 the corresponding autocomplete file // should be updated in etc/bash_completion.d/rita @@ -11,7 +11,6 @@ require ( github.com/activecm/mgosec v0.1.2-0.20191108195135-d918492993da github.com/activecm/rita-bl v0.0.0-20220823191806-f014db21453d github.com/blang/semver v3.5.1+incompatible - github.com/briandowns/spinner v1.16.0 github.com/creasty/defaults v1.3.0 github.com/globalsign/mgo v0.0.0-20190517090918-73267e130ca1 github.com/google/go-github v17.0.0+incompatible @@ -31,12 +30,10 @@ require ( require ( github.com/VividCortex/ewma v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fatih/color v1.7.0 // indirect github.com/golang/protobuf v1.3.3 // indirect github.com/google/go-querystring v1.0.0 // indirect github.com/google/safebrowsing v0.0.0-20190214191829-0feabcc2960b // indirect github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect - github.com/mattn/go-colorable v0.1.2 // indirect github.com/mattn/go-isatty v0.0.8 // indirect github.com/mattn/go-runewidth v0.0.4 // indirect github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect diff --git a/go.sum b/go.sum index 9f6ad96b..397c71ed 100644 --- a/go.sum +++ b/go.sum @@ -2,26 +2,19 @@ github.com/VividCortex/ewma v1.1.1 h1:MnEK4VOv6n0RSY4vtRe3h11qjxL3+t0B8yOL8iMXdc github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA= github.com/activecm/mgorus v0.1.1 h1:v+DoSPWbbaNkwrJDwHI+nh0K7xEqktahimoWeo0jCOc= github.com/activecm/mgorus v0.1.1/go.mod h1:oCz/dUji4JsFLsc1EKfgsotg20uITyvjblxo1ieo8Bg= -github.com/activecm/mgosec v0.1.1/go.mod h1:XcwqX1en4L7Tfxd6r6NdstZt/cbArEg8OBZyUKf9HtU= github.com/activecm/mgosec v0.1.2-0.20191108195135-d918492993da h1:LXRJgg7iscvGezPD5CMWNaJDlmKd3r8gyEGMecIERWI= github.com/activecm/mgosec v0.1.2-0.20191108195135-d918492993da/go.mod h1:XcwqX1en4L7Tfxd6r6NdstZt/cbArEg8OBZyUKf9HtU= github.com/activecm/rita-bl v0.0.0-20220823191806-f014db21453d h1:chJrld/x2Q+3Uj/3TrkHTKIe4gcN7x9tSIAIrxcZIOQ= github.com/activecm/rita-bl v0.0.0-20220823191806-f014db21453d/go.mod h1:s85IHPkhESB09tNgKuPTrxDQ8QHfPr+ftrOYPB/vXgQ= github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/briandowns/spinner v1.16.0 h1:DFmp6hEaIx2QXXuqSJmtfSBSAjRmpGiKG6ip2Wm/yOs= -github.com/briandowns/spinner v1.16.0/go.mod h1:QOuQk7x+EaDASo80FEXwlwiA+j/PPIcX3FScO+3/ZPQ= github.com/creasty/defaults v1.3.0 h1:uG+RAxYbJgOPCOdKEcec9ZJXeva7Y6mj/8egdzwmLtw= github.com/creasty/defaults v1.3.0/go.mod h1:CIEEvs7oIVZm30R8VxtFJs+4k201gReYyuYHJxZc68I= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/globalsign/mgo v0.0.0-20180615134936-113d3961e731/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20190517090918-73267e130ca1 h1:DQs0vsFrJDNGZovxiwBtuUaL0SLrQeNHkHpsIbi7w8U= github.com/globalsign/mgo v0.0.0-20190517090918-73267e130ca1/go.mod h1:OQBK0ebL25cW31topLSUPIWIrSesue7+zTa/haAXccQ= -github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= @@ -29,7 +22,6 @@ github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+u github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/safebrowsing v0.0.0-20171128203709-fe6951d7ef01/go.mod h1:5s5M4BFXyqfUstbiDH1ClnS7VmZmDqUaY/X0Rqbfw3o= github.com/google/safebrowsing v0.0.0-20190214191829-0feabcc2960b h1:VnwTdca7ctu+Z5+ljDDtNUPVJmDbCOkWvQONMdSf+qs= github.com/google/safebrowsing v0.0.0-20190214191829-0feabcc2960b/go.mod h1:5s5M4BFXyqfUstbiDH1ClnS7VmZmDqUaY/X0Rqbfw3o= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= @@ -42,8 +34,6 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= @@ -78,12 +68,10 @@ github.com/vbauerster/mpb v3.3.4+incompatible/go.mod h1:zAHG26FUhVKETRu+MWqYXcI7 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/net v0.0.0-20180712202826-d0887baf81f4/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/install.sh b/install.sh index 5b6e3bac..3ca695bf 100755 --- a/install.sh +++ b/install.sh @@ -530,8 +530,8 @@ __configure_mongodb() { } __install_rita() { - _RITA_RELEASE_URL="https://github.com/activecm/rita/releases/download/$_RITA_VERSION" - _RITA_REPO_URL="https://raw.githubusercontent.com/activecm/rita/$_RITA_VERSION" + _RITA_RELEASE_URL="https://github.com/activecm/rita-legacy/releases/download/$_RITA_VERSION" + _RITA_REPO_URL="https://raw.githubusercontent.com/activecm/rita-legacy/$_RITA_VERSION" _RITA_BINARY_URL="$_RITA_RELEASE_URL/rita" _RITA_CONFIG_URL="$_RITA_REPO_URL/etc/rita.yaml" _RITA_LICENSE_URL="$_RITA_REPO_URL/LICENSE" diff --git a/parser/conn.go b/parser/conn.go index 56142041..58773a97 100644 --- a/parser/conn.go +++ b/parser/conn.go @@ -5,11 +5,11 @@ import ( "net" "strconv" - "github.com/activecm/rita/parser/parsetypes" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/pkg/host" - "github.com/activecm/rita/pkg/uconn" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/parser/parsetypes" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/pkg/host" + "github.com/activecm/rita-legacy/pkg/uconn" + "github.com/activecm/rita-legacy/util" log "github.com/sirupsen/logrus" ) diff --git a/parser/dns.go b/parser/dns.go index 5b57a610..9e1ecbbf 100644 --- a/parser/dns.go +++ b/parser/dns.go @@ -3,9 +3,9 @@ package parser import ( "net" - "github.com/activecm/rita/parser/parsetypes" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/pkg/hostname" + "github.com/activecm/rita-legacy/parser/parsetypes" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/pkg/hostname" log "github.com/sirupsen/logrus" ) diff --git a/parser/files/indexing.go b/parser/files/indexing.go index b4df72db..3693619e 100644 --- a/parser/files/indexing.go +++ b/parser/files/indexing.go @@ -12,13 +12,12 @@ import ( log "github.com/sirupsen/logrus" - "github.com/activecm/rita/config" - "github.com/activecm/rita/parser/parsetypes" - pt "github.com/activecm/rita/parser/parsetypes" + "github.com/activecm/rita-legacy/config" + pt "github.com/activecm/rita-legacy/parser/parsetypes" ) -//newIndexedFile takes in a file path and the current resource bundle and opens up the -//file path and parses out some metadata +// newIndexedFile takes in a file path and the current resource bundle and opens up the +// file path and parses out some metadata func newIndexedFile(filePath string, targetDB string, targetCID int, logger *log.Logger, conf *config.Config) (*IndexedFile, error) { @@ -93,7 +92,7 @@ func newIndexedFile(filePath string, targetDB string, targetCID int, } //parse first line - var line parsetypes.BroData + var line pt.BroData if toReturn.IsJSON() { line = ParseJSONLine(scanner.Bytes(), broDataFactory, logger) } else { @@ -115,7 +114,7 @@ func newIndexedFile(filePath string, targetDB string, targetCID int, return toReturn, nil } -//getFileHash md5's the first 15000 bytes of a file +// getFileHash md5's the first 15000 bytes of a file func getFileHash(fileHandle *os.File, fInfo os.FileInfo) (string, error) { hash := md5.New() @@ -134,8 +133,8 @@ func getFileHash(fileHandle *os.File, fInfo os.FileInfo) (string, error) { return fmt.Sprintf("%x", hash.Sum(byteset)), nil } -//IndexFiles takes in a list of Zeek files, a number of threads, the target database, and target chunk ID and parses -//some metadata out of the files +// IndexFiles takes in a list of Zeek files, a number of threads, the target database, and target chunk ID and parses +// some metadata out of the files func IndexFiles(files []string, indexingThreads int, targetDB string, targetCID int, logger *log.Logger, conf *config.Config) []*IndexedFile { n := len(files) diff --git a/parser/files/reading.go b/parser/files/reading.go index e3c09164..deea6482 100644 --- a/parser/files/reading.go +++ b/parser/files/reading.go @@ -17,8 +17,8 @@ import ( "strings" "time" - pt "github.com/activecm/rita/parser/parsetypes" - "github.com/activecm/rita/util" + pt "github.com/activecm/rita-legacy/parser/parsetypes" + "github.com/activecm/rita-legacy/util" jsoniter "github.com/json-iterator/go" log "github.com/sirupsen/logrus" @@ -97,10 +97,10 @@ func GetFileScanner(fileHandle *os.File) (scanner *bufio.Scanner, closer func() return scanner, closer, nil } -//newGzipReader returns an un-gzipped byte stream given a gzip compressed byte stream. -//This method tries to use the system's pigz or gzip implementation before relying on -//Golang's gzip package (as it is quite slow). Returns stream to read from, a function to -//close the underlying stream, and any err that may occur when opening the stream. +// newGzipReader returns an un-gzipped byte stream given a gzip compressed byte stream. +// This method tries to use the system's pigz or gzip implementation before relying on +// Golang's gzip package (as it is quite slow). Returns stream to read from, a function to +// close the underlying stream, and any err that may occur when opening the stream. func newGzipReader(fileHandle io.ReadCloser) (reader io.Reader, closer func() error, err error) { // by default just close out the underlying file handle // works for built in gzip library and error cases @@ -289,7 +289,7 @@ func mapZeekHeaderToParseType(header *BroHeader, broDataFactory func() pt.BroDat return indexMap, nil } -//ParseJSONLine creates a new BroData from a line of a Zeek JSON log. +// ParseJSONLine creates a new BroData from a line of a Zeek JSON log. func ParseJSONLine(lineBuffer []byte, broDataFactory func() pt.BroData, logger *log.Logger) pt.BroData { @@ -408,9 +408,9 @@ func parseTSVField(fieldText string, fieldType string, targetField reflect.Value } } -//ParseTSVLine creates a new BroData from a line of a Zeek TSV log. -//String matching is generally faster than byte matching in Golang for some reason, so we take use a string -//rather than bytes here. +// ParseTSVLine creates a new BroData from a line of a Zeek TSV log. +// String matching is generally faster than byte matching in Golang for some reason, so we take use a string +// rather than bytes here. func ParseTSVLine(lineString string, header *BroHeader, fieldMap ZeekHeaderIndexMap, broDataFactory func() pt.BroData, logger *log.Logger) pt.BroData { diff --git a/parser/files/repository.go b/parser/files/repository.go index 180d6122..b3c6fdf3 100644 --- a/parser/files/repository.go +++ b/parser/files/repository.go @@ -3,12 +3,12 @@ package files import ( "time" - pt "github.com/activecm/rita/parser/parsetypes" + pt "github.com/activecm/rita-legacy/parser/parsetypes" "github.com/globalsign/mgo/bson" ) -//BroHeader contains the parse information contained within the comment lines -//of Zeek files +// BroHeader contains the parse information contained within the comment lines +// of Zeek files type BroHeader struct { Names []string // Names of fields Types []string // Types of fields @@ -19,14 +19,14 @@ type BroHeader struct { ObjType string // Object type (comes from #path) } -//ZeekHeaderIndexMap maps the indexes of the fields in the ZeekHeader to the respective -//indexes in the parsetype.BroData structs +// ZeekHeaderIndexMap maps the indexes of the fields in the ZeekHeader to the respective +// indexes in the parsetype.BroData structs type ZeekHeaderIndexMap struct { NthLogFieldExistsInParseType []bool NthLogFieldParseTypeOffset []int } -//IndexedFile ties a file to a target collection and database +// IndexedFile ties a file to a target collection and database type IndexedFile struct { ID bson.ObjectId `bson:"_id,omitempty"` Path string `bson:"filepath"` @@ -47,46 +47,46 @@ type IndexedFile struct { //IndexedFile as if it were public. The fields are private so they don't get //marshalled into MongoDB -//IsJSON returns whether the file is a json file +// IsJSON returns whether the file is a json file func (i *IndexedFile) IsJSON() bool { return i.json } -//SetJSON sets the json flag +// SetJSON sets the json flag func (i *IndexedFile) SetJSON() { i.json = true } -//SetHeader sets the broHeader on the indexed file +// SetHeader sets the broHeader on the indexed file func (i *IndexedFile) SetHeader(header *BroHeader) { i.header = header } -//GetHeader retrieves the broHeader on the indexed file +// GetHeader retrieves the broHeader on the indexed file func (i *IndexedFile) GetHeader() *BroHeader { return i.header } -//SetBroDataFactory sets the function which makes broData corresponding -//with this type of Zeek file +// SetBroDataFactory sets the function which makes broData corresponding +// with this type of Zeek file func (i *IndexedFile) SetBroDataFactory(broDataFactory func() pt.BroData) { i.broDataFactory = broDataFactory } -//GetBroDataFactory retrieves the function which makes broData corresponding -//with this type of Zeek file +// GetBroDataFactory retrieves the function which makes broData corresponding +// with this type of Zeek file func (i *IndexedFile) GetBroDataFactory() func() pt.BroData { return i.broDataFactory } -//SetFieldMap sets the map which maps the indexes of Zeek fields in the log header to the indexes -//in their respective broData structs +// SetFieldMap sets the map which maps the indexes of Zeek fields in the log header to the indexes +// in their respective broData structs func (i *IndexedFile) SetFieldMap(fieldMap ZeekHeaderIndexMap) { i.fieldMap = fieldMap } -//GetFieldMap retrieves the map which maps the indexes of Zeek fields in the log header to the indexes -//in their respective broData structs +// GetFieldMap retrieves the map which maps the indexes of Zeek fields in the log header to the indexes +// in their respective broData structs func (i *IndexedFile) GetFieldMap() ZeekHeaderIndexMap { return i.fieldMap } diff --git a/parser/filter.go b/parser/filter.go index 9f8d3703..a37c2aa2 100644 --- a/parser/filter.go +++ b/parser/filter.go @@ -3,8 +3,8 @@ package parser import ( "net" - "github.com/activecm/rita/config" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/util" ) // filter provides methods for excluding IP addresses, domains, and determining proxy servers during the import step diff --git a/parser/filter_test.go b/parser/filter_test.go index 2073a0d3..4f89cf99 100644 --- a/parser/filter_test.go +++ b/parser/filter_test.go @@ -4,7 +4,7 @@ import ( "net" "testing" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/util" "github.com/stretchr/testify/assert" ) diff --git a/parser/fsimporter.go b/parser/fsimporter.go index 467f6ca1..7e5a8c95 100644 --- a/parser/fsimporter.go +++ b/parser/fsimporter.go @@ -8,26 +8,26 @@ import ( "sync" "time" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/parser/files" - "github.com/activecm/rita/parser/parsetypes" - "github.com/activecm/rita/pkg/beacon" - "github.com/activecm/rita/pkg/beaconproxy" - "github.com/activecm/rita/pkg/beaconsni" - "github.com/activecm/rita/pkg/blacklist" - "github.com/activecm/rita/pkg/certificate" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/pkg/explodeddns" - "github.com/activecm/rita/pkg/host" - "github.com/activecm/rita/pkg/hostname" - "github.com/activecm/rita/pkg/remover" - "github.com/activecm/rita/pkg/sniconn" - "github.com/activecm/rita/pkg/uconn" - "github.com/activecm/rita/pkg/uconnproxy" - "github.com/activecm/rita/pkg/useragent" - "github.com/activecm/rita/resources" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/parser/files" + "github.com/activecm/rita-legacy/parser/parsetypes" + "github.com/activecm/rita-legacy/pkg/beacon" + "github.com/activecm/rita-legacy/pkg/beaconproxy" + "github.com/activecm/rita-legacy/pkg/beaconsni" + "github.com/activecm/rita-legacy/pkg/blacklist" + "github.com/activecm/rita-legacy/pkg/certificate" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/pkg/explodeddns" + "github.com/activecm/rita-legacy/pkg/host" + "github.com/activecm/rita-legacy/pkg/hostname" + "github.com/activecm/rita-legacy/pkg/remover" + "github.com/activecm/rita-legacy/pkg/sniconn" + "github.com/activecm/rita-legacy/pkg/uconn" + "github.com/activecm/rita-legacy/pkg/uconnproxy" + "github.com/activecm/rita-legacy/pkg/useragent" + "github.com/activecm/rita-legacy/resources" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo/bson" "github.com/pbnjay/memory" diff --git a/parser/http.go b/parser/http.go index dc9aaa8f..6365ed25 100644 --- a/parser/http.go +++ b/parser/http.go @@ -4,11 +4,11 @@ import ( "net" "strings" - "github.com/activecm/rita/parser/parsetypes" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/pkg/sniconn" - "github.com/activecm/rita/pkg/uconnproxy" - "github.com/activecm/rita/pkg/useragent" + "github.com/activecm/rita-legacy/parser/parsetypes" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/pkg/sniconn" + "github.com/activecm/rita-legacy/pkg/uconnproxy" + "github.com/activecm/rita-legacy/pkg/useragent" log "github.com/sirupsen/logrus" ) diff --git a/parser/open_conn.go b/parser/open_conn.go index 1f380961..2c5f7af7 100644 --- a/parser/open_conn.go +++ b/parser/open_conn.go @@ -5,11 +5,11 @@ import ( "net" "strconv" - "github.com/activecm/rita/parser/parsetypes" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/pkg/host" - "github.com/activecm/rita/pkg/uconn" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/parser/parsetypes" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/pkg/host" + "github.com/activecm/rita-legacy/pkg/uconn" + "github.com/activecm/rita-legacy/util" log "github.com/sirupsen/logrus" ) diff --git a/parser/parsetypes/conn.go b/parser/parsetypes/conn.go index 0bdfb3c7..d8745028 100644 --- a/parser/parsetypes/conn.go +++ b/parser/parsetypes/conn.go @@ -1,7 +1,7 @@ package parsetypes import ( - "github.com/activecm/rita/config" + "github.com/activecm/rita-legacy/config" "github.com/globalsign/mgo/bson" ) @@ -59,12 +59,12 @@ type Conn struct { AgentUUID string `bson:"agent_uuid" bro:"agent_uuid" brotype:"string" json:"agent_uuid"` } -//TargetCollection returns the mongo collection this entry should be inserted +// TargetCollection returns the mongo collection this entry should be inserted func (line *Conn) TargetCollection(config *config.StructureTableCfg) string { return config.ConnTable } -//ConvertFromJSON performs any extra conversions necessary when reading from JSON +// ConvertFromJSON performs any extra conversions necessary when reading from JSON func (line *Conn) ConvertFromJSON() { line.TimeStamp = convertTimestamp(line.TimeStampGeneric) } diff --git a/parser/parsetypes/dns.go b/parser/parsetypes/dns.go index b49afb5f..871168cd 100644 --- a/parser/parsetypes/dns.go +++ b/parser/parsetypes/dns.go @@ -1,7 +1,7 @@ package parsetypes import ( - "github.com/activecm/rita/config" + "github.com/activecm/rita-legacy/config" "github.com/globalsign/mgo/bson" ) @@ -66,12 +66,12 @@ type DNS struct { AgentUUID string `bson:"agent_uuid" bro:"agent_uuid" brotype:"string" json:"agent_uuid"` } -//TargetCollection returns the mongo collection this entry should be inserted +// TargetCollection returns the mongo collection this entry should be inserted func (line *DNS) TargetCollection(config *config.StructureTableCfg) string { return config.DNSTable } -//ConvertFromJSON performs any extra conversions necessary when reading from JSON +// ConvertFromJSON performs any extra conversions necessary when reading from JSON func (line *DNS) ConvertFromJSON() { line.TimeStamp = convertTimestamp(line.TimeStampGeneric) } diff --git a/parser/parsetypes/http.go b/parser/parsetypes/http.go index 533bab41..89571b3a 100644 --- a/parser/parsetypes/http.go +++ b/parser/parsetypes/http.go @@ -1,7 +1,7 @@ package parsetypes import ( - "github.com/activecm/rita/config" + "github.com/activecm/rita-legacy/config" "github.com/globalsign/mgo/bson" ) @@ -76,12 +76,12 @@ type HTTP struct { AgentUUID string `bson:"agent_uuid" bro:"agent_uuid" brotype:"string" json:"agent_uuid"` } -//TargetCollection returns the mongo collection this entry should be inserted +// TargetCollection returns the mongo collection this entry should be inserted func (line *HTTP) TargetCollection(config *config.StructureTableCfg) string { return config.HTTPTable } -//ConvertFromJSON performs any extra conversions necessary when reading from JSON +// ConvertFromJSON performs any extra conversions necessary when reading from JSON func (line *HTTP) ConvertFromJSON() { line.TimeStamp = convertTimestamp(line.TimeStampGeneric) } diff --git a/parser/parsetypes/open_conn.go b/parser/parsetypes/open_conn.go index c093e905..d9b66d9a 100644 --- a/parser/parsetypes/open_conn.go +++ b/parser/parsetypes/open_conn.go @@ -1,7 +1,7 @@ package parsetypes import ( - "github.com/activecm/rita/config" + "github.com/activecm/rita-legacy/config" "github.com/globalsign/mgo/bson" ) @@ -59,12 +59,12 @@ type OpenConn struct { AgentUUID string `bson:"agent_uuid" bro:"agent_uuid" brotype:"string" json:"agent_uuid"` } -//TargetCollection returns the mongo collection this entry should be inserted +// TargetCollection returns the mongo collection this entry should be inserted func (line *OpenConn) TargetCollection(config *config.StructureTableCfg) string { return config.OpenConnTable } -//ConvertFromJSON performs any extra conversions necessary when reading from JSON +// ConvertFromJSON performs any extra conversions necessary when reading from JSON func (line *OpenConn) ConvertFromJSON() { line.TimeStamp = convertTimestamp(line.TimeStampGeneric) } diff --git a/parser/parsetypes/parsetypes.go b/parser/parsetypes/parsetypes.go index 98989e36..139a095a 100644 --- a/parser/parsetypes/parsetypes.go +++ b/parser/parsetypes/parsetypes.go @@ -4,18 +4,18 @@ import ( "strings" "time" - "github.com/activecm/rita/config" + "github.com/activecm/rita-legacy/config" ) -//BroData holds a line of a bro log +// BroData holds a line of a bro log type BroData interface { TargetCollection(*config.StructureTableCfg) string // ConvertFromJSON should be called after importing from JSON logs ConvertFromJSON() } -//NewBroDataFactory creates a new BroData based on the string -//which appears in that log's objType field +// NewBroDataFactory creates a new BroData based on the string +// which appears in that log's objType field func NewBroDataFactory(fileType string) func() BroData { //Note: we use HasPrefix rather than equality for the checks //in order to support configurations which tag the log types. diff --git a/parser/parsetypes/ssl.go b/parser/parsetypes/ssl.go index 398244e6..7c605c14 100644 --- a/parser/parsetypes/ssl.go +++ b/parser/parsetypes/ssl.go @@ -1,7 +1,7 @@ package parsetypes import ( - "github.com/activecm/rita/config" + "github.com/activecm/rita-legacy/config" ) // SSL provides a data structure for zeek's connection data @@ -96,12 +96,12 @@ type SSL struct { AgentUUID string `bson:"agent_uuid" bro:"agent_uuid" brotype:"string" json:"agent_uuid"` } -//TargetCollection returns the mongo collection this entry should be inserted +// TargetCollection returns the mongo collection this entry should be inserted func (line *SSL) TargetCollection(config *config.StructureTableCfg) string { return config.SSLTable } -//ConvertFromJSON performs any extra conversions necessary when reading from JSON +// ConvertFromJSON performs any extra conversions necessary when reading from JSON func (line *SSL) ConvertFromJSON() { line.TimeStamp = convertTimestamp(line.TimeStampGeneric) } diff --git a/parser/repository.go b/parser/repository.go index 28251448..afbeb9a4 100644 --- a/parser/repository.go +++ b/parser/repository.go @@ -3,14 +3,14 @@ package parser import ( "sync" - "github.com/activecm/rita/pkg/certificate" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/pkg/host" - "github.com/activecm/rita/pkg/hostname" - "github.com/activecm/rita/pkg/sniconn" - "github.com/activecm/rita/pkg/uconn" - "github.com/activecm/rita/pkg/uconnproxy" - "github.com/activecm/rita/pkg/useragent" + "github.com/activecm/rita-legacy/pkg/certificate" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/pkg/host" + "github.com/activecm/rita-legacy/pkg/hostname" + "github.com/activecm/rita-legacy/pkg/sniconn" + "github.com/activecm/rita-legacy/pkg/uconn" + "github.com/activecm/rita-legacy/pkg/uconnproxy" + "github.com/activecm/rita-legacy/pkg/useragent" ) // ParseResults contains the data which the analysis packages diff --git a/parser/ssl.go b/parser/ssl.go index c85943b6..8b9d2f8c 100644 --- a/parser/ssl.go +++ b/parser/ssl.go @@ -3,14 +3,14 @@ package parser import ( "net" - "github.com/activecm/rita/parser/parsetypes" - "github.com/activecm/rita/pkg/certificate" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/pkg/host" - "github.com/activecm/rita/pkg/sniconn" - "github.com/activecm/rita/pkg/uconn" - "github.com/activecm/rita/pkg/useragent" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/parser/parsetypes" + "github.com/activecm/rita-legacy/pkg/certificate" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/pkg/host" + "github.com/activecm/rita-legacy/pkg/sniconn" + "github.com/activecm/rita-legacy/pkg/uconn" + "github.com/activecm/rita-legacy/pkg/useragent" + "github.com/activecm/rita-legacy/util" log "github.com/sirupsen/logrus" ) diff --git a/pkg/beacon/analyzer.go b/pkg/beacon/analyzer.go index 89d36708..5e5e789e 100644 --- a/pkg/beacon/analyzer.go +++ b/pkg/beacon/analyzer.go @@ -5,10 +5,10 @@ import ( "sort" "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/uconn" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/uconn" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo/bson" log "github.com/sirupsen/logrus" diff --git a/pkg/beacon/dissector.go b/pkg/beacon/dissector.go index f7e6543d..1fca88f0 100644 --- a/pkg/beacon/dissector.go +++ b/pkg/beacon/dissector.go @@ -3,9 +3,9 @@ package beacon import ( "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/uconn" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/uconn" "github.com/globalsign/mgo/bson" ) diff --git a/pkg/beacon/mongodb.go b/pkg/beacon/mongodb.go index 2d525203..067d518f 100644 --- a/pkg/beacon/mongodb.go +++ b/pkg/beacon/mongodb.go @@ -4,12 +4,12 @@ import ( "fmt" "runtime" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/pkg/host" - "github.com/activecm/rita/pkg/uconn" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/pkg/host" + "github.com/activecm/rita-legacy/pkg/uconn" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo" "github.com/vbauerster/mpb" diff --git a/pkg/beacon/mongodb_test.go b/pkg/beacon/mongodb_test.go index 99527b91..0a34bdb4 100644 --- a/pkg/beacon/mongodb_test.go +++ b/pkg/beacon/mongodb_test.go @@ -1,3 +1,4 @@ +//go:build integration // +build integration package beacon @@ -7,10 +8,10 @@ import ( "os" "testing" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/pkg/uconn" - "github.com/activecm/rita/resources" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/pkg/uconn" + "github.com/activecm/rita-legacy/resources" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo/dbtest" ) diff --git a/pkg/beacon/repository.go b/pkg/beacon/repository.go index 3341d336..e4149f19 100644 --- a/pkg/beacon/repository.go +++ b/pkg/beacon/repository.go @@ -1,9 +1,9 @@ package beacon import ( - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/pkg/host" - "github.com/activecm/rita/pkg/uconn" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/pkg/host" + "github.com/activecm/rita-legacy/pkg/uconn" ) // Repository for beacon collection diff --git a/pkg/beacon/results.go b/pkg/beacon/results.go index 91575c13..8fee1bfc 100644 --- a/pkg/beacon/results.go +++ b/pkg/beacon/results.go @@ -1,11 +1,11 @@ package beacon import ( - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/resources" "github.com/globalsign/mgo/bson" ) -//Results finds beacons in the database greater than a given cutoffScore +// Results finds beacons in the database greater than a given cutoffScore func Results(res *resources.Resources, cutoffScore float64) ([]Result, error) { ssn := res.DB.Session.Copy() defer ssn.Close() @@ -19,9 +19,9 @@ func Results(res *resources.Resources, cutoffScore float64) ([]Result, error) { return beacons, err } -//StrobeResults finds strobes (beacons with an immense number of connections) in the database. -//The results will be sorted by connection count ordered by sortDir (-1 or 1). -//limit and noLimit control how many results are returned. +// StrobeResults finds strobes (beacons with an immense number of connections) in the database. +// The results will be sorted by connection count ordered by sortDir (-1 or 1). +// limit and noLimit control how many results are returned. func StrobeResults(res *resources.Resources, sortDir, limit int, noLimit bool) ([]StrobeResult, error) { ssn := res.DB.Session.Copy() defer ssn.Close() diff --git a/pkg/beacon/siphon.go b/pkg/beacon/siphon.go index 555f396c..05e1cab6 100644 --- a/pkg/beacon/siphon.go +++ b/pkg/beacon/siphon.go @@ -3,9 +3,9 @@ package beacon import ( "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/uconn" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/uconn" "github.com/globalsign/mgo/bson" log "github.com/sirupsen/logrus" ) diff --git a/pkg/beacon/sorter.go b/pkg/beacon/sorter.go index e1b3dee7..dd7bfb5b 100644 --- a/pkg/beacon/sorter.go +++ b/pkg/beacon/sorter.go @@ -4,10 +4,10 @@ import ( "sort" "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/uconn" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/uconn" + "github.com/activecm/rita-legacy/util" ) type ( diff --git a/pkg/beacon/summarizer.go b/pkg/beacon/summarizer.go index cac40d6f..56b4dd89 100644 --- a/pkg/beacon/summarizer.go +++ b/pkg/beacon/summarizer.go @@ -3,9 +3,9 @@ package beacon import ( "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/data" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/data" "github.com/globalsign/mgo" "github.com/globalsign/mgo/bson" log "github.com/sirupsen/logrus" diff --git a/pkg/beaconproxy/analyzer.go b/pkg/beaconproxy/analyzer.go index 860a5b5b..9dfc6510 100644 --- a/pkg/beaconproxy/analyzer.go +++ b/pkg/beaconproxy/analyzer.go @@ -5,10 +5,10 @@ import ( "sort" "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/uconnproxy" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/uconnproxy" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo/bson" log "github.com/sirupsen/logrus" diff --git a/pkg/beaconproxy/dissector.go b/pkg/beaconproxy/dissector.go index a82e3287..4cf6ef8b 100644 --- a/pkg/beaconproxy/dissector.go +++ b/pkg/beaconproxy/dissector.go @@ -3,9 +3,9 @@ package beaconproxy import ( "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/uconnproxy" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/uconnproxy" "github.com/globalsign/mgo/bson" ) diff --git a/pkg/beaconproxy/mongodb.go b/pkg/beaconproxy/mongodb.go index 54d99017..be6ca1d3 100644 --- a/pkg/beaconproxy/mongodb.go +++ b/pkg/beaconproxy/mongodb.go @@ -4,12 +4,12 @@ import ( "fmt" "runtime" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/pkg/host" - "github.com/activecm/rita/pkg/uconnproxy" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/pkg/host" + "github.com/activecm/rita-legacy/pkg/uconnproxy" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo" "github.com/vbauerster/mpb" diff --git a/pkg/beaconproxy/repository.go b/pkg/beaconproxy/repository.go index 33563835..67f19f9e 100644 --- a/pkg/beaconproxy/repository.go +++ b/pkg/beaconproxy/repository.go @@ -1,9 +1,9 @@ package beaconproxy import ( - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/pkg/host" - "github.com/activecm/rita/pkg/uconnproxy" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/pkg/host" + "github.com/activecm/rita-legacy/pkg/uconnproxy" "github.com/globalsign/mgo/bson" ) diff --git a/pkg/beaconproxy/results.go b/pkg/beaconproxy/results.go index e30212fd..f16bcf23 100644 --- a/pkg/beaconproxy/results.go +++ b/pkg/beaconproxy/results.go @@ -1,11 +1,11 @@ package beaconproxy import ( - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/resources" "github.com/globalsign/mgo/bson" ) -//Results finds beacons FQDN in the database greater than a given cutoffScore +// Results finds beacons FQDN in the database greater than a given cutoffScore func Results(res *resources.Resources, cutoffScore float64) ([]Result, error) { ssn := res.DB.Session.Copy() defer ssn.Close() diff --git a/pkg/beaconproxy/siphon.go b/pkg/beaconproxy/siphon.go index 1d204cc5..40b9f107 100644 --- a/pkg/beaconproxy/siphon.go +++ b/pkg/beaconproxy/siphon.go @@ -3,9 +3,9 @@ package beaconproxy import ( "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/uconnproxy" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/uconnproxy" "github.com/globalsign/mgo/bson" log "github.com/sirupsen/logrus" ) diff --git a/pkg/beaconproxy/sorter.go b/pkg/beaconproxy/sorter.go index 8905c31e..3eb002b6 100644 --- a/pkg/beaconproxy/sorter.go +++ b/pkg/beaconproxy/sorter.go @@ -4,10 +4,10 @@ import ( "sort" "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/uconnproxy" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/uconnproxy" + "github.com/activecm/rita-legacy/util" ) type ( @@ -21,7 +21,7 @@ type ( } ) -//newsorter creates a new collector for gathering data +// newsorter creates a new collector for gathering data func newSorter(db *database.DB, conf *config.Config, sortedCallback func(*uconnproxy.Input), closedCallback func()) *sorter { return &sorter{ db: db, @@ -32,19 +32,19 @@ func newSorter(db *database.DB, conf *config.Config, sortedCallback func(*uconnp } } -//collect sends a chunk of data to be analyzed +// collect sends a chunk of data to be analyzed func (s *sorter) collect(entry *uconnproxy.Input) { s.sortChannel <- entry } -//close waits for the collector to finish +// close waits for the collector to finish func (s *sorter) close() { close(s.sortChannel) s.sortWg.Wait() s.closedCallback() } -//start kicks off a new analysis thread +// start kicks off a new analysis thread func (s *sorter) start() { s.sortWg.Add(1) go func() { diff --git a/pkg/beaconproxy/summarizer.go b/pkg/beaconproxy/summarizer.go index 678ed74d..10f93bf3 100644 --- a/pkg/beaconproxy/summarizer.go +++ b/pkg/beaconproxy/summarizer.go @@ -3,9 +3,9 @@ package beaconproxy import ( "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/data" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/data" "github.com/globalsign/mgo" "github.com/globalsign/mgo/bson" log "github.com/sirupsen/logrus" diff --git a/pkg/beaconsni/analyzer.go b/pkg/beaconsni/analyzer.go index 64feb8d2..dd1768fd 100644 --- a/pkg/beaconsni/analyzer.go +++ b/pkg/beaconsni/analyzer.go @@ -5,9 +5,9 @@ import ( "sort" "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo/bson" log "github.com/sirupsen/logrus" diff --git a/pkg/beaconsni/dissector.go b/pkg/beaconsni/dissector.go index d18dbf2a..a8813562 100644 --- a/pkg/beaconsni/dissector.go +++ b/pkg/beaconsni/dissector.go @@ -3,9 +3,9 @@ package beaconsni import ( "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/data" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/data" "github.com/globalsign/mgo/bson" ) diff --git a/pkg/beaconsni/mongodb.go b/pkg/beaconsni/mongodb.go index a553e140..0f4bfedd 100644 --- a/pkg/beaconsni/mongodb.go +++ b/pkg/beaconsni/mongodb.go @@ -4,12 +4,12 @@ import ( "fmt" "runtime" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/pkg/host" - "github.com/activecm/rita/pkg/sniconn" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/pkg/host" + "github.com/activecm/rita-legacy/pkg/sniconn" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo" "github.com/vbauerster/mpb" "github.com/vbauerster/mpb/decor" diff --git a/pkg/beaconsni/repository.go b/pkg/beaconsni/repository.go index 38e3f264..6ab65abf 100644 --- a/pkg/beaconsni/repository.go +++ b/pkg/beaconsni/repository.go @@ -1,9 +1,9 @@ package beaconsni import ( - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/pkg/host" - "github.com/activecm/rita/pkg/sniconn" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/pkg/host" + "github.com/activecm/rita-legacy/pkg/sniconn" ) // Repository for beaconsni collection diff --git a/pkg/beaconsni/results.go b/pkg/beaconsni/results.go index 85d3bb0d..8f9028fc 100644 --- a/pkg/beaconsni/results.go +++ b/pkg/beaconsni/results.go @@ -1,11 +1,11 @@ package beaconsni import ( - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/resources" "github.com/globalsign/mgo/bson" ) -//Results finds SNI beacons in the database greater than a given cutoffScore +// Results finds SNI beacons in the database greater than a given cutoffScore func Results(res *resources.Resources, cutoffScore float64) ([]Result, error) { ssn := res.DB.Session.Copy() defer ssn.Close() diff --git a/pkg/beaconsni/siphon.go b/pkg/beaconsni/siphon.go index 38582c0e..25570a76 100644 --- a/pkg/beaconsni/siphon.go +++ b/pkg/beaconsni/siphon.go @@ -3,8 +3,8 @@ package beaconsni import ( "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" "github.com/globalsign/mgo/bson" log "github.com/sirupsen/logrus" ) diff --git a/pkg/beaconsni/sorter.go b/pkg/beaconsni/sorter.go index ef743855..b21969d6 100644 --- a/pkg/beaconsni/sorter.go +++ b/pkg/beaconsni/sorter.go @@ -4,9 +4,9 @@ import ( "sort" "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/util" ) type ( diff --git a/pkg/beaconsni/summarizer.go b/pkg/beaconsni/summarizer.go index 314389d9..454f8eca 100644 --- a/pkg/beaconsni/summarizer.go +++ b/pkg/beaconsni/summarizer.go @@ -3,9 +3,9 @@ package beaconsni import ( "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/data" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/data" "github.com/globalsign/mgo" "github.com/globalsign/mgo/bson" log "github.com/sirupsen/logrus" diff --git a/pkg/blacklist/analyzer.go b/pkg/blacklist/analyzer.go index 3d6b867f..5122193b 100644 --- a/pkg/blacklist/analyzer.go +++ b/pkg/blacklist/analyzer.go @@ -3,9 +3,9 @@ package blacklist import ( "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/data" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/data" "github.com/globalsign/mgo" "github.com/globalsign/mgo/bson" log "github.com/sirupsen/logrus" diff --git a/pkg/blacklist/mongodb.go b/pkg/blacklist/mongodb.go index 7f2122bc..badd7a35 100644 --- a/pkg/blacklist/mongodb.go +++ b/pkg/blacklist/mongodb.go @@ -3,10 +3,10 @@ package blacklist import ( "runtime" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/util" "github.com/vbauerster/mpb" "github.com/vbauerster/mpb/decor" diff --git a/pkg/blacklist/repository.go b/pkg/blacklist/repository.go index 0e6115a8..cff411c6 100644 --- a/pkg/blacklist/repository.go +++ b/pkg/blacklist/repository.go @@ -1,7 +1,7 @@ package blacklist import ( - "github.com/activecm/rita/pkg/data" + "github.com/activecm/rita-legacy/pkg/data" ) // Repository for blacklist results in host collection diff --git a/pkg/blacklist/results.go b/pkg/blacklist/results.go index 829e6063..6680ca60 100644 --- a/pkg/blacklist/results.go +++ b/pkg/blacklist/results.go @@ -1,14 +1,14 @@ package blacklist import ( - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/resources" "github.com/globalsign/mgo/bson" ) -//HostnameResults finds blacklisted hostnames in the database and the IPs of the -//hosts which connected to the blacklisted hostnames. The results will be sorted in -//descending order keyed on of {uconn_count, conn_count, total_bytes} depending on the value -//of sort. limit and noLimit control how many results are returned. +// HostnameResults finds blacklisted hostnames in the database and the IPs of the +// hosts which connected to the blacklisted hostnames. The results will be sorted in +// descending order keyed on of {uconn_count, conn_count, total_bytes} depending on the value +// of sort. limit and noLimit control how many results are returned. func HostnameResults(res *resources.Resources, sort string, limit int, noLimit bool) ([]HostnameResult, error) { ssn := res.DB.Session.Copy() defer ssn.Close() @@ -108,25 +108,25 @@ func HostnameResults(res *resources.Resources, sort string, limit int, noLimit b return blHosts, err } -//SrcIPResults finds blacklisted source IPs in the database and the IPs of the -//hosts which the blacklisted IP connected to. The results will be sorted in -//descending order keyed on of {uconn_count, conn_count, total_bytes} depending on the value -//of sort. limit and noLimit control how many results are returned. +// SrcIPResults finds blacklisted source IPs in the database and the IPs of the +// hosts which the blacklisted IP connected to. The results will be sorted in +// descending order keyed on of {uconn_count, conn_count, total_bytes} depending on the value +// of sort. limit and noLimit control how many results are returned. func SrcIPResults(res *resources.Resources, sort string, limit int, noLimit bool) ([]IPResult, error) { return ipResults(res, sort, limit, noLimit, true) } -//DstIPResults finds blacklisted destination IPs in the database and the IPs of the -//hosts which connected to the blacklisted IP. The results will be sorted in -//descending order keyed on of {uconn_count, conn_count, total_bytes} depending on the value -//of sort. limit and noLimit control how many results are returned. +// DstIPResults finds blacklisted destination IPs in the database and the IPs of the +// hosts which connected to the blacklisted IP. The results will be sorted in +// descending order keyed on of {uconn_count, conn_count, total_bytes} depending on the value +// of sort. limit and noLimit control how many results are returned. func DstIPResults(res *resources.Resources, sort string, limit int, noLimit bool) ([]IPResult, error) { return ipResults(res, sort, limit, false, noLimit) } -//ipResults implements SrcIPResults and DstIPResults. Set sourceDestFlag to true -//to find blacklisted source IPs. Set sourceDestFlag to false to find blacklisted -//destination IPs. +// ipResults implements SrcIPResults and DstIPResults. Set sourceDestFlag to true +// to find blacklisted source IPs. Set sourceDestFlag to false to find blacklisted +// destination IPs. func ipResults(res *resources.Resources, sort string, limit int, noLimit bool, sourceDestFlag bool) ([]IPResult, error) { ssn := res.DB.Session.Copy() defer ssn.Close() diff --git a/pkg/blacklist/service.go b/pkg/blacklist/service.go index ded3e9cd..53b186c4 100644 --- a/pkg/blacklist/service.go +++ b/pkg/blacklist/service.go @@ -10,8 +10,8 @@ import ( ritaBLdb "github.com/activecm/rita-bl/database" "github.com/activecm/rita-bl/list" "github.com/activecm/rita-bl/sources/lists" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" log "github.com/sirupsen/logrus" ) diff --git a/pkg/certificate/analyzer.go b/pkg/certificate/analyzer.go index dfcac6fd..791a69ae 100644 --- a/pkg/certificate/analyzer.go +++ b/pkg/certificate/analyzer.go @@ -3,8 +3,8 @@ package certificate import ( "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" "github.com/globalsign/mgo/bson" ) diff --git a/pkg/certificate/mongodb.go b/pkg/certificate/mongodb.go index 4c8c2057..d687d41a 100644 --- a/pkg/certificate/mongodb.go +++ b/pkg/certificate/mongodb.go @@ -3,9 +3,9 @@ package certificate import ( "runtime" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo" "github.com/vbauerster/mpb" "github.com/vbauerster/mpb/decor" diff --git a/pkg/certificate/mongodb_test.go b/pkg/certificate/mongodb_test.go index 1a6314b2..0cd55257 100644 --- a/pkg/certificate/mongodb_test.go +++ b/pkg/certificate/mongodb_test.go @@ -1,3 +1,4 @@ +//go:build integration // +build integration package certificate @@ -7,9 +8,9 @@ import ( "os" "testing" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/resources" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/resources" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo/dbtest" ) diff --git a/pkg/certificate/repository.go b/pkg/certificate/repository.go index 55c4800c..066ac6cf 100644 --- a/pkg/certificate/repository.go +++ b/pkg/certificate/repository.go @@ -1,7 +1,7 @@ package certificate import ( - "github.com/activecm/rita/pkg/data" + "github.com/activecm/rita-legacy/pkg/data" ) // Repository for uconn collection diff --git a/pkg/data/ip.go b/pkg/data/ip.go index d3671960..77cb8135 100644 --- a/pkg/data/ip.go +++ b/pkg/data/ip.go @@ -5,26 +5,26 @@ import ( "net" "strings" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo/bson" "github.com/google/uuid" ) -//UniqueIP binds an IP to an optional Network UUID and Network Name. -//The UUID and Name serve to diffferentiate local IP addresses -//appearing on distinct physical networks. The Network Name should -//not be considered when determining equality. +// UniqueIP binds an IP to an optional Network UUID and Network Name. +// The UUID and Name serve to diffferentiate local IP addresses +// appearing on distinct physical networks. The Network Name should +// not be considered when determining equality. type UniqueIP struct { IP string `bson:"ip"` NetworkUUID bson.Binary `bson:"network_uuid"` NetworkName string `bson:"network_name"` } -//NewUniqueIP returns a new UniqueIP. If the given ip is publicly routable, the resulting UniqueIP's -//NetworkUUID and NetworkName will be set to PublicNetworkUUID and PublicNetworkName respectively. -//Otherwise, the NetworkUUID and NetworkName will be set based on the provided agentName and agentUUID. -//If the provided agent data is invalid, the NetworkUUID and NetworkName will be set to -//UnknownPrivateNetworkUUID and UnknownPrivateNetworkName. +// NewUniqueIP returns a new UniqueIP. If the given ip is publicly routable, the resulting UniqueIP's +// NetworkUUID and NetworkName will be set to PublicNetworkUUID and PublicNetworkName respectively. +// Otherwise, the NetworkUUID and NetworkName will be set based on the provided agentName and agentUUID. +// If the provided agent data is invalid, the NetworkUUID and NetworkName will be set to +// UnknownPrivateNetworkUUID and UnknownPrivateNetworkName. func NewUniqueIP(ip net.IP, agentUUID, agentName string) UniqueIP { u := UniqueIP{} u.IP = ip.String() @@ -57,14 +57,14 @@ func NewUniqueIP(ip net.IP, agentUUID, agentName string) UniqueIP { return u } -//Equal checks if two UniqueIPs have the same IP and network UUID +// Equal checks if two UniqueIPs have the same IP and network UUID func (u UniqueIP) Equal(ip UniqueIP) bool { return (u.IP == ip.IP && u.NetworkUUID.Kind == ip.NetworkUUID.Kind && bytes.Equal(u.NetworkUUID.Data, ip.NetworkUUID.Data)) } -//MapKey generates a string which may be used to index a given UniqueIP. Concatenates IP and Network UUID. +// MapKey generates a string which may be used to index a given UniqueIP. Concatenates IP and Network UUID. func (u UniqueIP) MapKey() string { var builder strings.Builder builder.Grow(len(u.IP) + 1 + len(u.NetworkUUID.Data)) @@ -75,7 +75,7 @@ func (u UniqueIP) MapKey() string { return builder.String() } -//BSONKey generates a BSON map which may be used to index a given UniqueIP. Includes IP and Network UUID. +// BSONKey generates a BSON map which may be used to index a given UniqueIP. Includes IP and Network UUID. func (u UniqueIP) BSONKey() bson.M { key := bson.M{ "ip": u.IP, @@ -84,9 +84,9 @@ func (u UniqueIP) BSONKey() bson.M { return key } -//PrefixedBSONKey returns a BSON map which may be used to index a given UniqueIP inside of a stored -//BSON document. Includes IP and NetworkUUID. Returns the updated BSON map. -//Ex: selector["dat"] = bson.M{"$elemMatch": someIP.PrefixedBSONKey("bl")} +// PrefixedBSONKey returns a BSON map which may be used to index a given UniqueIP inside of a stored +// BSON document. Includes IP and NetworkUUID. Returns the updated BSON map. +// Ex: selector["dat"] = bson.M{"$elemMatch": someIP.PrefixedBSONKey("bl")} func (u UniqueIP) PrefixedBSONKey(prefix string) bson.M { query := bson.M{} query[prefix+".ip"] = u.IP @@ -94,14 +94,14 @@ func (u UniqueIP) PrefixedBSONKey(prefix string) bson.M { return query } -//UniqueSrcIP is a unique IP which acts as the source in an IP pair +// UniqueSrcIP is a unique IP which acts as the source in an IP pair type UniqueSrcIP struct { SrcIP string `bson:"src"` SrcNetworkUUID bson.Binary `bson:"src_network_uuid"` SrcNetworkName string `bson:"src_network_name"` } -//AsSrc returns the UniqueIP in the UniqueSrcIP format +// AsSrc returns the UniqueIP in the UniqueSrcIP format func (u UniqueIP) AsSrc() UniqueSrcIP { return UniqueSrcIP{ SrcIP: u.IP, @@ -110,7 +110,7 @@ func (u UniqueIP) AsSrc() UniqueSrcIP { } } -//Unpair returns a copy of the SrcUniqueIP in UniqueIP format +// Unpair returns a copy of the SrcUniqueIP in UniqueIP format func (u UniqueSrcIP) Unpair() UniqueIP { return UniqueIP{ IP: u.SrcIP, @@ -119,8 +119,8 @@ func (u UniqueSrcIP) Unpair() UniqueIP { } } -//BSONKey generates a BSON map which may be used to index the source of a UniqueIP pair. -//Includes IP and Network UUID. +// BSONKey generates a BSON map which may be used to index the source of a UniqueIP pair. +// Includes IP and Network UUID. func (u UniqueSrcIP) BSONKey() bson.M { key := bson.M{ "src": u.SrcIP, @@ -129,14 +129,14 @@ func (u UniqueSrcIP) BSONKey() bson.M { return key } -//UniqueDstIP is a unique IP which acts as the destination in an IP Pair +// UniqueDstIP is a unique IP which acts as the destination in an IP Pair type UniqueDstIP struct { DstIP string `bson:"dst"` DstNetworkUUID bson.Binary `bson:"dst_network_uuid"` DstNetworkName string `bson:"dst_network_name"` } -//AsDst returns the UniqueIP in the UniqueDstIP format +// AsDst returns the UniqueIP in the UniqueDstIP format func (u UniqueIP) AsDst() UniqueDstIP { return UniqueDstIP{ DstIP: u.IP, @@ -145,7 +145,7 @@ func (u UniqueIP) AsDst() UniqueDstIP { } } -//Unpair returns a copy of the DstUniqueIP in UniqueIP format +// Unpair returns a copy of the DstUniqueIP in UniqueIP format func (u UniqueDstIP) Unpair() UniqueIP { return UniqueIP{ IP: u.DstIP, @@ -154,8 +154,8 @@ func (u UniqueDstIP) Unpair() UniqueIP { } } -//BSONKey generates a BSON map which may be used to index the destination of a UniqueIP pair. -//Includes IP and Network UUID. +// BSONKey generates a BSON map which may be used to index the destination of a UniqueIP pair. +// Includes IP and Network UUID. func (u UniqueDstIP) BSONKey() bson.M { key := bson.M{ "dst": u.DstIP, @@ -164,13 +164,13 @@ func (u UniqueDstIP) BSONKey() bson.M { return key } -//UniqueIPPair binds a pair of UniqueIPs where direction matters. +// UniqueIPPair binds a pair of UniqueIPs where direction matters. type UniqueIPPair struct { UniqueSrcIP `bson:",inline"` UniqueDstIP `bson:",inline"` } -//NewUniqueIPPair binds a pair of UniqueIPs where direction matters. +// NewUniqueIPPair binds a pair of UniqueIPs where direction matters. func NewUniqueIPPair(source UniqueIP, destination UniqueIP) UniqueIPPair { return UniqueIPPair{ UniqueSrcIP: UniqueSrcIP{ @@ -186,7 +186,7 @@ func NewUniqueIPPair(source UniqueIP, destination UniqueIP) UniqueIPPair { } } -//MapKey generates a string which may be used to index an ordered pair of UniqueIPs. Concatenates IPs and UUIDs. +// MapKey generates a string which may be used to index an ordered pair of UniqueIPs. Concatenates IPs and UUIDs. func (p UniqueIPPair) MapKey() string { var builder strings.Builder @@ -204,8 +204,8 @@ func (p UniqueIPPair) MapKey() string { return builder.String() } -//BSONKey generates a BSON map which may be used to index a given source/destination UniqueIP pair. -//Includes IP and Network UUID. +// BSONKey generates a BSON map which may be used to index a given source/destination UniqueIP pair. +// Includes IP and Network UUID. func (p UniqueIPPair) BSONKey() bson.M { key := bson.M{ "src": p.SrcIP, @@ -216,12 +216,12 @@ func (p UniqueIPPair) BSONKey() bson.M { return key } -//UniqueIPSet is a set of UniqueIPs which contains at most one instance of each UniqueIP -//this implementation is based on a slice of UniqueIPs rather than a map[string]UniqueIP -//since it requires less RAM. +// UniqueIPSet is a set of UniqueIPs which contains at most one instance of each UniqueIP +// this implementation is based on a slice of UniqueIPs rather than a map[string]UniqueIP +// since it requires less RAM. type UniqueIPSet map[string]UniqueIP -//Items returns the UniqueIPs in the set as a slice. +// Items returns the UniqueIPs in the set as a slice. func (s UniqueIPSet) Items() []UniqueIP { retVal := make([]UniqueIP, 0, len(s)) for _, ip := range s { @@ -230,12 +230,12 @@ func (s UniqueIPSet) Items() []UniqueIP { return retVal } -//Insert adds a UniqueIP to the set +// Insert adds a UniqueIP to the set func (s UniqueIPSet) Insert(ip UniqueIP) { s[ip.MapKey()] = ip } -//Contains checks if a given UniqueIP is in the set +// Contains checks if a given UniqueIP is in the set func (s UniqueIPSet) Contains(ip UniqueIP) bool { _, ok := s[ip.MapKey()] return ok diff --git a/pkg/data/ip_test.go b/pkg/data/ip_test.go index a7daf75e..04a5d077 100644 --- a/pkg/data/ip_test.go +++ b/pkg/data/ip_test.go @@ -4,7 +4,7 @@ import ( "net" "testing" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo/bson" "github.com/stretchr/testify/assert" ) diff --git a/pkg/explodeddns/analyzer.go b/pkg/explodeddns/analyzer.go index b581cfe0..25444388 100644 --- a/pkg/explodeddns/analyzer.go +++ b/pkg/explodeddns/analyzer.go @@ -5,8 +5,8 @@ import ( "strings" "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" "github.com/globalsign/mgo/bson" ) diff --git a/pkg/explodeddns/mongodb.go b/pkg/explodeddns/mongodb.go index e98e445e..3a8a313d 100644 --- a/pkg/explodeddns/mongodb.go +++ b/pkg/explodeddns/mongodb.go @@ -3,9 +3,9 @@ package explodeddns import ( "runtime" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo" "github.com/vbauerster/mpb" "github.com/vbauerster/mpb/decor" diff --git a/pkg/explodeddns/mongodb_test.go b/pkg/explodeddns/mongodb_test.go index 19142fa0..3c90f5ea 100644 --- a/pkg/explodeddns/mongodb_test.go +++ b/pkg/explodeddns/mongodb_test.go @@ -1,3 +1,4 @@ +//go:build integration // +build integration package explodeddns @@ -7,7 +8,7 @@ import ( "os" "testing" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/resources" "github.com/globalsign/mgo/dbtest" ) diff --git a/pkg/explodeddns/results.go b/pkg/explodeddns/results.go index bd9e1e79..ebdd6266 100644 --- a/pkg/explodeddns/results.go +++ b/pkg/explodeddns/results.go @@ -1,12 +1,12 @@ package explodeddns import ( - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/resources" "github.com/globalsign/mgo/bson" ) -//Results returns hostnames and their subdomain/ lookup statistics from the database. -//limit and noLimit control how many results are returned. +// Results returns hostnames and their subdomain/ lookup statistics from the database. +// limit and noLimit control how many results are returned. func Results(res *resources.Resources, limit int, noLimit bool) ([]Result, error) { ssn := res.DB.Session.Copy() defer ssn.Close() diff --git a/pkg/host/analyzer.go b/pkg/host/analyzer.go index f658d616..4e0ded4d 100644 --- a/pkg/host/analyzer.go +++ b/pkg/host/analyzer.go @@ -1,8 +1,8 @@ package host import ( - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" "github.com/globalsign/mgo" "github.com/globalsign/mgo/bson" diff --git a/pkg/host/mongodb.go b/pkg/host/mongodb.go index f7d0d269..008c21eb 100644 --- a/pkg/host/mongodb.go +++ b/pkg/host/mongodb.go @@ -3,9 +3,9 @@ package host import ( "runtime" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo" "github.com/vbauerster/mpb" diff --git a/pkg/host/mongodb_test.go b/pkg/host/mongodb_test.go index 3c856642..3fa70972 100644 --- a/pkg/host/mongodb_test.go +++ b/pkg/host/mongodb_test.go @@ -1,3 +1,4 @@ +//go:build integration // +build integration package host @@ -7,9 +8,9 @@ import ( "os" "testing" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/resources" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/resources" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo/dbtest" ) diff --git a/pkg/host/repository.go b/pkg/host/repository.go index 97750331..6220355e 100644 --- a/pkg/host/repository.go +++ b/pkg/host/repository.go @@ -1,7 +1,7 @@ package host import ( - "github.com/activecm/rita/pkg/data" + "github.com/activecm/rita-legacy/pkg/data" ) // Repository for host collection diff --git a/pkg/hostname/analyzer.go b/pkg/hostname/analyzer.go index cfdc5fcc..1f808a94 100644 --- a/pkg/hostname/analyzer.go +++ b/pkg/hostname/analyzer.go @@ -4,8 +4,8 @@ import ( "strings" "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" "github.com/globalsign/mgo" "github.com/globalsign/mgo/bson" diff --git a/pkg/hostname/mongodb.go b/pkg/hostname/mongodb.go index 4dfed83e..cd4bdf67 100644 --- a/pkg/hostname/mongodb.go +++ b/pkg/hostname/mongodb.go @@ -3,9 +3,9 @@ package hostname import ( "runtime" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo" log "github.com/sirupsen/logrus" "github.com/vbauerster/mpb" diff --git a/pkg/hostname/mongodb_test.go b/pkg/hostname/mongodb_test.go index a552a7e1..67d65a2f 100644 --- a/pkg/hostname/mongodb_test.go +++ b/pkg/hostname/mongodb_test.go @@ -1,3 +1,4 @@ +//go:build integration // +build integration package hostname @@ -7,9 +8,9 @@ import ( "os" "testing" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/resources" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/resources" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo/dbtest" ) diff --git a/pkg/hostname/repository.go b/pkg/hostname/repository.go index ede4c9ab..dc021c06 100644 --- a/pkg/hostname/repository.go +++ b/pkg/hostname/repository.go @@ -1,7 +1,7 @@ package hostname import ( - "github.com/activecm/rita/pkg/data" + "github.com/activecm/rita-legacy/pkg/data" ) type ( diff --git a/pkg/remover/analyzer.go b/pkg/remover/analyzer.go index a4f885dc..1aabde1b 100644 --- a/pkg/remover/analyzer.go +++ b/pkg/remover/analyzer.go @@ -5,8 +5,8 @@ import ( "strings" "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" "github.com/globalsign/mgo/bson" ) @@ -24,7 +24,7 @@ type ( } ) -//newAnalyzer creates a new collector for parsing hostnames +// newAnalyzer creates a new collector for parsing hostnames func newAnalyzer(chunk int, db *database.DB, conf *config.Config, analyzedCallback func(update), closedCallback func()) *analyzer { return &analyzer{ chunk: chunk, @@ -37,19 +37,19 @@ func newAnalyzer(chunk int, db *database.DB, conf *config.Config, analyzedCallba } } -//collect sends a group of domains to be analyzed +// collect sends a group of domains to be analyzed func (a *analyzer) collect(data string) { a.analysisChannel <- data } -//close waits for the collector to finish +// close waits for the collector to finish func (a *analyzer) close() { close(a.analysisChannel) a.analysisWg.Wait() a.closedCallback() } -//start kicks off a new analysis thread +// start kicks off a new analysis thread func (a *analyzer) start() { a.analysisWg.Add(1) go func() { diff --git a/pkg/remover/mongodb.go b/pkg/remover/mongodb.go index b04ad9d0..9e886d69 100644 --- a/pkg/remover/mongodb.go +++ b/pkg/remover/mongodb.go @@ -4,9 +4,9 @@ import ( "fmt" "runtime" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo/bson" log "github.com/sirupsen/logrus" diff --git a/pkg/remover/writer.go b/pkg/remover/writer.go index 7f882860..4fe0a171 100644 --- a/pkg/remover/writer.go +++ b/pkg/remover/writer.go @@ -4,8 +4,8 @@ import ( "fmt" "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" "github.com/globalsign/mgo/bson" log "github.com/sirupsen/logrus" ) @@ -22,7 +22,7 @@ type ( } ) -//newCIDRemover creates a new writer object to write output data +// newCIDRemover creates a new writer object to write output data func newCIDRemover(cid int, db *database.DB, conf *config.Config, log *log.Logger) *writer { return &writer{ cid: cid, @@ -33,7 +33,7 @@ func newCIDRemover(cid int, db *database.DB, conf *config.Config, log *log.Logge } } -//newUpdater creates a new writer object to write output data +// newUpdater creates a new writer object to write output data func newUpdater(cid int, db *database.DB, conf *config.Config, log *log.Logger) *writer { return &writer{ cid: cid, @@ -44,29 +44,29 @@ func newUpdater(cid int, db *database.DB, conf *config.Config, log *log.Logger) } } -//collect sends a group of results to the writer for writing out to the database +// collect sends a group of results to the writer for writing out to the database func (w *writer) collectCIDRemover(data string) { w.cidRemoverChannel <- data } -//collect sends a group of results to the writer for writing out to the database +// collect sends a group of results to the writer for writing out to the database func (w *writer) collectUpdater(data update) { w.updaterChannel <- data } -//closeCIDRemover waits for the write threads to finish +// closeCIDRemover waits for the write threads to finish func (w *writer) closeCIDRemover() { close(w.cidRemoverChannel) w.writeWg.Wait() } -//closeUpdater waits for the write threads to finish +// closeUpdater waits for the write threads to finish func (w *writer) closeUpdater() { close(w.updaterChannel) w.writeWg.Wait() } -//startCIDRemover kicks off a new write thread +// startCIDRemover kicks off a new write thread func (w *writer) startCIDRemover() { w.writeWg.Add(1) go func() { @@ -105,7 +105,7 @@ func (w *writer) startCIDRemover() { }() } -//startUpdater kicks off a new write thread +// startUpdater kicks off a new write thread func (w *writer) startUpdater() { w.writeWg.Add(1) go func() { diff --git a/pkg/sniconn/analyzer.go b/pkg/sniconn/analyzer.go index 3bb9e7cb..35af7ef3 100644 --- a/pkg/sniconn/analyzer.go +++ b/pkg/sniconn/analyzer.go @@ -3,9 +3,9 @@ package sniconn import ( "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/data" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/data" "github.com/globalsign/mgo/bson" ) diff --git a/pkg/sniconn/mongodb.go b/pkg/sniconn/mongodb.go index 226bba17..bfc1269c 100644 --- a/pkg/sniconn/mongodb.go +++ b/pkg/sniconn/mongodb.go @@ -3,11 +3,11 @@ package sniconn import ( "runtime" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/pkg/host" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/pkg/host" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo" log "github.com/sirupsen/logrus" "github.com/vbauerster/mpb" diff --git a/pkg/sniconn/repository.go b/pkg/sniconn/repository.go index b58b0c2a..1a5ee0d2 100644 --- a/pkg/sniconn/repository.go +++ b/pkg/sniconn/repository.go @@ -1,8 +1,8 @@ package sniconn import ( - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/pkg/host" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/pkg/host" ) // Repository for uconn collection diff --git a/pkg/uconn/analyzer.go b/pkg/uconn/analyzer.go index 32f0940e..b9070c5a 100644 --- a/pkg/uconn/analyzer.go +++ b/pkg/uconn/analyzer.go @@ -3,9 +3,9 @@ package uconn import ( "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/data" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/data" "github.com/globalsign/mgo" "github.com/globalsign/mgo/bson" log "github.com/sirupsen/logrus" diff --git a/pkg/uconn/mongodb.go b/pkg/uconn/mongodb.go index bb868798..aacc374f 100644 --- a/pkg/uconn/mongodb.go +++ b/pkg/uconn/mongodb.go @@ -4,11 +4,11 @@ import ( "fmt" "runtime" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/pkg/host" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/pkg/host" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo" "github.com/vbauerster/mpb" diff --git a/pkg/uconn/mongodb_test.go b/pkg/uconn/mongodb_test.go index c78cec4b..5c6bea36 100644 --- a/pkg/uconn/mongodb_test.go +++ b/pkg/uconn/mongodb_test.go @@ -1,3 +1,4 @@ +//go:build integration // +build integration package uconn @@ -7,9 +8,9 @@ import ( "os" "testing" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/resources" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/resources" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo/dbtest" ) diff --git a/pkg/uconn/repository.go b/pkg/uconn/repository.go index 5c06cc87..4acf2102 100644 --- a/pkg/uconn/repository.go +++ b/pkg/uconn/repository.go @@ -1,8 +1,8 @@ package uconn import ( - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/pkg/host" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/pkg/host" ) // Repository for uconn collection diff --git a/pkg/uconn/results.go b/pkg/uconn/results.go index 9cfc42f0..d52f55a8 100644 --- a/pkg/uconn/results.go +++ b/pkg/uconn/results.go @@ -1,7 +1,7 @@ package uconn import ( - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/resources" "github.com/globalsign/mgo/bson" ) diff --git a/pkg/uconn/summarizer.go b/pkg/uconn/summarizer.go index 1f0960af..4f2a08d5 100644 --- a/pkg/uconn/summarizer.go +++ b/pkg/uconn/summarizer.go @@ -3,9 +3,9 @@ package uconn import ( "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/data" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/data" "github.com/globalsign/mgo" "github.com/globalsign/mgo/bson" log "github.com/sirupsen/logrus" diff --git a/pkg/uconnproxy/analyzer.go b/pkg/uconnproxy/analyzer.go index 50c77e11..c010eccb 100644 --- a/pkg/uconnproxy/analyzer.go +++ b/pkg/uconnproxy/analyzer.go @@ -4,8 +4,8 @@ import ( "strconv" "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" "github.com/globalsign/mgo/bson" ) diff --git a/pkg/uconnproxy/mongodb.go b/pkg/uconnproxy/mongodb.go index 4a03b0e1..36666341 100644 --- a/pkg/uconnproxy/mongodb.go +++ b/pkg/uconnproxy/mongodb.go @@ -3,9 +3,9 @@ package uconnproxy import ( "runtime" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo" log "github.com/sirupsen/logrus" "github.com/vbauerster/mpb" diff --git a/pkg/uconnproxy/mongodb_test.go b/pkg/uconnproxy/mongodb_test.go index 8c0203f5..7c7cec1c 100644 --- a/pkg/uconnproxy/mongodb_test.go +++ b/pkg/uconnproxy/mongodb_test.go @@ -1,3 +1,4 @@ +//go:build integration // +build integration package uconnproxy @@ -7,9 +8,9 @@ import ( "os" "testing" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/resources" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/resources" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo/dbtest" ) diff --git a/pkg/uconnproxy/repository.go b/pkg/uconnproxy/repository.go index 170f5048..c0267ff6 100644 --- a/pkg/uconnproxy/repository.go +++ b/pkg/uconnproxy/repository.go @@ -1,7 +1,7 @@ package uconnproxy import ( - "github.com/activecm/rita/pkg/data" + "github.com/activecm/rita-legacy/pkg/data" ) // Repository for uconnproxy collection diff --git a/pkg/useragent/analyzer.go b/pkg/useragent/analyzer.go index 8c13be05..8928af0b 100644 --- a/pkg/useragent/analyzer.go +++ b/pkg/useragent/analyzer.go @@ -4,8 +4,8 @@ import ( "strconv" "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" "github.com/globalsign/mgo/bson" ) diff --git a/pkg/useragent/mongodb.go b/pkg/useragent/mongodb.go index bb222ee2..0f412740 100644 --- a/pkg/useragent/mongodb.go +++ b/pkg/useragent/mongodb.go @@ -4,11 +4,11 @@ import ( "fmt" "runtime" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/pkg/host" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/pkg/host" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo" "github.com/vbauerster/mpb" diff --git a/pkg/useragent/mongodb_test.go b/pkg/useragent/mongodb_test.go index eab6ef81..346004d3 100644 --- a/pkg/useragent/mongodb_test.go +++ b/pkg/useragent/mongodb_test.go @@ -1,3 +1,4 @@ +//go:build integration // +build integration package useragent @@ -7,9 +8,9 @@ import ( "os" "testing" - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/resources" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/resources" + "github.com/activecm/rita-legacy/util" "github.com/globalsign/mgo/dbtest" ) diff --git a/pkg/useragent/repository.go b/pkg/useragent/repository.go index faddd39b..8e5e455a 100644 --- a/pkg/useragent/repository.go +++ b/pkg/useragent/repository.go @@ -1,8 +1,8 @@ package useragent import ( - "github.com/activecm/rita/pkg/data" - "github.com/activecm/rita/pkg/host" + "github.com/activecm/rita-legacy/pkg/data" + "github.com/activecm/rita-legacy/pkg/host" ) // Repository for uconn collection diff --git a/pkg/useragent/results.go b/pkg/useragent/results.go index 69ab3cf2..72e8783f 100644 --- a/pkg/useragent/results.go +++ b/pkg/useragent/results.go @@ -1,14 +1,14 @@ package useragent import ( - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/resources" "github.com/globalsign/mgo/bson" ) -//Results returns useragents sorted by how many times each useragent was -//seen in the dataset. sortDirection controls where the useragents are -//sorted in descending (sortDirection=-1) or ascending order (sortDirection=1). -//limit and noLimit control how many results are returned. +// Results returns useragents sorted by how many times each useragent was +// seen in the dataset. sortDirection controls where the useragents are +// sorted in descending (sortDirection=-1) or ascending order (sortDirection=1). +// limit and noLimit control how many results are returned. func Results(res *resources.Resources, sortDirection, limit int, noLimit bool) ([]Result, error) { ssn := res.DB.Session.Copy() defer ssn.Close() diff --git a/pkg/useragent/summarizer.go b/pkg/useragent/summarizer.go index bbf6ea75..7747e07c 100644 --- a/pkg/useragent/summarizer.go +++ b/pkg/useragent/summarizer.go @@ -3,9 +3,9 @@ package useragent import ( "sync" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" - "github.com/activecm/rita/pkg/data" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" + "github.com/activecm/rita-legacy/pkg/data" "github.com/globalsign/mgo" "github.com/globalsign/mgo/bson" log "github.com/sirupsen/logrus" diff --git a/reporting/report-beacons.go b/reporting/report-beacons.go index 5aa4a7d2..9e1f6845 100644 --- a/reporting/report-beacons.go +++ b/reporting/report-beacons.go @@ -5,9 +5,9 @@ import ( "html/template" "os" - "github.com/activecm/rita/pkg/beacon" - "github.com/activecm/rita/reporting/templates" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/pkg/beacon" + "github.com/activecm/rita-legacy/reporting/templates" + "github.com/activecm/rita-legacy/resources" ) func printBeacons(db string, showNetNames bool, res *resources.Resources, logsGeneratedAt string) error { diff --git a/reporting/report-beaconsproxy.go b/reporting/report-beaconsproxy.go index 30042337..bf84e3fa 100644 --- a/reporting/report-beaconsproxy.go +++ b/reporting/report-beaconsproxy.go @@ -5,9 +5,9 @@ import ( "html/template" "os" - "github.com/activecm/rita/pkg/beaconproxy" - "github.com/activecm/rita/reporting/templates" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/pkg/beaconproxy" + "github.com/activecm/rita-legacy/reporting/templates" + "github.com/activecm/rita-legacy/resources" ) func printBeaconsProxy(db string, showNetNames bool, res *resources.Resources, logsGeneratedAt string) error { diff --git a/reporting/report-beaconssni.go b/reporting/report-beaconssni.go index b4e97cc7..5ec3dba0 100644 --- a/reporting/report-beaconssni.go +++ b/reporting/report-beaconssni.go @@ -5,9 +5,9 @@ import ( "html/template" "os" - "github.com/activecm/rita/pkg/beaconsni" - "github.com/activecm/rita/reporting/templates" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/pkg/beaconsni" + "github.com/activecm/rita-legacy/reporting/templates" + "github.com/activecm/rita-legacy/resources" ) func printBeaconsSNI(db string, showNetNames bool, res *resources.Resources, logsGeneratedAt string) error { diff --git a/reporting/report-bl-dest-ips.go b/reporting/report-bl-dest-ips.go index 9f9b2b8a..8042cbcf 100644 --- a/reporting/report-bl-dest-ips.go +++ b/reporting/report-bl-dest-ips.go @@ -4,9 +4,9 @@ import ( "html/template" "os" - "github.com/activecm/rita/pkg/blacklist" - "github.com/activecm/rita/reporting/templates" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/pkg/blacklist" + "github.com/activecm/rita-legacy/reporting/templates" + "github.com/activecm/rita-legacy/resources" ) func printBLDestIPs(db string, showNetNames bool, res *resources.Resources, logsGeneratedAt string) error { diff --git a/reporting/report-bl-hostnames.go b/reporting/report-bl-hostnames.go index 99989820..e0ea9d7b 100644 --- a/reporting/report-bl-hostnames.go +++ b/reporting/report-bl-hostnames.go @@ -7,9 +7,9 @@ import ( "sort" "strings" - "github.com/activecm/rita/pkg/blacklist" - "github.com/activecm/rita/reporting/templates" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/pkg/blacklist" + "github.com/activecm/rita-legacy/reporting/templates" + "github.com/activecm/rita-legacy/resources" ) func printBLHostnames(db string, showNetNames bool, res *resources.Resources, logsGeneratedAt string) error { diff --git a/reporting/report-bl-source-ips.go b/reporting/report-bl-source-ips.go index 608dcc7a..6eb87cb3 100644 --- a/reporting/report-bl-source-ips.go +++ b/reporting/report-bl-source-ips.go @@ -7,9 +7,9 @@ import ( "sort" "strings" - "github.com/activecm/rita/pkg/blacklist" - "github.com/activecm/rita/reporting/templates" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/pkg/blacklist" + "github.com/activecm/rita-legacy/reporting/templates" + "github.com/activecm/rita-legacy/resources" ) func printBLSourceIPs(db string, showNetNames bool, res *resources.Resources, logsGeneratedAt string) error { diff --git a/reporting/report-explodedDns.go b/reporting/report-explodedDns.go index 0ce3665a..002f6967 100644 --- a/reporting/report-explodedDns.go +++ b/reporting/report-explodedDns.go @@ -5,9 +5,9 @@ import ( "html/template" "os" - "github.com/activecm/rita/pkg/explodeddns" - "github.com/activecm/rita/reporting/templates" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/pkg/explodeddns" + "github.com/activecm/rita-legacy/reporting/templates" + "github.com/activecm/rita-legacy/resources" ) func printDNS(db string, showNetNames bool, res *resources.Resources, logsGeneratedAt string) error { diff --git a/reporting/report-long-connections.go b/reporting/report-long-connections.go index 2bf0e98d..f32a73c7 100644 --- a/reporting/report-long-connections.go +++ b/reporting/report-long-connections.go @@ -7,10 +7,10 @@ import ( "strings" "time" - "github.com/activecm/rita/pkg/uconn" - "github.com/activecm/rita/reporting/templates" - "github.com/activecm/rita/resources" - "github.com/activecm/rita/util" + "github.com/activecm/rita-legacy/pkg/uconn" + "github.com/activecm/rita-legacy/reporting/templates" + "github.com/activecm/rita-legacy/resources" + "github.com/activecm/rita-legacy/util" ) func printLongConns(db string, showNetNames bool, res *resources.Resources, logsGeneratedAt string) error { diff --git a/reporting/report-strobes.go b/reporting/report-strobes.go index 893a7f79..2af6622f 100644 --- a/reporting/report-strobes.go +++ b/reporting/report-strobes.go @@ -5,9 +5,9 @@ import ( "html/template" "os" - "github.com/activecm/rita/pkg/beacon" - "github.com/activecm/rita/reporting/templates" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/pkg/beacon" + "github.com/activecm/rita-legacy/reporting/templates" + "github.com/activecm/rita-legacy/resources" ) func printStrobes(db string, showNetNames bool, res *resources.Resources, logsGeneratedAt string) error { diff --git a/reporting/report-useragents.go b/reporting/report-useragents.go index 3628cf77..81f8ead4 100644 --- a/reporting/report-useragents.go +++ b/reporting/report-useragents.go @@ -5,9 +5,9 @@ import ( "html/template" "os" - "github.com/activecm/rita/pkg/useragent" - "github.com/activecm/rita/reporting/templates" - "github.com/activecm/rita/resources" + "github.com/activecm/rita-legacy/pkg/useragent" + "github.com/activecm/rita-legacy/reporting/templates" + "github.com/activecm/rita-legacy/resources" ) func printUserAgents(db string, showNetNames bool, res *resources.Resources, logsGeneratedAt string) error { diff --git a/reporting/report.go b/reporting/report.go index e6339a9e..a75ff801 100644 --- a/reporting/report.go +++ b/reporting/report.go @@ -9,9 +9,9 @@ import ( "strconv" "time" - htmlTempl "github.com/activecm/rita/reporting/templates" - "github.com/activecm/rita/resources" - "github.com/activecm/rita/util" + htmlTempl "github.com/activecm/rita-legacy/reporting/templates" + "github.com/activecm/rita-legacy/resources" + "github.com/activecm/rita-legacy/util" "github.com/skratchdot/open-golang/open" ) diff --git a/resources/logging.go b/resources/logging.go index d9e9628d..d003f3fd 100644 --- a/resources/logging.go +++ b/resources/logging.go @@ -9,11 +9,11 @@ import ( log "github.com/sirupsen/logrus" - "github.com/activecm/rita/config" + "github.com/activecm/rita-legacy/config" "github.com/rifflock/lfshook" ) -//DayFormat stores a correctly formatted timestamp for the day +// DayFormat stores a correctly formatted timestamp for the day const DayFormat string = "2006-01-02" // initLogger creates the logger for logging to stdout and file diff --git a/resources/resources.go b/resources/resources.go index 24c445d3..89d56d72 100644 --- a/resources/resources.go +++ b/resources/resources.go @@ -5,8 +5,8 @@ import ( "os" "github.com/activecm/mgorus" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" log "github.com/sirupsen/logrus" ) diff --git a/resources/testing.go b/resources/testing.go index 621e9fdf..8939dade 100644 --- a/resources/testing.go +++ b/resources/testing.go @@ -7,14 +7,14 @@ import ( "testing" "github.com/activecm/mgorus" - "github.com/activecm/rita/config" - "github.com/activecm/rita/database" + "github.com/activecm/rita-legacy/config" + "github.com/activecm/rita-legacy/database" ) -//InitIntegrationTestingResources creates a default testing -//resource bundle for use with integration testing. -//The MongoDB server is contacted via the URI provided -//as by go test -args [MongoDB URI]. +// InitIntegrationTestingResources creates a default testing +// resource bundle for use with integration testing. +// The MongoDB server is contacted via the URI provided +// as by go test -args [MongoDB URI]. func InitIntegrationTestingResources(t *testing.T) *Resources { if testing.Short() { t.Skip() @@ -62,8 +62,8 @@ func InitIntegrationTestingResources(t *testing.T) *Resources { return r } -//InitTestResources creates a default testing -//resource bundle for use with integration testing. +// InitTestResources creates a default testing +// resource bundle for use with integration testing. func InitTestResources() *Resources { conf, err := config.LoadTestingConfig("mongodb://localhost:27017") diff --git a/rita.go b/rita.go index 8072d995..7e1f4d62 100644 --- a/rita.go +++ b/rita.go @@ -4,8 +4,8 @@ import ( "os" "runtime" - "github.com/activecm/rita/commands" - "github.com/activecm/rita/config" + "github.com/activecm/rita-legacy/commands" + "github.com/activecm/rita-legacy/config" "github.com/urfave/cli" ) From 33d1ff244c168bf0971ddef393ae650f01cc8268 Mon Sep 17 00:00:00 2001 From: moth Date: Fri, 9 Jan 2026 19:48:08 -0700 Subject: [PATCH 3/5] Update CI/CD runner versions; Catch some straggling missing legacies (#837) --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- Contributing.md | 12 ++++++------ Dockerfile | 2 +- go.mod | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 677c167b..d8cf1498 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ on: jobs: upload: name: Upload Artifacts - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v1 - run: .github/release.sh rita install.sh diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index aebc4799..fab62bbb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ on: jobs: test: name: static and unit tests - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v1 - run: make docker-test diff --git a/Contributing.md b/Contributing.md index 16b04f43..1d103d2f 100644 --- a/Contributing.md +++ b/Contributing.md @@ -1,4 +1,4 @@ -# Contributing to RITA +# Contributing to RITA-Legacy --- @@ -19,13 +19,13 @@ Just be sure to do the following: - If an issue already exists, add the relevant info in a comment - If not, create an issue and include the relevant info - Give very specific descriptions of how to reproduce the bug -- Include the output of `rita --version` +- Include the output of `rita-legacy--version` - Include a description of your hardware (e.g. CPU, RAM, filesystems) - Tell us about the size of the test and the physical resources available ## Contributing Code -There are several ways to contribute code to the RITA project. +There are several ways to contribute code to the RITA-Legacy project. Before diving in, follow the [Manual Installation Instructions](docs/Manual%20Installation.md) - Work on bug fixes: @@ -36,7 +36,7 @@ Before diving in, follow the [Manual Installation Instructions](docs/Manual%20In ### Running Static Tests -- You must have a RITA [development environment](https://github.com/activecm/rita-legacy/blob/main/docs/Manual%20Installation.md#installing-golang) set up and [golangci-lint](https://github.com/golangci/golangci-lint#install) installed to run the tests. +- You must have a RITA-Legacy [development environment](https://github.com/activecm/rita-legacy/blob/main/docs/Manual%20Installation.md#installing-golang) set up and [golangci-lint](https://github.com/golangci/golangci-lint#install) installed to run the tests. - Check the [Makefile](https://github.com/activecm/rita-legacy/blob/main/Makefile) for all options. Currently you can run `make test`, `make static-test`, and `make unit-test`. There is also `make integration-test` and docker variants that will require you install docker as well. ### Reviewing Automated Test Results @@ -45,7 +45,7 @@ Automated tests are run against each pull request. Build results may be viewed [ ### Gittiquette Summary -- In order to contribute to RITA, you must [fork it](https://github.com/activecm/rita-legacy/fork). +- In order to contribute to RITA-Legacy, you must [fork it](https://github.com/activecm/rita-legacy/fork). - Once you have a forked repo you will need to clone it to a very specific path which corresponds to _the original repo location_. This is due to the way packages are imported in Go programs. - `git clone [your forked repo git url]` - Add `https://github.com/activecm/rita-legacy` as a new remote so you can pull new changes. @@ -61,5 +61,5 @@ Further info can be found in the [Gittiquette doc](docs/RITA%20Gittiquette.md) u ### Common Issues -- Building Rita using `go build` or `go install` yields a RITA version of `UNDEFINED` +- Building RITA-Legacy using `go build` or `go install` yields a RITA-Legacy version of `UNDEFINED` - Use `make` or `make install` instead diff --git a/Dockerfile b/Dockerfile index ca5eaf36..85484c66 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,6 +25,6 @@ FROM scratch WORKDIR / COPY --from=rita-builder /go/src/github.com/activecm/rita-legacy/etc/rita.yaml /etc/rita/config.yaml -COPY --from=rita-builder /go/src/github.com/activecm/rita-legacy/rita /rita +COPY --from=rita-builder /go/src/github.com/activecm/rita-legacy/rita-legacy /rita ENTRYPOINT ["/rita"] diff --git a/go.mod b/go.mod index 128623d3..4ac937ff 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/activecm/rita-legacy go 1.22 // If urfave/cli is updated from v1.20.0 the corresponding autocomplete file -// should be updated in etc/bash_completion.d/rita +// should be updated in etc/bash_completion.d/rita-legacy // https://github.com/urfave/cli/blob/main/autocomplete/bash_autocomplete require ( From a924fca88c9d0db681e9b6210d86f2878271b9c8 Mon Sep 17 00:00:00 2001 From: moth Date: Mon, 12 Jan 2026 13:00:23 -0700 Subject: [PATCH 4/5] Revert golang from v1.22 to v1.17 (#843) --- go.mod | 2 +- go.sum | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 4ac937ff..6d1dc252 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/activecm/rita-legacy -go 1.22 +go 1.17 // If urfave/cli is updated from v1.20.0 the corresponding autocomplete file // should be updated in etc/bash_completion.d/rita-legacy diff --git a/go.sum b/go.sum index 397c71ed..292126dd 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,7 @@ github.com/VividCortex/ewma v1.1.1 h1:MnEK4VOv6n0RSY4vtRe3h11qjxL3+t0B8yOL8iMXdc github.com/VividCortex/ewma v1.1.1/go.mod h1:2Tkkvm3sRDVXaiyucHiACn4cqf7DpdyLvmxzcbUokwA= github.com/activecm/mgorus v0.1.1 h1:v+DoSPWbbaNkwrJDwHI+nh0K7xEqktahimoWeo0jCOc= github.com/activecm/mgorus v0.1.1/go.mod h1:oCz/dUji4JsFLsc1EKfgsotg20uITyvjblxo1ieo8Bg= +github.com/activecm/mgosec v0.1.1/go.mod h1:XcwqX1en4L7Tfxd6r6NdstZt/cbArEg8OBZyUKf9HtU= github.com/activecm/mgosec v0.1.2-0.20191108195135-d918492993da h1:LXRJgg7iscvGezPD5CMWNaJDlmKd3r8gyEGMecIERWI= github.com/activecm/mgosec v0.1.2-0.20191108195135-d918492993da/go.mod h1:XcwqX1en4L7Tfxd6r6NdstZt/cbArEg8OBZyUKf9HtU= github.com/activecm/rita-bl v0.0.0-20220823191806-f014db21453d h1:chJrld/x2Q+3Uj/3TrkHTKIe4gcN7x9tSIAIrxcZIOQ= @@ -13,8 +14,10 @@ github.com/creasty/defaults v1.3.0/go.mod h1:CIEEvs7oIVZm30R8VxtFJs+4k201gReYyuY github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/globalsign/mgo v0.0.0-20180615134936-113d3961e731/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q= github.com/globalsign/mgo v0.0.0-20190517090918-73267e130ca1 h1:DQs0vsFrJDNGZovxiwBtuUaL0SLrQeNHkHpsIbi7w8U= github.com/globalsign/mgo v0.0.0-20190517090918-73267e130ca1/go.mod h1:OQBK0ebL25cW31topLSUPIWIrSesue7+zTa/haAXccQ= +github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= github.com/google/go-github v17.0.0+incompatible h1:N0LgJ1j65A7kfXrZnUDaYCs/Sf4rEjNlfyDHW9dolSY= @@ -22,6 +25,7 @@ github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+u github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/safebrowsing v0.0.0-20171128203709-fe6951d7ef01/go.mod h1:5s5M4BFXyqfUstbiDH1ClnS7VmZmDqUaY/X0Rqbfw3o= github.com/google/safebrowsing v0.0.0-20190214191829-0feabcc2960b h1:VnwTdca7ctu+Z5+ljDDtNUPVJmDbCOkWvQONMdSf+qs= github.com/google/safebrowsing v0.0.0-20190214191829-0feabcc2960b/go.mod h1:5s5M4BFXyqfUstbiDH1ClnS7VmZmDqUaY/X0Rqbfw3o= github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= @@ -68,10 +72,12 @@ github.com/vbauerster/mpb v3.3.4+incompatible/go.mod h1:zAHG26FUhVKETRu+MWqYXcI7 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550 h1:ObdrDkeb4kJdCP557AjRjq69pTHfNouLtWZG7j9rPN8= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/net v0.0.0-20180712202826-d0887baf81f4/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= From 36b04da82e73eeb8d146d25dd5f276c4db621e38 Mon Sep 17 00:00:00 2001 From: moth Date: Mon, 12 Jan 2026 15:54:38 -0700 Subject: [PATCH 5/5] Update Mongo to Address CVE-2025-14847 (#842) * Bump mongo version to address CVE, also update golang version in Dockerfile * Update test.Dockerfile to also use Golang 1.22 * Revert golang version in PR --- Makefile | 2 +- database/db.go | 2 +- docker-compose.yml | 4 ++-- install.sh | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 28f0f811..cde89a67 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ docker-check: .PHONY: integration-test integration-test: docker-check # docker run should only get executed once on initialization using the cache trick -integration-test: MONGO_EXE = $(shell docker run --rm -d mongo:4.2) +integration-test: MONGO_EXE = $(shell docker run --rm -d mongo:4.4) integration-test: MONGO_ID = $(call cache,MONGO_EXE) integration-test: MONGO_IP = $(shell docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(MONGO_ID)) integration-test: diff --git a/database/db.go b/database/db.go index cb7c6efb..df87b6f4 100644 --- a/database/db.go +++ b/database/db.go @@ -23,7 +23,7 @@ var MinMongoDBVersion = semver.Version{ // versions of MongoDB compatible with RITA var MaxMongoDBVersion = semver.Version{ Major: 4, - Minor: 3, + Minor: 5, Patch: 0, } diff --git a/docker-compose.yml b/docker-compose.yml index 5d4be3d6..8e213cf3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,12 +2,12 @@ version: "3" services: db: - image: mongo:4.2 + image: mongo:4.4.30 volumes: - db:/data/db/ rita: - image: quay.io/activecm/rita-legacy:${VERSION:-latest} + image: quay.io/activecm/rita:${VERSION:-latest} build: . links: # give db an alias of "localhost" so that RITA's default config works unchanged diff --git a/install.sh b/install.sh index 3ca695bf..16e01405 100755 --- a/install.sh +++ b/install.sh @@ -4,8 +4,8 @@ # activecountermeasures.com # CONSTANTS -_RITA_VERSION="v4.8.0" -_MONGO_VERSION="4.2" +_RITA_VERSION="v4.8.2" +_MONGO_VERSION="4.4" _MONGO_MIN_UPDATE_VERSION="4.0" _NAME=$(basename "${0}") _FAILED="\e[91mFAILED\e[0m"