Compare commits

..

No commits in common. "master" and "stable" have entirely different histories.

43 changed files with 246 additions and 8102 deletions

View File

@ -9,6 +9,7 @@ subprojects {
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'idea'
apply plugin: "signing"
apply plugin: 'net.ltgt.errorprone'
apply plugin: 'com.gradleup.shadow'
@ -25,6 +26,13 @@ subprojects {
mavenLocal()
}
// Resolving conflicting NameResolverProvider from grpc-core.jar and
// grpc-netty-shaded.jar, https://github.com/grpc/grpc-java/issues/10853
shadowJar {
zip64 true
mergeServiceFiles()
}
if (rootProject.properties.get('errorProne', true)) {
dependencies {
errorprone "com.google.errorprone:error_prone_core:2.38.0"
@ -76,6 +84,69 @@ subprojects {
}
plugins.withId('maven-publish') {
publishing {
publications {
maven(MavenPublication) {
from components.java
pom {
name = project.group + ':' + project.name
url = 'https://github.com/google/tsunami-security-scanner'
afterEvaluate {
// description is not available until evaluated.
description = project.description
}
licenses {
license {
name = 'Apache 2.0'
url = 'https://opensource.org/licenses/Apache-2.0'
}
}
scm {
connection = 'scm:git:https://github.com/google/tsunami-security-scanner.git'
developerConnection = 'scm:git:git@github.com:google/tsunami-security-scanner.git'
url = 'https://github.com/google/tsunami-security-scanner'
}
developers {
developer {
id = 'com.google.tsunami'
name = 'Tsunami Contributors'
email = 'tsunami-security-scanner@googlegroups.com'
url = 'https://github.com/google/tsunami-security-scanner'
organization = 'Tsunami Authors'
organizationUrl = 'https://www.google.com'
}
}
}
}
}
repositories {
maven {
def stagingUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def releaseUrl = stagingUrl
def snapshotUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
url = version.endsWith('SNAPSHOT') ? snapshotUrl : releaseUrl
credentials {
if (rootProject.hasProperty('ossrhUsername')
&& rootProject.hasProperty('ossrhPassword')) {
username = rootProject.ossrhUsername
password = rootProject.ossrhPassword
}
}
}
mavenLocal()
}
}
signing {
sign publishing.publications.maven
}
shadowJar {
archiveClassifier = null
}

View File

@ -4,16 +4,16 @@ dependencies {
implementation project(':tsunami-proto')
implementation "com.beust:jcommander:1.48"
implementation "com.google.auto.value:auto-value-annotations:1.11.0"
implementation "com.google.auto.value:auto-value-annotations:1.10.4"
implementation "com.google.cloud:google-cloud-storage:1.103.1"
implementation "com.google.code.gson:gson:2.10.1"
implementation "com.google.flogger:flogger-system-backend:0.9"
implementation "com.google.flogger:flogger:0.9"
implementation "com.google.flogger:google-extensions:0.9"
implementation "com.google.guava:guava:33.0.0-jre"
implementation "com.google.code.gson:gson:2.8.6"
implementation "com.google.flogger:flogger-system-backend:0.5.1"
implementation "com.google.flogger:flogger:0.5.1"
implementation "com.google.flogger:google-extensions:0.5.1"
implementation "com.google.guava:guava:28.2-jre"
implementation "com.google.inject:guice:6.0.0"
implementation "com.google.inject.extensions:guice-assistedinject:6.0.0"
implementation "com.google.truth:truth:1.4.4"
implementation "com.google.truth:truth:1.4.0"
implementation "com.squareup.okhttp3:okhttp:3.12.0"
implementation "io.github.classgraph:classgraph:4.8.65"
implementation "org.yaml:snakeyaml:1.26"
@ -25,11 +25,11 @@ dependencies {
annotationProcessor "com.google.auto.value:auto-value:1.10.4"
testAnnotationProcessor "com.google.auto.value:auto-value:1.10.4"
testImplementation "com.google.guava:guava-testlib:33.0.0-jre"
testImplementation "com.google.truth:truth:1.4.4"
testImplementation "com.google.truth.extensions:truth-java8-extension:1.4.4"
testImplementation "com.google.truth.extensions:truth-proto-extension:1.4.4"
testImplementation "com.google.guava:guava-testlib:28.2-jre"
testImplementation "com.google.truth:truth:1.4.0"
testImplementation "com.google.truth.extensions:truth-java8-extension:1.4.0"
testImplementation "com.google.truth.extensions:truth-proto-extension:1.4.0"
testImplementation "com.squareup.okhttp3:mockwebserver:3.12.0"
testImplementation "junit:junit:4.13.2"
testImplementation "org.mockito:mockito-core:5.18.0"
testImplementation "junit:junit:4.13"
testImplementation "org.mockito:mockito-core:5.12.0"
}

View File

@ -12,11 +12,6 @@ RUN cp ./tsunami_tcs.yaml /usr/tsunami/tsunami.yaml
RUN cp plugin/src/main/resources/com/google/tsunami/plugin/payload/payload_definitions.yaml /usr/tsunami/payload_definitions.yaml
RUN cp -r plugin_server/py/ /usr/tsunami/py_server
## We perform a hotpatch of the path pointing to the payload definitions file
## for easier usage in the Dockerized environment.
RUN sed -i "s%'../../plugin/src/main/resources/com/google/tsunami/plugin/payload/payload_definitions.yaml'%'/usr/tsunami/payload_definitions.yaml'%g" \
/usr/tsunami/py_server/plugin/payload/payload_utility.py
## generate the protos for Python plugins
WORKDIR /usr/repos/tsunami-security-scanner/
RUN python3 -m grpc_tools.protoc \

View File

@ -28,4 +28,5 @@ COPY plugin_server/py/requirements.in /usr/tsunami/py_venv/requirements.in
COPY plugin_server/py/requirements.txt /usr/tsunami/py_venv/requirements.txt
RUN python3 -m venv /usr/tsunami/py_venv
ENV PATH="/usr/tsunami/py_venv/bin:${PATH}"
RUN pip install --require-hashes -r /usr/tsunami/py_venv/requirements.txt
RUN pip install setuptools \
&& pip install --require-hashes -r /usr/tsunami/py_venv/requirements.txt

View File

@ -1,99 +0,0 @@
# October update - Tsunami reward program
## Improving the PRP situation
Since our
[last update in June](https://google.github.io/tsunami-security-scanner/2025/06/18/changes-to-tsunami.html),
we have made good progress on merging incoming pull requests. Not only do we now
have a very low amount of requests to process, but most of them are now
implemented with the
[new templated language system](https://google.github.io/tsunami-security-scanner/howto/new-detector/templated/00-getting-started)
which is usually faster for us to merge.
**A big thank you to all of our contributors for their patience\!**
## An update on the payouts
Note:
[Our official rules](https://bughunters.google.com/about/rules/open-source/5067456626688000/tsunami-patch-rewards-program-rules)
have been updated accordingly.
We recently came to realize that our current payout system made the decision for
the reward difficult. To ensure everyone is rewarded fairly and adequately, we
have decided to simplify the payout system:
Type of detector | Reward (up to dollars)
:--------------------------------------------------: | :--------------------:
Wishlist detector | 3177.13
Exposed interface detector Weak credentials detector | 2000
Other detectors | 1500
### What is a wishlist detector?
This is a detector for a vulnerability that Google cares deeply about. We
understand that this is outside of the control of the contributors but this is
generally based on internal priorities.
We will generally make it explicit that a contribution falls in that category
but on the other hand, we might request that the detector is completed in a
faster timeline (less than a week) to justify the higher payout. Sometimes we
will release a wishlist to the public if you pick up an item from that
wishlist, you are guaranteed to fall into this category.
### What happened to fingerprints?
We are not accepting new fingerprinting contributions for now. **Note that pull
requests already opened will be processed and paid as previously agreed upon.**
We are currently working on completely changing the way Tsunami performs
fingerprinting. Amongst other things, we are experimenting with rewriting that
specific portion of the scanner in Golang to measure how well the language
matches our needs.
## An insight into our triage decisions
We also understand that it might be difficult to understand how and why we
decide to accept some contributions and not others, so we wanted to provide some
visibility into that process.
First and foremost, the goal of Tsunami is to find impactful vulnerabilities.
**This generally means that we want to identify security issues that have a
strong impact; this generally translates to remote code execution (RCE).**
**The questions that we are always asking ourselves:**
* Can this be turned into a full-chain to remote code execution?
* Can the full-chain be implemented in the detector? Or be reliable enough
that it can ascertain the full chain exploitability?
Here is an example table for common vulnerability types:
| Category | Decision |
| :----------------------: | :-------------: |
| XSS | Rejected |
| CSRF | Rejected |
| SSRF | Likely rejected |
| SQLi | Likely rejected |
| Local file include | It depends |
| Path traversal | It depends |
| XXE | It depends |
| Remote file include | Likely accepted |
| File upload | Likely accepted |
| Exposed interface | Likely accepted |
| Authentication bypass | Likely accepted |
| Weak credentials | Likely accepted |
| OS command injection | Likely accepted |
As mentioned before, that decision depends heavily on the ability to create a
full chain of exploitation that leads to remote code execution.
## Tsunami versioning
As we previously announced, we are slowly dropping Maven releases in favor of
our Docker images and direct dependencies to GitHub. We are already not
publishing any new artifacts to Maven and encourage you **strongly** to migrate
to building with the GitHub code.
This change slightly increases overall maintenance of plugins for larger changes
of the core but ensures that issues do not go unnoticed and also makes
dependencies management a lot easier for us.

View File

@ -1,6 +1,6 @@
# Build and run Tsunami
## Tsunami docker's environment
## Using Docker
We provide a set of Docker images to help you build and use Tsunami. We provide
a minimal (scratch) image for:
@ -14,230 +14,72 @@ on top of them.
![docker-images](img/docker-images.png)
## Running the latest version of Tsunami
If you just want to run the latest version of Tsunami, without having to
recompile anything, you can directly use the latest full image of Tsunami.
```sh
# Important: If you built a local version of the container, do not pull as it
# will overwrite your changes. Otherwise, do pull as you would be using a stale
# version of the image.
$ docker pull ghcr.io/google/tsunami-scanner-full
# Run the image
$ docker run -it --rm ghcr.io/google/tsunami-scanner-full bash
# If you want to use Python plugins
(docker) $ tsunami-py-server >/tmp/py_server.log 2>&1 &
# If you want to use the callback server
(docker) $ tsunami-tcs >/tmp/tcs_server.log 2>&1 &
# Run Tsunami
# Note: If you did not start the python server, omit the `--python-` arguments.
(docker) $ tsunami --ip-v4-target=127.0.0.1 --python-plugin-server-address=127.0.0.1 --python-plugin-server-port=34567
```
This images contains everything necessary under the `/usr/tsunami` directory.
To use the callback server, you might have to setup port forwarding with your
docker container when starting it. We encourage you to refer to the `-p` option
of Docker.
A few tips:
- Only scan one port: `--port-ranges-target`
- Only run your detector: `--detectors-include="detector-name"`; where detector
name is the name defined in `PluginInfo` section for Java and Python plugins and
the `info.name` section on templated plugins.
## Using docker to build Tsunami
In this section, we go through the different ways to compile the core engine
or a plugin locally so that you can test your changes.
It assumes that you have cloned both the `tsunami-security-scanner` and
`tsunami-security-scanner-plugins` repositories.
### Rebuilding the core engine
If you need to make changes to the core engine during the development cycle, you
will have to perform the following actions to test your change:
- Rebuild the core engine container;
```sh
# Build the core engine container
$ cd tsunami-security-scanner
$ docker build -t ghcr.io/google/tsunami-scanner-core:latest -f core.Dockerfile .
```
- Rebuild all plugins to ensure your change is compatible
IMPORTANT: Your changes must be committed via git to be picked. They do not need
to be pushed to GitHub, they can be local only.
In the following example, we will use docker volumes to mount our changes to
`/usr/tsunami/repos/tsunami-security-scanner`. This assumes that our
`tsunami-security-scanner` and `tsunami-security-scanner-plugins` clones are in
`/tsunami/` on our host. Also, our changes are committed to the `master` branch.
You can change the commands accordingly if your repositories path or branch are
different.
```sh
$ cd tsunami-security-scanner-plugins
```
First, we need to change the `Dockerfile` to use our changes:
```diff
-ENV GITREPO_TSUNAMI_CORE="https://github.com/google/tsunami-security-scanner.git"
-ENV GITBRANCH_TSUNAMI_CORE="stable"
+ENV GITREPO_TSUNAMI_CORE="/usr/tsunami/repos/tsunami-security-scanner"
+ENV GITBRANCH_TSUNAMI_CORE="master"
```
We also need to instruct docker to bind our changes in `/usr/tsunami/repos`:
```diff
- RUN gradle build
+ RUN --mount=type=bind,source=/tsunami-security-scanner,target=/usr/tsunami/repos/tsunami-security-scanner \
+ gradle build
+
```
Then we can rebuild all plugins in one swoop:
```sh
$ docker build -t ghcr.io/google/tsunami-plugins-all:latest --build-arg=TSUNAMI_PLUGIN_FOLDER=tsunami-security-scanner-plugins -f tsunami-security-scanner-plugins/Dockerfile /tsunami/
```
- Rebuild the `-full` container;
```sh
$ cd tsunami-security-scanner
```
We need to change the `full.Dockerfile` to use our newly created container:
```diff
# Plugins
- FROM ghcr.io/google/tsunami-plugins-google:latest AS plugins-google
- FROM ghcr.io/google/tsunami-plugins-templated:latest AS plugins-templated
- FROM ghcr.io/google/tsunami-plugins-doyensec:latest AS plugins-doyensec
- FROM ghcr.io/google/tsunami-plugins-community:latest AS plugins-community
- FROM ghcr.io/google/tsunami-plugins-govtech:latest AS plugins-govtech
- FROM ghcr.io/google/tsunami-plugins-facebook:latest AS plugins-facebook
- FROM ghcr.io/google/tsunami-plugins-python:latest AS plugins-python
+ FROM ghcr.io/google/tsunami-plugins-all:latest AS plugins-all
{...}
- COPY --from=plugins-google /usr/tsunami/plugins/ /usr/tsunami/plugins/
- COPY --from=plugins-templated /usr/tsunami/plugins/ /usr/tsunami/plugins/
- COPY --from=plugins-doyensec /usr/tsunami/plugins/ /usr/tsunami/plugins/
- COPY --from=plugins-community /usr/tsunami/plugins/ /usr/tsunami/plugins/
- COPY --from=plugins-govtech /usr/tsunami/plugins/ /usr/tsunami/plugins/
- COPY --from=plugins-facebook /usr/tsunami/plugins/ /usr/tsunami/plugins/
- COPY --from=plugins-python /usr/tsunami/py_plugins/ /usr/tsunami/py_plugins/
+ COPY --from=plugins-all /usr/tsunami/plugins/ /usr/tsunami/plugins/
```
And then rebuild it:
```sh
$ docker build -t ghcr.io/google/tsunami-scanner-full:latest -f full.Dockerfile .
```
- Run the scanner to check that everything works.
See the "Running the latest version of Tsunami" section on this page to run
Tsunami with the newly built image. DO NOT perform a docker pull.
### Rebuilding a whole category of plugins
Tsunami groups plugins per categories. From the root folder of the plugin
repository, you can see that the categories are `google`, `community`,
`templated` and so on.
Our docker images are built separately for each category. The same Dockerfile
is used, but it is parameterized to use a different folder with
`TSUNAMI_PLUGIN_FOLDER`.
```sh
$ cd tsunami-security-scanner-plugins
$ build -t ghcr.io/google/tsunami-plugins-category:latest --build-arg TSUNAMI_PLUGIN_FOLDER=category .
# For example with the community category:
$ build -t ghcr.io/google/tsunami-plugins-community:latest --build-arg TSUNAMI_PLUGIN_FOLDER=community .
```
For **Python plugins**, you need to use the dedicated Dockerfile, which only
supports bundling all plugins:
```sh
$ cd tsunami-security-scanner-plugins
$ build -t ghcr.io/google/tsunami-plugins-python:latest -f python.Dockerfile .
```
Once you have rebuilt the categories that you need, you can rebuild the `-full`
If you just intend to run Tsunami, we recommend using the latest complete
image:
```sh
$ cd tsunami-security-scanner
$ docker build -t ghcr.io/google/tsunami-scanner-full:latest -f full.Dockerfile .
$ docker pull ghcr.io/google/tsunami-scanner-full # make sure to use the latest
$ docker run -it --rm ghcr.io/google/tsunami-scanner-full bash
# note: you will need to install a port scanner and a credential brute-forcer.
# We recommend installing nmap and ncrack using apt.
(docker) $ tsunami-py-server # run the Python server
(docker) $ tsunami-tcs ## runs the callback server
(docker) $ tsunami-linter ## linter for the templated language
## starts tsunami and connect to the Python server
(docker) $ tsunami --ip-v4-target=127.0.0.1 --python-plugin-server-address=127.0.0.1 --python-plugin-server-port=34567
```
Then follow "Running the latest version of Tsunami" to use this new image. DO
NOT perform a `docker pull`.
Configuration files can be found in `/usr/tsunami/tsunami.yaml` for the scanner
and `/usr/tsunami/tcs_config.yaml` for the callback server.
### Building an image for one plugin
Also note that to use the callback server, you might have to setup port
forwarding with your docker when starting it. We encourage you to refer to the
`-p` option of Docker.
Now, if during development you only wish to build your plugin, you can do so
by creating a new local-only category.
## Development workflow
Before you start, you will need to change the definition of the
`full.Dockerfile` file:
To set-up your own development workflow, we recommend composing on top of the
tsunami full image but to delete existing plugins to minimize noise:
- Add a `FROM` directive in the Plugins section:
```dockerfile
FROM ghcr.io/google/tsunami-scanner-full:latest AS full
FROM ghcr.io/google/tsunami-scanner-devel:latest AS devel
```diff
FROM ghcr.io/google/tsunami-plugins-python:latest AS plugins-python
+ FROM ghcr.io/google/tsunami-plugins-local:latest AS plugins-local
WORKDIR /usr/tsunami
COPY --from=full /usr/tsunami /usr/tsunami/
COPY --from=full /usr/bin/tsunami /usr/bin/tsunami
COPY --from=full /usr/bin/tsunami-tcs /usr/bin/tsunami-tcs
RUN rm -f /usr/tsunami/plugins/*
```
- Add a `COPY` directive in the section that copies everything:
```diff
COPY --from=plugins-python /usr/tsunami/py_plugins/ /usr/tsunami/py_plugins/
+ COPY --from=plugins-local /usr/tsunami/plugins/ /usr/tsunami/plugins/
```
Then, you can build the actual image containing only your plugin:
You can then build that image and use it with your local copy of the plugins,
where `/path/to/my/plugin` must point to your plugin. This is usually the folder
containing your `build.gradle` if using Java or the `templated` folder of the
plugins repository if using templated plugins.
```sh
$ cd tsunami-security-scanner-plugins
$ build -t ghcr.io/google/tsunami-plugins-local:latest --build-arg TSUNAMI_PLUGIN_FOLDER=path/to/my/plugin .
$ docker pull ghcr.io/google/tsunami-scanner-full:latest
$ docker pull ghcr.io/google/tsunami-scanner-devel:latest
$ docker build -t tsunadev:latest . -f myDockerfile
$ docker run -it --rm -v /path/to/my/plugin:/usr/tsunami/repos/myplugin tsunadev:latest bash
## Java plugins
(docker) $ cd /usr/tsunami/repos/myplugin
(docker) $ gradle build
(docker) $ cp build/libs/*.jar /usr/tsunami/plugins
## Templated plugins
(docker) $ cd /usr/tsunami/repos/myplugin/templateddetector
(docker) $ gradle build
(docker) $ cp build/libs/*.jar /usr/tsunami/plugins
## Once the plugin is added, you can run Tsunami
(docker) $ tsunami --ip-v4-target=127.0.0.1
## If you need to run Python plugins
(docker) $ tsunami-py-server >/tmp/py_server.log 2>&1 &
(docker) $ tsunami --ip-v4-target=127.0.0.1 --python-plugin-server-address=127.0.0.1 --python-plugin-server-port=34567
```
Finally, compile the `-full` image:
```sh
$ cd tsunami-security-scanner
$ docker build -t ghcr.io/google/tsunami-scanner-full:latest -f full.Dockerfile .
```
Then follow "Running the latest version of Tsunami" to use this new image. DO
NOT perform a `docker pull`.
**Python plugins** do not support building only one plugin. See building the
whole category instead.
## Building Tsunami without docker
We do not provide support for building Tsunami outside of our docker
environment.
You can use the Dockerfile provided in the repositories to build your own
toolchain if you so wish.

View File

@ -5,11 +5,11 @@ This page contains information to get you started with your first contributions.
## Contributing to Google code
- [Contributing rules]({{ site.baseurl }}/contribute/index)
- [Contributing rules]({{ site.baseurl }}/contribute/index.md)
## Understanding Tsunami
- [About Tsunami]({{ site.baseurl }}/about/index)
- [About Tsunami]({{ site.baseurl }}/about/index.md)
- [How tsunami works]({{ site.baseurl }}/howto/orchestration)
## Building and running Tsunami

View File

@ -41,17 +41,11 @@ RUN go install github.com/google/tsunami-security-scanner-plugins/templated/util
# Symlink the Python plugins so that they are discoverable by Python.
RUN ln -s /usr/tsunami/py_plugins/ /usr/tsunami/py_server/py_plugins
# Create the __init__.py files to ensure all plugins are discoverable.
RUN find /usr/tsunami/py_plugins/ \
-type d \
! -name '__pycache__' \
-exec touch '{}/__init__.py' \;
# Create wrapper scripts
WORKDIR /usr/tsunami
RUN echo '#!/bin/bash\njava -cp /usr/tsunami/tsunami.jar:/usr/tsunami/plugins/* -Dtsunami.config.location=/usr/tsunami/tsunami.yaml com.google.tsunami.main.cli.TsunamiCli $*\n' > /usr/bin/tsunami \
&& chmod +x /usr/bin/tsunami \
&& echo '#!/bin/bash\njava -cp /usr/tsunami/tsunami-tcs.jar com.google.tsunami.callbackserver.main.TcsMain --custom-config=/usr/tsunami/tcs_config.yaml $*\n' > /usr/bin/tsunami-tcs \
&& chmod +x /usr/bin/tsunami-tcs \
&& echo '#!/bin/bash\n/usr/tsunami/py_venv/bin/python3 /usr/tsunami/py_server/plugin_server.py $*\n' > /usr/bin/tsunami-py-server \
&& echo '#!/bin/bash\n/usr/tsunami/py_venv/bin/python3 /usr/tsunami/py_server/plugin_server.py --payload_file_path="/usr/tsunami/payload_definitions.yaml" $*\n' > /usr/bin/tsunami-py-server \
&& chmod +x /usr/bin/tsunami-py-server

View File

@ -14,11 +14,11 @@ dependencies {
implementation "com.beust:jcommander:1.48"
implementation "com.doyensec:libajp:1.0.0"
implementation "com.google.cloud:google-cloud-storage:1.103.1"
implementation "com.google.flogger:flogger:0.9"
implementation "com.google.flogger:google-extensions:0.9"
implementation "com.google.guava:guava:33.0.0-jre"
implementation "com.google.flogger:flogger:0.5.1"
implementation "com.google.flogger:google-extensions:0.5.1"
implementation "com.google.guava:guava:28.2-jre"
implementation "com.google.inject:guice:6.0.0"
implementation "com.google.protobuf:protobuf-java:3.25.5"
implementation "com.google.protobuf:protobuf-java:3.25.2"
implementation "io.github.classgraph:classgraph:4.8.65"
implementation "io.grpc:grpc-netty:1.60.0"
implementation "javax.inject:javax.inject:1"
@ -26,11 +26,11 @@ dependencies {
runtimeOnly "org.glassfish.jaxb:jaxb-runtime:2.3.1"
testImplementation "com.google.truth:truth:1.4.4"
testImplementation "com.google.truth.extensions:truth-java8-extension:1.4.4"
testImplementation "com.google.truth.extensions:truth-proto-extension:1.4.4"
testImplementation "junit:junit:4.13.2"
testImplementation "org.mockito:mockito-core:5.18.0"
testImplementation "com.google.truth:truth:1.4.0"
testImplementation "com.google.truth.extensions:truth-java8-extension:1.4.0"
testImplementation "com.google.truth.extensions:truth-proto-extension:1.4.0"
testImplementation "junit:junit:4.13"
testImplementation "org.mockito:mockito-core:5.12.0"
}
application {
@ -60,8 +60,3 @@ tasks.named("startShadowScripts") {
tasks.named("compileJava") {
dependsOn(":tsunami-plugin:shadowJar")
}
tasks.named('compileJava') {
dependsOn(':tsunami-proto:shadowJar')
dependsOn(':tsunami-workflow:shadowJar')
}

View File

@ -1,28 +1,26 @@
description = 'Tsunami: Plugin'
def tcsRepoBranch = System.getenv("GITBRANCH_TSUNAMI_TCS") ?: "stable"
dependencies {
implementation project(':tsunami-common')
implementation project(':tsunami-proto')
implementation("com.google.tsunami:tcs-common") {
version { branch = "${tcsRepoBranch}" }
version { branch = "stable" }
}
implementation("com.google.tsunami:tcs-proto") {
version { branch = "${tcsRepoBranch}" }
version { branch = "stable" }
}
implementation "com.beust:jcommander:1.48"
implementation "com.google.auto.value:auto-value-annotations:1.11.0"
implementation "com.google.code.gson:gson:2.10.1"
implementation "com.google.flogger:flogger:0.9"
implementation "com.google.flogger:google-extensions:0.9"
implementation "com.google.guava:guava:33.0.0-jre"
implementation "com.google.auto.value:auto-value-annotations:1.10.4"
implementation "com.google.code.gson:gson:2.8.6"
implementation "com.google.flogger:flogger:0.5.1"
implementation "com.google.flogger:google-extensions:0.5.1"
implementation "com.google.guava:guava:28.2-jre"
implementation "com.google.http-client:google-http-client:1.44.1"
implementation "com.google.inject:guice:6.0.0"
implementation "com.google.protobuf:protobuf-java-util:3.25.5"
implementation "com.google.protobuf:protobuf-java:3.25.5"
implementation "com.google.protobuf:protobuf-java-util:3.25.2"
implementation "com.google.protobuf:protobuf-java:3.25.2"
implementation "com.squareup.okhttp3:mockwebserver:3.12.0"
implementation "io.github.classgraph:classgraph:4.8.65"
implementation "io.grpc:grpc-context:1.60.0"
@ -35,12 +33,12 @@ dependencies {
annotationProcessor "com.google.auto.value:auto-value:1.10.4"
testImplementation "com.google.guava:guava-testlib:33.0.0-jre"
testImplementation "com.google.truth:truth:1.4.4"
testImplementation "com.google.truth.extensions:truth-java8-extension:1.4.4"
testImplementation "com.google.truth.extensions:truth-proto-extension:1.4.4"
testImplementation "com.google.guava:guava-testlib:28.2-jre"
testImplementation "com.google.truth:truth:1.4.0"
testImplementation "com.google.truth.extensions:truth-java8-extension:1.4.0"
testImplementation "com.google.truth.extensions:truth-proto-extension:1.4.0"
testImplementation "com.squareup.okhttp3:mockwebserver:3.12.0"
testImplementation "junit:junit:4.13.2"
testImplementation "junit:junit:4.13"
}
tasks.named("compileJava") {

View File

@ -7,7 +7,6 @@ also needs the modification.
import socket
from typing import Optional
import urllib.parse
from common.data import network_endpoint_utils
import network_pb2
@ -184,7 +183,7 @@ def get_address_family(address_family: socket.AddressFamily) -> AddressFamily:
raise ValueError("Invalid address family: %s" % address_family)
def sanitize_port(port: Optional[int], scheme: str) -> int:
def sanitize_port(port: int or None, scheme: str) -> int:
if isinstance(port, type(None)):
return get_port(-1, scheme)
return get_port(port, scheme)

View File

@ -7,7 +7,7 @@ from absl.testing import absltest
from absl.testing import parameterized
import requests_mock
from google.protobuf import wrappers_pb2
from google3.google.protobuf import wrappers_pb2
from common.net.http.requests_http_client import RequestsHttpClientBuilder
from plugin.payload.payload_generator import PayloadGenerator
from plugin.payload.payload_generator_test_helper import ANY_SSRF_CONFIG

View File

@ -19,7 +19,7 @@ import time
from absl.testing import absltest
import grpc_testing
from google.protobuf import timestamp_pb2
from google3.google.protobuf import timestamp_pb2
import plugin_service
import tsunami_plugin
from common.net.http.http_client import HttpClient
@ -43,8 +43,7 @@ _PluginInfo = plugin_representation_pb2.PluginInfo
_TargetInfo = reconnaissance_pb2.TargetInfo
_AddressFamily = network_pb2.AddressFamily
_ServiceDescriptor = plugin_service_pb2.DESCRIPTOR.services_by_name[
'PluginService'
]
'PluginService']
_RunMethod = _ServiceDescriptor.methods_by_name['Run']
_ListPluginsMethod = _ServiceDescriptor.methods_by_name['ListPlugins']
MAX_WORKERS = 1
@ -111,10 +110,8 @@ class PluginServiceTest(absltest.TestCase):
self.assertLen(response.reports.detection_reports, 1)
self.assertEqual(
plugin_to_test._BuildFakeDetectionReport(
target=target, network_service=services[0]
),
response.reports.detection_reports[0],
)
target=target, network_service=services[0]),
response.reports.detection_reports[0])
def test_run_no_plugins_registered_returns_empty_response(self):
endpoint = _build_network_endpoint('1.1.1.1', 80)
@ -132,18 +129,14 @@ class PluginServiceTest(absltest.TestCase):
response, _, _, _ = rpc.termination()
self.assertEqual(
plugin_service.ListPluginsResponse(
plugins=[self.test_plugin.GetPluginDefinition()]
),
response,
)
plugins=[self.test_plugin.GetPluginDefinition()]), response)
def _build_network_endpoint(ip: str, port: int) -> _NetworkEndpoint:
return _NetworkEndpoint(
type=_NetworkEndpoint.IP,
ip_address=network_pb2.IpAddress(address_family=_get_address_family(ip)),
port=network_pb2.Port(port_number=port),
)
port=network_pb2.Port(port_number=port))
def _get_address_family(ip: str) -> _AddressFamily:
@ -167,19 +160,6 @@ class FakeVulnDetector(tsunami_plugin.VulnDetector):
self.http_client = http_client
self.payload_generator = payload_generator
def GetAdvisories(self) -> list[vulnerability_pb2.Vulnerability]:
"""Returns the advisories for this plugin."""
return [
vulnerability_pb2.Vulnerability(
main_id=vulnerability_pb2.VulnerabilityId(
publisher='GOOGLE', value='FakeVuln1'
),
severity=vulnerability_pb2.CRITICAL,
title='FakeTitle1',
description='FakeDescription1',
),
]
def GetPluginDefinition(self):
return tsunami_plugin.PluginDefinition(
info=_PluginInfo(
@ -187,23 +167,17 @@ class FakeVulnDetector(tsunami_plugin.VulnDetector):
name='fake',
version='v0.1',
description='fake description',
author='fake author',
),
author='fake author'),
target_service_name=plugin_representation_pb2.TargetServiceName(
value=['fake service']
),
value=['fake service']),
target_software=plugin_representation_pb2.TargetSoftware(
name='fake software'
),
for_web_service=False,
)
name='fake software'),
for_web_service=False)
def Detect(self, target, matched_services):
return detection_pb2.DetectionReportList(
detection_reports=[
self._BuildFakeDetectionReport(target, matched_services[0])
]
)
return detection_pb2.DetectionReportList(detection_reports=[
self._BuildFakeDetectionReport(target, matched_services[0])
])
def _BuildFakeDetectionReport(self, target, network_service):
return detection_pb2.DetectionReport(
@ -211,8 +185,12 @@ class FakeVulnDetector(tsunami_plugin.VulnDetector):
network_service=network_service,
detection_timestamp=timestamp_pb2.Timestamp(nanos=1234567890),
detection_status=detection_pb2.VULNERABILITY_VERIFIED,
vulnerability=self.GetAdvisories()[0],
)
vulnerability=vulnerability_pb2.Vulnerability(
main_id=vulnerability_pb2.VulnerabilityId(
publisher='GOOGLE', value='FakeVuln1'),
severity=vulnerability_pb2.CRITICAL,
title='FakeTitle1',
description='FakeDescription1'))
# TODO(b/239628051): Add a failed VulnDetector class to test failed cases.

View File

@ -1,6 +1,6 @@
absl-py==2.1.0
aenum==3.1.15
certifi==2024.7.4
certifi==2024.2.2
charset-normalizer==3.3.2
glog==0.3.1
grpcio==1.63.0
@ -8,12 +8,10 @@ grpcio-health-checking==1.63.0
grpcio-reflection==1.63.0
grpcio-tools==1.63.0
idna==3.7
protobuf==5.29.5
protobuf==5.26.1
python-gflags==3.1.2
pyzmq==27.0.1
requests==2.32.4
requests-mock==1.12.1
requests==2.31.0
ruamel.yaml==0.18.6
ruamel.yaml.clib==0.2.8
six==1.16.0
urllib3==2.6.0
urllib3==2.2.1

View File

@ -1,8 +1,8 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --allow-unsafe --generate-hashes requirements.in
# pip-compile --generate-hashes requirements.in
#
absl-py==2.1.0 \
--hash=sha256:526a04eadab8b4ee719ce68f204172ead1027549089702d99b9059f129ff1308 \
@ -13,9 +13,9 @@ aenum==3.1.15 \
--hash=sha256:8cbd76cd18c4f870ff39b24284d3ea028fbe8731a58df3aa581e434c575b9559 \
--hash=sha256:e0dfaeea4c2bd362144b87377e2c61d91958c5ed0b4daf89cb6f45ae23af6288
# via -r requirements.in
certifi==2024.7.4 \
--hash=sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b \
--hash=sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90
certifi==2024.2.2 \
--hash=sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f \
--hash=sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1
# via
# -r requirements.in
# requests
@ -231,18 +231,18 @@ idna==3.7 \
# via
# -r requirements.in
# requests
protobuf==5.29.5 \
--hash=sha256:3f1c6468a2cfd102ff4703976138844f78ebd1fb45f49011afc5139e9e283079 \
--hash=sha256:3f76e3a3675b4a4d867b52e4a5f5b78a2ef9565549d4037e06cf7b0942b1d3fc \
--hash=sha256:470f3af547ef17847a28e1f47200a1cbf0ba3ff57b7de50d22776607cd2ea353 \
--hash=sha256:63848923da3325e1bf7e9003d680ce6e14b07e55d0473253a690c3a8b8fd6e61 \
--hash=sha256:6cf42630262c59b2d8de33954443d94b746c952b01434fc58a417fdbd2e84bd5 \
--hash=sha256:6f642dc9a61782fa72b90878af134c5afe1917c89a568cd3476d758d3c3a0736 \
--hash=sha256:7318608d56b6402d2ea7704ff1e1e4597bee46d760e7e4dd42a3d45e24b87f2e \
--hash=sha256:bc1463bafd4b0929216c35f437a8e28731a2b7fe3d98bb77a600efced5a15c84 \
--hash=sha256:e38c5add5a311f2a6eb0340716ef9b039c1dfa428b28f25a7838ac329204a671 \
--hash=sha256:ef91363ad4faba7b25d844ef1ada59ff1604184c0bcd8b39b8a6bef15e1af238 \
--hash=sha256:fa18533a299d7ab6c55a238bf8629311439995f2e7eca5caaff08663606e9015
protobuf==5.26.1 \
--hash=sha256:38aa5f535721d5bb99861166c445c4105c4e285c765fbb2ac10f116e32dcd46d \
--hash=sha256:3c388ea6ddfe735f8cf69e3f7dc7611e73107b60bdfcf5d0f024c3ccd3794e23 \
--hash=sha256:7ee014c2c87582e101d6b54260af03b6596728505c79f17c8586e7523aaa8f8c \
--hash=sha256:8ca2a1d97c290ec7b16e4e5dff2e5ae150cc1582f55b5ab300d45cb0dfa90e51 \
--hash=sha256:9b557c317ebe6836835ec4ef74ec3e994ad0894ea424314ad3552bc6e8835b4e \
--hash=sha256:b9ba3ca83c2e31219ffbeb9d76b63aad35a3eb1544170c55336993d7a18ae72c \
--hash=sha256:d693d2504ca96750d92d9de8a103102dd648fda04540495535f0fec7577ed8fc \
--hash=sha256:da612f2720c0183417194eeaa2523215c4fcc1a1949772dc65f05047e08d5932 \
--hash=sha256:e6039957449cb918f331d32ffafa8eb9255769c96aa0560d9a5bf0b4e00a2a33 \
--hash=sha256:f7417703f841167e5a27d48be13389d52ad705ec09eade63dfc3180a959215d7 \
--hash=sha256:fbfe61e7ee8c1860855696e3ac6cfd1b01af5498facc6834fcc345c9684fb2ca
# via
# -r requirements.in
# grpcio-health-checking
@ -253,109 +253,9 @@ python-gflags==3.1.2 \
# via
# -r requirements.in
# glog
pyzmq==27.0.1 \
--hash=sha256:05a94233fdde585eb70924a6e4929202a747eea6ed308a6171c4f1c715bbe39e \
--hash=sha256:092f4011b26d6b0201002f439bd74b38f23f3aefcb358621bdc3b230afc9b2d5 \
--hash=sha256:0ec09073ed67ae236785d543df3b322282acc0bdf6d1b748c3e81f3043b21cb5 \
--hash=sha256:0f772eea55cccce7f45d6ecdd1d5049c12a77ec22404f6b892fae687faa87bee \
--hash=sha256:0fc24bf45e4a454e55ef99d7f5c8b8712539200ce98533af25a5bfa954b6b390 \
--hash=sha256:119ce8590409702394f959c159d048002cbed2f3c0645ec9d6a88087fc70f0f1 \
--hash=sha256:1843fd0daebcf843fe6d4da53b8bdd3fc906ad3e97d25f51c3fed44436d82a49 \
--hash=sha256:19dce6c93656f9c469540350d29b128cd8ba55b80b332b431b9a1e9ff74cfd01 \
--hash=sha256:1c363c6dc66352331d5ad64bb838765c6692766334a6a02fdb05e76bd408ae18 \
--hash=sha256:1d59dad4173dc2a111f03e59315c7bd6e73da1a9d20a84a25cf08325b0582b1a \
--hash=sha256:1da8e645c655d86f0305fb4c65a0d848f461cd90ee07d21f254667287b5dbe50 \
--hash=sha256:2329f0c87f0466dce45bba32b63f47018dda5ca40a0085cc5c8558fea7d9fc55 \
--hash=sha256:27a78bdd384dbbe7b357af95f72efe8c494306b5ec0a03c31e2d53d6763e5307 \
--hash=sha256:2852f67371918705cc18b321695f75c5d653d5d8c4a9b946c1eec4dab2bd6fdf \
--hash=sha256:313a7b374e3dc64848644ca348a51004b41726f768b02e17e689f1322366a4d9 \
--hash=sha256:351bf5d8ca0788ca85327fda45843b6927593ff4c807faee368cc5aaf9f809c2 \
--hash=sha256:4401649bfa0a38f0f8777f8faba7cd7eb7b5b8ae2abc7542b830dd09ad4aed0d \
--hash=sha256:44909aa3ed2234d69fe81e1dade7be336bcfeab106e16bdaa3318dcde4262b93 \
--hash=sha256:45c3e00ce16896ace2cd770ab9057a7cf97d4613ea5f2a13f815141d8b6894b9 \
--hash=sha256:45c549204bc20e7484ffd2555f6cf02e572440ecf2f3bdd60d4404b20fddf64b \
--hash=sha256:497bd8af534ae55dc4ef67eebd1c149ff2a0b0f1e146db73c8b5a53d83c1a5f5 \
--hash=sha256:4b9d8e26fb600d0d69cc9933e20af08552e97cc868a183d38a5c0d661e40dfbb \
--hash=sha256:4bca8abc31799a6f3652d13f47e0b0e1cab76f9125f2283d085a3754f669b607 \
--hash=sha256:4c3874344fd5fa6d58bb51919708048ac4cab21099f40a227173cddb76b4c20b \
--hash=sha256:4f6886c59ba93ffde09b957d3e857e7950c8fe818bd5494d9b4287bc6d5bc7f1 \
--hash=sha256:5268a5a9177afff53dc6d70dffe63114ba2a6e7b20d9411cc3adeba09eeda403 \
--hash=sha256:544b995a6a1976fad5d7ff01409b4588f7608ccc41be72147700af91fd44875d \
--hash=sha256:56a3b1853f3954ec1f0e91085f1350cc57d18f11205e4ab6e83e4b7c414120e0 \
--hash=sha256:571f762aed89025ba8cdcbe355fea56889715ec06d0264fd8b6a3f3fa38154ed \
--hash=sha256:57bb92abdb48467b89c2d21da1ab01a07d0745e536d62afd2e30d5acbd0092eb \
--hash=sha256:58cca552567423f04d06a075f4b473e78ab5bdb906febe56bf4797633f54aa4e \
--hash=sha256:64ca3c7c614aefcdd5e358ecdd41d1237c35fe1417d01ec0160e7cdb0a380edc \
--hash=sha256:678e50ec112bdc6df5a83ac259a55a4ba97a8b314c325ab26b3b5b071151bc61 \
--hash=sha256:696900ef6bc20bef6a242973943574f96c3f97d2183c1bd3da5eea4f559631b1 \
--hash=sha256:6dcbcb34f5c9b0cefdfc71ff745459241b7d3cda5b27c7ad69d45afc0821d1e1 \
--hash=sha256:6f02f30a4a6b3efe665ab13a3dd47109d80326c8fd286311d1ba9f397dc5f247 \
--hash=sha256:70b719a130b81dd130a57ac0ff636dc2c0127c5b35ca5467d1b67057e3c7a4d2 \
--hash=sha256:72d235d6365ca73d8ce92f7425065d70f5c1e19baa458eb3f0d570e425b73a96 \
--hash=sha256:7418fb5736d0d39b3ecc6bec4ff549777988feb260f5381636d8bd321b653038 \
--hash=sha256:77fed80e30fa65708546c4119840a46691290efc231f6bfb2ac2a39b52e15811 \
--hash=sha256:7ebccf0d760bc92a4a7c751aeb2fef6626144aace76ee8f5a63abeb100cae87f \
--hash=sha256:7fb0ee35845bef1e8c4a152d766242164e138c239e3182f558ae15cb4a891f94 \
--hash=sha256:87aebf4acd7249bdff8d3df03aed4f09e67078e6762cfe0aecf8d0748ff94cde \
--hash=sha256:88dc92d9eb5ea4968123e74db146d770b0c8d48f0e2bfb1dbc6c50a8edb12d64 \
--hash=sha256:8c62297bc7aea2147b472ca5ca2b4389377ad82898c87cabab2a94aedd75e337 \
--hash=sha256:8f617f60a8b609a13099b313e7e525e67f84ef4524b6acad396d9ff153f6e4cd \
--hash=sha256:90a4da42aa322de8a3522461e3b5fe999935763b27f69a02fced40f4e3cf9682 \
--hash=sha256:95594b2ceeaa94934e3e94dd7bf5f3c3659cf1a26b1fb3edcf6e42dad7e0eaf2 \
--hash=sha256:9729190bd770314f5fbba42476abf6abe79a746eeda11d1d68fd56dd70e5c296 \
--hash=sha256:9d16fdfd7d70a6b0ca45d36eb19f7702fa77ef6256652f17594fc9ce534c9da6 \
--hash=sha256:9d7b6b90da7285642f480b48c9efd1d25302fd628237d8f6f6ee39ba6b2d2d34 \
--hash=sha256:a066ea6ad6218b4c233906adf0ae67830f451ed238419c0db609310dd781fbe7 \
--hash=sha256:a27fa11ebaccc099cac4309c799aa33919671a7660e29b3e465b7893bc64ec81 \
--hash=sha256:a4aca06ba295aa78bec9b33ec028d1ca08744c36294338c41432b7171060c808 \
--hash=sha256:af2ee67b3688b067e20fea3fe36b823a362609a1966e7e7a21883ae6da248804 \
--hash=sha256:af7ebce2a1e7caf30c0bb64a845f63a69e76a2fadbc1cac47178f7bb6e657bdd \
--hash=sha256:b007e5dcba684e888fbc90554cb12a2f4e492927c8c2761a80b7590209821743 \
--hash=sha256:b25e72e115399a4441aad322258fa8267b873850dc7c276e3f874042728c2b45 \
--hash=sha256:b978c0678cffbe8860ec9edc91200e895c29ae1ac8a7085f947f8e8864c489fb \
--hash=sha256:b99ea9d330e86ce1ff7f2456b33f1bf81c43862a5590faf4ef4ed3a63504bdab \
--hash=sha256:b9fd0fda730461f510cfd9a40fafa5355d65f5e3dbdd8d6dfa342b5b3f5d1949 \
--hash=sha256:ba068f28028849da725ff9185c24f832ccf9207a40f9b28ac46ab7c04994bd41 \
--hash=sha256:be45a895f98877271e8a0b6cf40925e0369121ce423421c20fa6d7958dc753c2 \
--hash=sha256:bee5248d5ec9223545f8cc4f368c2d571477ae828c99409125c3911511d98245 \
--hash=sha256:c512824360ea7490390566ce00bee880e19b526b312b25cc0bc30a0fe95cb67f \
--hash=sha256:c9180d1f5b4b73e28b64e63cc6c4c097690f102aa14935a62d5dd7426a4e5b5a \
--hash=sha256:c96702e1082eab62ae583d64c4e19c9b848359196697e536a0c57ae9bd165bd5 \
--hash=sha256:c9d63d66059114a6756d09169c9209ffceabacb65b9cb0f66e6fc344b20b73e6 \
--hash=sha256:ce181dd1a7c6c012d0efa8ab603c34b5ee9d86e570c03415bbb1b8772eeb381c \
--hash=sha256:d0356a21e58c3e99248930ff73cc05b1d302ff50f41a8a47371aefb04327378a \
--hash=sha256:d0b96c30be9f9387b18b18b6133c75a7b1b0065da64e150fe1feb5ebf31ece1c \
--hash=sha256:d2976b7079f09f48d59dc123293ed6282fca6ef96a270f4ea0364e4e54c8e855 \
--hash=sha256:d97b59cbd8a6c8b23524a8ce237ff9504d987dc07156258aa68ae06d2dd5f34d \
--hash=sha256:da81512b83032ed6cdf85ca62e020b4c23dda87f1b6c26b932131222ccfdbd27 \
--hash=sha256:df2c55c958d3766bdb3e9d858b911288acec09a9aab15883f384fc7180df5bed \
--hash=sha256:dfb2bb5e0f7198eaacfb6796fb0330afd28f36d985a770745fba554a5903595a \
--hash=sha256:e4f22d67756518d71901edf73b38dc0eb4765cce22c8fe122cc81748d425262b \
--hash=sha256:e648dca28178fc879c814cf285048dd22fd1f03e1104101106505ec0eea50a4d \
--hash=sha256:e971d8680003d0af6020713e52f92109b46fedb463916e988814e04c8133578a \
--hash=sha256:ee16906c8025fa464bea1e48128c048d02359fb40bebe5333103228528506530 \
--hash=sha256:f293a1419266e3bf3557d1f8778f9e1ffe7e6b2c8df5c9dca191caf60831eb74 \
--hash=sha256:f379f11e138dfd56c3f24a04164f871a08281194dd9ddf656a278d7d080c8ad0 \
--hash=sha256:f44e7ea288d022d4bf93b9e79dafcb4a7aea45a3cbeae2116792904931cefccf \
--hash=sha256:f5b6133c8d313bde8bd0d123c169d22525300ff164c2189f849de495e1344577 \
--hash=sha256:f65741cc06630652e82aa68ddef4986a3ab9073dd46d59f94ce5f005fa72037c \
--hash=sha256:f8c3b74f1cd577a5a9253eae7ed363f88cbb345a990ca3027e9038301d47c7f4 \
--hash=sha256:f96a63aecec22d3f7fdea3c6c98df9e42973f5856bb6812c3d8d78c262fee808 \
--hash=sha256:f98f6b7787bd2beb1f0dde03f23a0621a0c978edf673b7d8f5e7bc039cbe1b60 \
--hash=sha256:fde26267416c8478c95432c81489b53f57b0b5d24cd5c8bfaebf5bbaac4dc90c \
--hash=sha256:fe632fa4501154d58dfbe1764a0495734d55f84eaf1feda4549a1f1ca76659e9 \
--hash=sha256:ff3f8757570e45da7a5bedaa140489846510014f7a9d5ee9301c61f3f1b8a686 \
--hash=sha256:ffe6b809a97ac6dea524b3b837d5b28743d8c2f121141056d168ff0ba8f614ef
# via -r requirements.in
requests==2.32.4 \
--hash=sha256:27babd3cda2a6d50b30443204ee89830707d396671944c998b5975b031ac2b2c \
--hash=sha256:27d0316682c8a29834d3264820024b62a36942083d52caf2f14c0591336d3422
# via
# -r requirements.in
# requests-mock
requests-mock==1.12.1 \
--hash=sha256:b1e37054004cdd5e56c84454cc7df12b25f90f382159087f4b6915aaeef39563 \
--hash=sha256:e9e12e333b525156e82a3c852f22016b9158220d2f47454de9cae8a77d371401
requests==2.31.0 \
--hash=sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f \
--hash=sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1
# via -r requirements.in
ruamel-yaml==0.18.6 \
--hash=sha256:57b53ba33def16c4f3d807c0ccbc00f8a6081827e81ba2491691b76882d0c636 \
@ -421,15 +321,14 @@ six==1.16.0 \
# via
# -r requirements.in
# glog
urllib3==2.6.0 \
--hash=sha256:c90f7a39f716c572c4e3e58509581ebd83f9b59cced005b7db7ad2d22b0db99f \
--hash=sha256:cb9bcef5a4b345d5da5d145dc3e30834f58e8018828cbc724d30b4cb7d4d49f1
urllib3==2.2.1 \
--hash=sha256:450b20ec296a467077128bff42b73080516e71b56ff59a60a02bef2232c4fa9d \
--hash=sha256:d0570876c61ab9e520d776c38acbbb5b05a776d3f9ff98a5c8fd5162a444cf19
# via
# -r requirements.in
# requests
# The following packages are considered to be unsafe in a requirements file:
setuptools==80.9.0 \
--hash=sha256:062d34222ad13e0cc312a4c02d73f059e86a4acbfbdea8f8f76b28c99f306922 \
--hash=sha256:f36b47402ecde768dbfafc46e8e4207b4360c654f1f3bb84475f0a28628fb19c
# via grpcio-tools
# WARNING: The following packages were not pinned, but pip requires them to be
# pinned when the requirements file includes hashes and the requirement is not
# satisfied by a package already installed. Consider using the --allow-unsafe flag.
# setuptools

View File

@ -17,7 +17,6 @@ import detection_pb2
import network_service_pb2
import plugin_representation_pb2
import reconnaissance_pb2
import vulnerability_pb2
TargetInfo = reconnaissance_pb2.TargetInfo
NetworkService = network_service_pb2.NetworkService
@ -33,9 +32,8 @@ class TsunamiPlugin(metaclass=abc.ABCMeta):
@classmethod
def __subclasshook__(cls, subclass: abc.ABCMeta) -> bool:
return hasattr(subclass, 'GetPluginDefinition') and callable(
subclass.GetPluginDefinition
)
return (hasattr(subclass, 'GetPluginDefinition') and
callable(subclass.GetPluginDefinition))
class VulnDetector(TsunamiPlugin):
@ -50,10 +48,6 @@ class VulnDetector(TsunamiPlugin):
def __init_subclass__(cls, **kwargs):
super().__init_subclass__(**kwargs)
@abc.abstractmethod
def GetAdvisories(self) -> list[vulnerability_pb2.Vulnerability]:
"""Returns the list of vulnerabilities detected by this plugin."""
@abc.abstractmethod
def Detect(
self, target: TargetInfo, matched_services: list[NetworkService]

View File

@ -30,6 +30,7 @@ protobuf {
dependsOn("processResources")
dependsOn("extractTestProto")
dependsOn("sourcesJar")
dependsOn("generatePomFileForMavenPublication")
}
}
}
@ -43,7 +44,7 @@ idea {
}
dependencies {
implementation "com.google.protobuf:protobuf-java:3.25.5"
implementation "com.google.protobuf:protobuf-java:3.25.2"
implementation "io.grpc:grpc-protobuf:1.60.0"
implementation "io.grpc:grpc-stub:1.60.0"
implementation "javax.annotation:javax.annotation-api:1.3.2"

View File

@ -27,7 +27,7 @@ import "vulnerability.proto";
option java_multiple_files = true;
option java_outer_classname = "DetectionProtos";
option java_package = "com.google.tsunami.proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/go/detection_go_proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/tsunami_go_proto";
// Status of the vulnerability detection result.
enum DetectionStatus {

View File

@ -1,389 +0,0 @@
//
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Data models for describing a vulnerability detection report.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.10
// protoc v3.21.12
// source: detection.proto
package detection_go_proto
import (
network_service_go_proto "github.com/google/tsunami-security-scanner/proto/go/network_service_go_proto"
reconnaissance_go_proto "github.com/google/tsunami-security-scanner/proto/go/reconnaissance_go_proto"
vulnerability_go_proto "github.com/google/tsunami-security-scanner/proto/go/vulnerability_go_proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
reflect "reflect"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Status of the vulnerability detection result.
type DetectionStatus int32
const (
// Unspecified status.
DetectionStatus_DETECTION_STATUS_UNSPECIFIED DetectionStatus = 0
// Target is not vulnerable.
DetectionStatus_SAFE DetectionStatus = 1
// Target appears to be vulnerable (e.g. because running version is
// vulnerable), but couldn't be verified.
DetectionStatus_VULNERABILITY_PRESENT DetectionStatus = 2
// Target is vulnerable and the detector successfully verified the
// vulnerability.
DetectionStatus_VULNERABILITY_VERIFIED DetectionStatus = 3
)
// Enum value maps for DetectionStatus.
var (
DetectionStatus_name = map[int32]string{
0: "DETECTION_STATUS_UNSPECIFIED",
1: "SAFE",
2: "VULNERABILITY_PRESENT",
3: "VULNERABILITY_VERIFIED",
}
DetectionStatus_value = map[string]int32{
"DETECTION_STATUS_UNSPECIFIED": 0,
"SAFE": 1,
"VULNERABILITY_PRESENT": 2,
"VULNERABILITY_VERIFIED": 3,
}
)
func (x DetectionStatus) Enum() *DetectionStatus {
p := new(DetectionStatus)
*p = x
return p
}
func (x DetectionStatus) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (DetectionStatus) Descriptor() protoreflect.EnumDescriptor {
return file_detection_proto_enumTypes[0].Descriptor()
}
func (DetectionStatus) Type() protoreflect.EnumType {
return &file_detection_proto_enumTypes[0]
}
func (x DetectionStatus) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Full report about a detected vulnerability.
type DetectionReport struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_TargetInfo *reconnaissance_go_proto.TargetInfo `protobuf:"bytes,1,opt,name=target_info,json=targetInfo,proto3"`
xxx_hidden_NetworkService *network_service_go_proto.NetworkService `protobuf:"bytes,2,opt,name=network_service,json=networkService,proto3"`
xxx_hidden_DetectionTimestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=detection_timestamp,json=detectionTimestamp,proto3"`
xxx_hidden_DetectionStatus DetectionStatus `protobuf:"varint,4,opt,name=detection_status,json=detectionStatus,proto3,enum=tsunami.proto.DetectionStatus"`
xxx_hidden_Vulnerability *vulnerability_go_proto.Vulnerability `protobuf:"bytes,5,opt,name=vulnerability,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DetectionReport) Reset() {
*x = DetectionReport{}
mi := &file_detection_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *DetectionReport) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DetectionReport) ProtoMessage() {}
func (x *DetectionReport) ProtoReflect() protoreflect.Message {
mi := &file_detection_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *DetectionReport) GetTargetInfo() *reconnaissance_go_proto.TargetInfo {
if x != nil {
return x.xxx_hidden_TargetInfo
}
return nil
}
func (x *DetectionReport) GetNetworkService() *network_service_go_proto.NetworkService {
if x != nil {
return x.xxx_hidden_NetworkService
}
return nil
}
func (x *DetectionReport) GetDetectionTimestamp() *timestamppb.Timestamp {
if x != nil {
return x.xxx_hidden_DetectionTimestamp
}
return nil
}
func (x *DetectionReport) GetDetectionStatus() DetectionStatus {
if x != nil {
return x.xxx_hidden_DetectionStatus
}
return DetectionStatus_DETECTION_STATUS_UNSPECIFIED
}
func (x *DetectionReport) GetVulnerability() *vulnerability_go_proto.Vulnerability {
if x != nil {
return x.xxx_hidden_Vulnerability
}
return nil
}
func (x *DetectionReport) SetTargetInfo(v *reconnaissance_go_proto.TargetInfo) {
x.xxx_hidden_TargetInfo = v
}
func (x *DetectionReport) SetNetworkService(v *network_service_go_proto.NetworkService) {
x.xxx_hidden_NetworkService = v
}
func (x *DetectionReport) SetDetectionTimestamp(v *timestamppb.Timestamp) {
x.xxx_hidden_DetectionTimestamp = v
}
func (x *DetectionReport) SetDetectionStatus(v DetectionStatus) {
x.xxx_hidden_DetectionStatus = v
}
func (x *DetectionReport) SetVulnerability(v *vulnerability_go_proto.Vulnerability) {
x.xxx_hidden_Vulnerability = v
}
func (x *DetectionReport) HasTargetInfo() bool {
if x == nil {
return false
}
return x.xxx_hidden_TargetInfo != nil
}
func (x *DetectionReport) HasNetworkService() bool {
if x == nil {
return false
}
return x.xxx_hidden_NetworkService != nil
}
func (x *DetectionReport) HasDetectionTimestamp() bool {
if x == nil {
return false
}
return x.xxx_hidden_DetectionTimestamp != nil
}
func (x *DetectionReport) HasVulnerability() bool {
if x == nil {
return false
}
return x.xxx_hidden_Vulnerability != nil
}
func (x *DetectionReport) ClearTargetInfo() {
x.xxx_hidden_TargetInfo = nil
}
func (x *DetectionReport) ClearNetworkService() {
x.xxx_hidden_NetworkService = nil
}
func (x *DetectionReport) ClearDetectionTimestamp() {
x.xxx_hidden_DetectionTimestamp = nil
}
func (x *DetectionReport) ClearVulnerability() {
x.xxx_hidden_Vulnerability = nil
}
type DetectionReport_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Information about the scanned target.
TargetInfo *reconnaissance_go_proto.TargetInfo
// Information about the scanned network service.
NetworkService *network_service_go_proto.NetworkService
// Time when the vulnerability was detected.
DetectionTimestamp *timestamppb.Timestamp
// Status of the detection result.
DetectionStatus DetectionStatus
// Full details about the detected vulnerability.
Vulnerability *vulnerability_go_proto.Vulnerability
}
func (b0 DetectionReport_builder) Build() *DetectionReport {
m0 := &DetectionReport{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_TargetInfo = b.TargetInfo
x.xxx_hidden_NetworkService = b.NetworkService
x.xxx_hidden_DetectionTimestamp = b.DetectionTimestamp
x.xxx_hidden_DetectionStatus = b.DetectionStatus
x.xxx_hidden_Vulnerability = b.Vulnerability
return m0
}
type DetectionReportList struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_DetectionReports *[]*DetectionReport `protobuf:"bytes,1,rep,name=detection_reports,json=detectionReports,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DetectionReportList) Reset() {
*x = DetectionReportList{}
mi := &file_detection_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *DetectionReportList) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DetectionReportList) ProtoMessage() {}
func (x *DetectionReportList) ProtoReflect() protoreflect.Message {
mi := &file_detection_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *DetectionReportList) GetDetectionReports() []*DetectionReport {
if x != nil {
if x.xxx_hidden_DetectionReports != nil {
return *x.xxx_hidden_DetectionReports
}
}
return nil
}
func (x *DetectionReportList) SetDetectionReports(v []*DetectionReport) {
x.xxx_hidden_DetectionReports = &v
}
type DetectionReportList_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
DetectionReports []*DetectionReport
}
func (b0 DetectionReportList_builder) Build() *DetectionReportList {
m0 := &DetectionReportList{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_DetectionReports = &b.DetectionReports
return m0
}
var File_detection_proto protoreflect.FileDescriptor
const file_detection_proto_rawDesc = "" +
"\n" +
"\x0fdetection.proto\x12\rtsunami.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x15network_service.proto\x1a\x14reconnaissance.proto\x1a\x13vulnerability.proto\"\xf1\x02\n" +
"\x0fDetectionReport\x12:\n" +
"\vtarget_info\x18\x01 \x01(\v2\x19.tsunami.proto.TargetInfoR\n" +
"targetInfo\x12F\n" +
"\x0fnetwork_service\x18\x02 \x01(\v2\x1d.tsunami.proto.NetworkServiceR\x0enetworkService\x12K\n" +
"\x13detection_timestamp\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\x12detectionTimestamp\x12I\n" +
"\x10detection_status\x18\x04 \x01(\x0e2\x1e.tsunami.proto.DetectionStatusR\x0fdetectionStatus\x12B\n" +
"\rvulnerability\x18\x05 \x01(\v2\x1c.tsunami.proto.VulnerabilityR\rvulnerability\"b\n" +
"\x13DetectionReportList\x12K\n" +
"\x11detection_reports\x18\x01 \x03(\v2\x1e.tsunami.proto.DetectionReportR\x10detectionReports*t\n" +
"\x0fDetectionStatus\x12 \n" +
"\x1cDETECTION_STATUS_UNSPECIFIED\x10\x00\x12\b\n" +
"\x04SAFE\x10\x01\x12\x19\n" +
"\x15VULNERABILITY_PRESENT\x10\x02\x12\x1a\n" +
"\x16VULNERABILITY_VERIFIED\x10\x03Bu\n" +
"\x18com.google.tsunami.protoB\x0fDetectionProtosP\x01ZFgithub.com/google/tsunami-security-scanner/proto/go/detection_go_protob\x06proto3"
var file_detection_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_detection_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_detection_proto_goTypes = []any{
(DetectionStatus)(0), // 0: tsunami.proto.DetectionStatus
(*DetectionReport)(nil), // 1: tsunami.proto.DetectionReport
(*DetectionReportList)(nil), // 2: tsunami.proto.DetectionReportList
(*reconnaissance_go_proto.TargetInfo)(nil), // 3: tsunami.proto.TargetInfo
(*network_service_go_proto.NetworkService)(nil), // 4: tsunami.proto.NetworkService
(*timestamppb.Timestamp)(nil), // 5: google.protobuf.Timestamp
(*vulnerability_go_proto.Vulnerability)(nil), // 6: tsunami.proto.Vulnerability
}
var file_detection_proto_depIdxs = []int32{
3, // 0: tsunami.proto.DetectionReport.target_info:type_name -> tsunami.proto.TargetInfo
4, // 1: tsunami.proto.DetectionReport.network_service:type_name -> tsunami.proto.NetworkService
5, // 2: tsunami.proto.DetectionReport.detection_timestamp:type_name -> google.protobuf.Timestamp
0, // 3: tsunami.proto.DetectionReport.detection_status:type_name -> tsunami.proto.DetectionStatus
6, // 4: tsunami.proto.DetectionReport.vulnerability:type_name -> tsunami.proto.Vulnerability
1, // 5: tsunami.proto.DetectionReportList.detection_reports:type_name -> tsunami.proto.DetectionReport
6, // [6:6] is the sub-list for method output_type
6, // [6:6] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
}
func init() { file_detection_proto_init() }
func file_detection_proto_init() {
if File_detection_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_detection_proto_rawDesc), len(file_detection_proto_rawDesc)),
NumEnums: 1,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_detection_proto_goTypes,
DependencyIndexes: file_detection_proto_depIdxs,
EnumInfos: file_detection_proto_enumTypes,
MessageInfos: file_detection_proto_msgTypes,
}.Build()
File_detection_proto = out.File
file_detection_proto_goTypes = nil
file_detection_proto_depIdxs = nil
}

View File

@ -1,611 +0,0 @@
//
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Data models for describing network related information.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.10
// protoc v3.21.12
// source: network.proto
package network_go_proto
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// The address family of an IP address.
type AddressFamily int32
const (
AddressFamily_ADDRESS_FAMILY_UNSPECIFIED AddressFamily = 0
AddressFamily_IPV4 AddressFamily = 4
AddressFamily_IPV6 AddressFamily = 6
)
// Enum value maps for AddressFamily.
var (
AddressFamily_name = map[int32]string{
0: "ADDRESS_FAMILY_UNSPECIFIED",
4: "IPV4",
6: "IPV6",
}
AddressFamily_value = map[string]int32{
"ADDRESS_FAMILY_UNSPECIFIED": 0,
"IPV4": 4,
"IPV6": 6,
}
)
func (x AddressFamily) Enum() *AddressFamily {
p := new(AddressFamily)
*p = x
return p
}
func (x AddressFamily) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (AddressFamily) Descriptor() protoreflect.EnumDescriptor {
return file_network_proto_enumTypes[0].Descriptor()
}
func (AddressFamily) Type() protoreflect.EnumType {
return &file_network_proto_enumTypes[0]
}
func (x AddressFamily) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// The transport layer protocols.
type TransportProtocol int32
const (
TransportProtocol_TRANSPORT_PROTOCOL_UNSPECIFIED TransportProtocol = 0
TransportProtocol_TCP TransportProtocol = 1
TransportProtocol_UDP TransportProtocol = 2
TransportProtocol_SCTP TransportProtocol = 3
)
// Enum value maps for TransportProtocol.
var (
TransportProtocol_name = map[int32]string{
0: "TRANSPORT_PROTOCOL_UNSPECIFIED",
1: "TCP",
2: "UDP",
3: "SCTP",
}
TransportProtocol_value = map[string]int32{
"TRANSPORT_PROTOCOL_UNSPECIFIED": 0,
"TCP": 1,
"UDP": 2,
"SCTP": 3,
}
)
func (x TransportProtocol) Enum() *TransportProtocol {
p := new(TransportProtocol)
*p = x
return p
}
func (x TransportProtocol) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (TransportProtocol) Descriptor() protoreflect.EnumDescriptor {
return file_network_proto_enumTypes[1].Descriptor()
}
func (TransportProtocol) Type() protoreflect.EnumType {
return &file_network_proto_enumTypes[1]
}
func (x TransportProtocol) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
type NetworkEndpoint_Type int32
const (
NetworkEndpoint_TYPE_UNSPECIFIED NetworkEndpoint_Type = 0
// The network endpoint is represented by an IP address.
NetworkEndpoint_IP NetworkEndpoint_Type = 1
// The network endpoint is represented by IP address and port pair.
NetworkEndpoint_IP_PORT NetworkEndpoint_Type = 2
// The network endpoint is represented by a hostname.
NetworkEndpoint_HOSTNAME NetworkEndpoint_Type = 3
// The network endpoint is represented by a hostname and port pair.
NetworkEndpoint_HOSTNAME_PORT NetworkEndpoint_Type = 4
// The network endpoint is represented by an IP address and hostname.
NetworkEndpoint_IP_HOSTNAME NetworkEndpoint_Type = 5
// The network endpoint is represented by an IP address, hostname and port.
NetworkEndpoint_IP_HOSTNAME_PORT NetworkEndpoint_Type = 6
)
// Enum value maps for NetworkEndpoint_Type.
var (
NetworkEndpoint_Type_name = map[int32]string{
0: "TYPE_UNSPECIFIED",
1: "IP",
2: "IP_PORT",
3: "HOSTNAME",
4: "HOSTNAME_PORT",
5: "IP_HOSTNAME",
6: "IP_HOSTNAME_PORT",
}
NetworkEndpoint_Type_value = map[string]int32{
"TYPE_UNSPECIFIED": 0,
"IP": 1,
"IP_PORT": 2,
"HOSTNAME": 3,
"HOSTNAME_PORT": 4,
"IP_HOSTNAME": 5,
"IP_HOSTNAME_PORT": 6,
}
)
func (x NetworkEndpoint_Type) Enum() *NetworkEndpoint_Type {
p := new(NetworkEndpoint_Type)
*p = x
return p
}
func (x NetworkEndpoint_Type) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (NetworkEndpoint_Type) Descriptor() protoreflect.EnumDescriptor {
return file_network_proto_enumTypes[2].Descriptor()
}
func (NetworkEndpoint_Type) Type() protoreflect.EnumType {
return &file_network_proto_enumTypes[2]
}
func (x NetworkEndpoint_Type) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// The IP address of a networking device.
type IpAddress struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_AddressFamily AddressFamily `protobuf:"varint,1,opt,name=address_family,json=addressFamily,proto3,enum=tsunami.proto.AddressFamily"`
xxx_hidden_Address string `protobuf:"bytes,2,opt,name=address,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *IpAddress) Reset() {
*x = IpAddress{}
mi := &file_network_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *IpAddress) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*IpAddress) ProtoMessage() {}
func (x *IpAddress) ProtoReflect() protoreflect.Message {
mi := &file_network_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *IpAddress) GetAddressFamily() AddressFamily {
if x != nil {
return x.xxx_hidden_AddressFamily
}
return AddressFamily_ADDRESS_FAMILY_UNSPECIFIED
}
func (x *IpAddress) GetAddress() string {
if x != nil {
return x.xxx_hidden_Address
}
return ""
}
func (x *IpAddress) SetAddressFamily(v AddressFamily) {
x.xxx_hidden_AddressFamily = v
}
func (x *IpAddress) SetAddress(v string) {
x.xxx_hidden_Address = v
}
type IpAddress_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// The family of the IP address.
AddressFamily AddressFamily
// A human-readable representation of the IP address, e.g. 127.0.0.1 for IPV4
// and 2001:db8:0:1234:0:567:8:1 for IPV6.
Address string
}
func (b0 IpAddress_builder) Build() *IpAddress {
m0 := &IpAddress{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_AddressFamily = b.AddressFamily
x.xxx_hidden_Address = b.Address
return m0
}
// The port that a network service listens to.
type Port struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_PortNumber uint32 `protobuf:"varint,1,opt,name=port_number,json=portNumber,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Port) Reset() {
*x = Port{}
mi := &file_network_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Port) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Port) ProtoMessage() {}
func (x *Port) ProtoReflect() protoreflect.Message {
mi := &file_network_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *Port) GetPortNumber() uint32 {
if x != nil {
return x.xxx_hidden_PortNumber
}
return 0
}
func (x *Port) SetPortNumber(v uint32) {
x.xxx_hidden_PortNumber = v
}
type Port_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
PortNumber uint32
}
func (b0 Port_builder) Build() *Port {
m0 := &Port{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_PortNumber = b.PortNumber
return m0
}
// The hostname of a networking device.
type Hostname struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Name string `protobuf:"bytes,1,opt,name=name,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Hostname) Reset() {
*x = Hostname{}
mi := &file_network_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Hostname) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Hostname) ProtoMessage() {}
func (x *Hostname) ProtoReflect() protoreflect.Message {
mi := &file_network_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *Hostname) GetName() string {
if x != nil {
return x.xxx_hidden_Name
}
return ""
}
func (x *Hostname) SetName(v string) {
x.xxx_hidden_Name = v
}
type Hostname_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
Name string
}
func (b0 Hostname_builder) Build() *Hostname {
m0 := &Hostname{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Name = b.Name
return m0
}
// A classification of an endpoint for a network device.
type NetworkEndpoint struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Type NetworkEndpoint_Type `protobuf:"varint,1,opt,name=type,proto3,enum=tsunami.proto.NetworkEndpoint_Type"`
xxx_hidden_IpAddress *IpAddress `protobuf:"bytes,2,opt,name=ip_address,json=ipAddress,proto3"`
xxx_hidden_Port *Port `protobuf:"bytes,3,opt,name=port,proto3"`
xxx_hidden_Hostname *Hostname `protobuf:"bytes,4,opt,name=hostname,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *NetworkEndpoint) Reset() {
*x = NetworkEndpoint{}
mi := &file_network_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *NetworkEndpoint) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NetworkEndpoint) ProtoMessage() {}
func (x *NetworkEndpoint) ProtoReflect() protoreflect.Message {
mi := &file_network_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *NetworkEndpoint) GetType() NetworkEndpoint_Type {
if x != nil {
return x.xxx_hidden_Type
}
return NetworkEndpoint_TYPE_UNSPECIFIED
}
func (x *NetworkEndpoint) GetIpAddress() *IpAddress {
if x != nil {
return x.xxx_hidden_IpAddress
}
return nil
}
func (x *NetworkEndpoint) GetPort() *Port {
if x != nil {
return x.xxx_hidden_Port
}
return nil
}
func (x *NetworkEndpoint) GetHostname() *Hostname {
if x != nil {
return x.xxx_hidden_Hostname
}
return nil
}
func (x *NetworkEndpoint) SetType(v NetworkEndpoint_Type) {
x.xxx_hidden_Type = v
}
func (x *NetworkEndpoint) SetIpAddress(v *IpAddress) {
x.xxx_hidden_IpAddress = v
}
func (x *NetworkEndpoint) SetPort(v *Port) {
x.xxx_hidden_Port = v
}
func (x *NetworkEndpoint) SetHostname(v *Hostname) {
x.xxx_hidden_Hostname = v
}
func (x *NetworkEndpoint) HasIpAddress() bool {
if x == nil {
return false
}
return x.xxx_hidden_IpAddress != nil
}
func (x *NetworkEndpoint) HasPort() bool {
if x == nil {
return false
}
return x.xxx_hidden_Port != nil
}
func (x *NetworkEndpoint) HasHostname() bool {
if x == nil {
return false
}
return x.xxx_hidden_Hostname != nil
}
func (x *NetworkEndpoint) ClearIpAddress() {
x.xxx_hidden_IpAddress = nil
}
func (x *NetworkEndpoint) ClearPort() {
x.xxx_hidden_Port = nil
}
func (x *NetworkEndpoint) ClearHostname() {
x.xxx_hidden_Hostname = nil
}
type NetworkEndpoint_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Type of the network endpoint.
Type NetworkEndpoint_Type
// Optional IP address of a network endpoint. Must be specified when Type is
// IP or IP_PORT.
IpAddress *IpAddress
// Optional port of a network endpoint. Must be specified when Type is IP_PORT
// or HOSTNAME_PORT.
Port *Port
// Optional hostname of a network endpoint. Must be specified when Type is
// HOSTNAME or HOSTNAME_PORT.
Hostname *Hostname
}
func (b0 NetworkEndpoint_builder) Build() *NetworkEndpoint {
m0 := &NetworkEndpoint{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Type = b.Type
x.xxx_hidden_IpAddress = b.IpAddress
x.xxx_hidden_Port = b.Port
x.xxx_hidden_Hostname = b.Hostname
return m0
}
var File_network_proto protoreflect.FileDescriptor
const file_network_proto_rawDesc = "" +
"\n" +
"\rnetwork.proto\x12\rtsunami.proto\"j\n" +
"\tIpAddress\x12C\n" +
"\x0eaddress_family\x18\x01 \x01(\x0e2\x1c.tsunami.proto.AddressFamilyR\raddressFamily\x12\x18\n" +
"\aaddress\x18\x02 \x01(\tR\aaddress\"'\n" +
"\x04Port\x12\x1f\n" +
"\vport_number\x18\x01 \x01(\rR\n" +
"portNumber\"\x1e\n" +
"\bHostname\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\"\xdc\x02\n" +
"\x0fNetworkEndpoint\x127\n" +
"\x04type\x18\x01 \x01(\x0e2#.tsunami.proto.NetworkEndpoint.TypeR\x04type\x127\n" +
"\n" +
"ip_address\x18\x02 \x01(\v2\x18.tsunami.proto.IpAddressR\tipAddress\x12'\n" +
"\x04port\x18\x03 \x01(\v2\x13.tsunami.proto.PortR\x04port\x123\n" +
"\bhostname\x18\x04 \x01(\v2\x17.tsunami.proto.HostnameR\bhostname\"y\n" +
"\x04Type\x12\x14\n" +
"\x10TYPE_UNSPECIFIED\x10\x00\x12\x06\n" +
"\x02IP\x10\x01\x12\v\n" +
"\aIP_PORT\x10\x02\x12\f\n" +
"\bHOSTNAME\x10\x03\x12\x11\n" +
"\rHOSTNAME_PORT\x10\x04\x12\x0f\n" +
"\vIP_HOSTNAME\x10\x05\x12\x14\n" +
"\x10IP_HOSTNAME_PORT\x10\x06*C\n" +
"\rAddressFamily\x12\x1e\n" +
"\x1aADDRESS_FAMILY_UNSPECIFIED\x10\x00\x12\b\n" +
"\x04IPV4\x10\x04\x12\b\n" +
"\x04IPV6\x10\x06*S\n" +
"\x11TransportProtocol\x12\"\n" +
"\x1eTRANSPORT_PROTOCOL_UNSPECIFIED\x10\x00\x12\a\n" +
"\x03TCP\x10\x01\x12\a\n" +
"\x03UDP\x10\x02\x12\b\n" +
"\x04SCTP\x10\x03Bq\n" +
"\x18com.google.tsunami.protoB\rNetworkProtosP\x01ZDgithub.com/google/tsunami-security-scanner/proto/go/network_go_protob\x06proto3"
var file_network_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
var file_network_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_network_proto_goTypes = []any{
(AddressFamily)(0), // 0: tsunami.proto.AddressFamily
(TransportProtocol)(0), // 1: tsunami.proto.TransportProtocol
(NetworkEndpoint_Type)(0), // 2: tsunami.proto.NetworkEndpoint.Type
(*IpAddress)(nil), // 3: tsunami.proto.IpAddress
(*Port)(nil), // 4: tsunami.proto.Port
(*Hostname)(nil), // 5: tsunami.proto.Hostname
(*NetworkEndpoint)(nil), // 6: tsunami.proto.NetworkEndpoint
}
var file_network_proto_depIdxs = []int32{
0, // 0: tsunami.proto.IpAddress.address_family:type_name -> tsunami.proto.AddressFamily
2, // 1: tsunami.proto.NetworkEndpoint.type:type_name -> tsunami.proto.NetworkEndpoint.Type
3, // 2: tsunami.proto.NetworkEndpoint.ip_address:type_name -> tsunami.proto.IpAddress
4, // 3: tsunami.proto.NetworkEndpoint.port:type_name -> tsunami.proto.Port
5, // 4: tsunami.proto.NetworkEndpoint.hostname:type_name -> tsunami.proto.Hostname
5, // [5:5] is the sub-list for method output_type
5, // [5:5] is the sub-list for method input_type
5, // [5:5] is the sub-list for extension type_name
5, // [5:5] is the sub-list for extension extendee
0, // [0:5] is the sub-list for field type_name
}
func init() { file_network_proto_init() }
func file_network_proto_init() {
if File_network_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_network_proto_rawDesc), len(file_network_proto_rawDesc)),
NumEnums: 3,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_network_proto_goTypes,
DependencyIndexes: file_network_proto_depIdxs,
EnumInfos: file_network_proto_enumTypes,
MessageInfos: file_network_proto_msgTypes,
}.Build()
File_network_proto = out.File
file_network_proto_goTypes = nil
file_network_proto_depIdxs = nil
}

View File

@ -1,622 +0,0 @@
//
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Data models for describing a network service.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.10
// protoc v3.21.12
// source: network_service.proto
package network_service_go_proto
import (
network_go_proto "github.com/google/tsunami-security-scanner/proto/go/network_go_proto"
software_go_proto "github.com/google/tsunami-security-scanner/proto/go/software_go_proto"
web_crawl_go_proto "github.com/google/tsunami-security-scanner/proto/go/web_crawl_go_proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// General information about a network service running on a target.
type NetworkService struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_NetworkEndpoint *network_go_proto.NetworkEndpoint `protobuf:"bytes,1,opt,name=network_endpoint,json=networkEndpoint,proto3"`
xxx_hidden_TransportProtocol network_go_proto.TransportProtocol `protobuf:"varint,2,opt,name=transport_protocol,json=transportProtocol,proto3,enum=tsunami.proto.TransportProtocol"`
xxx_hidden_ServiceName string `protobuf:"bytes,3,opt,name=service_name,json=serviceName,proto3"`
xxx_hidden_Software *software_go_proto.Software `protobuf:"bytes,4,opt,name=software,proto3"`
xxx_hidden_VersionSet *software_go_proto.VersionSet `protobuf:"bytes,5,opt,name=version_set,json=versionSet,proto3"`
xxx_hidden_Banner []string `protobuf:"bytes,6,rep,name=banner,proto3"`
xxx_hidden_ServiceContext *ServiceContext `protobuf:"bytes,7,opt,name=service_context,json=serviceContext,proto3"`
xxx_hidden_Cpes []string `protobuf:"bytes,8,rep,name=cpes,proto3"`
xxx_hidden_SupportedSslVersions []string `protobuf:"bytes,9,rep,name=supported_ssl_versions,json=supportedSslVersions,proto3"`
xxx_hidden_SupportedHttpMethods []string `protobuf:"bytes,10,rep,name=supported_http_methods,json=supportedHttpMethods,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *NetworkService) Reset() {
*x = NetworkService{}
mi := &file_network_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *NetworkService) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NetworkService) ProtoMessage() {}
func (x *NetworkService) ProtoReflect() protoreflect.Message {
mi := &file_network_service_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *NetworkService) GetNetworkEndpoint() *network_go_proto.NetworkEndpoint {
if x != nil {
return x.xxx_hidden_NetworkEndpoint
}
return nil
}
func (x *NetworkService) GetTransportProtocol() network_go_proto.TransportProtocol {
if x != nil {
return x.xxx_hidden_TransportProtocol
}
return network_go_proto.TransportProtocol(0)
}
func (x *NetworkService) GetServiceName() string {
if x != nil {
return x.xxx_hidden_ServiceName
}
return ""
}
func (x *NetworkService) GetSoftware() *software_go_proto.Software {
if x != nil {
return x.xxx_hidden_Software
}
return nil
}
func (x *NetworkService) GetVersionSet() *software_go_proto.VersionSet {
if x != nil {
return x.xxx_hidden_VersionSet
}
return nil
}
func (x *NetworkService) GetBanner() []string {
if x != nil {
return x.xxx_hidden_Banner
}
return nil
}
func (x *NetworkService) GetServiceContext() *ServiceContext {
if x != nil {
return x.xxx_hidden_ServiceContext
}
return nil
}
func (x *NetworkService) GetCpes() []string {
if x != nil {
return x.xxx_hidden_Cpes
}
return nil
}
func (x *NetworkService) GetSupportedSslVersions() []string {
if x != nil {
return x.xxx_hidden_SupportedSslVersions
}
return nil
}
func (x *NetworkService) GetSupportedHttpMethods() []string {
if x != nil {
return x.xxx_hidden_SupportedHttpMethods
}
return nil
}
func (x *NetworkService) SetNetworkEndpoint(v *network_go_proto.NetworkEndpoint) {
x.xxx_hidden_NetworkEndpoint = v
}
func (x *NetworkService) SetTransportProtocol(v network_go_proto.TransportProtocol) {
x.xxx_hidden_TransportProtocol = v
}
func (x *NetworkService) SetServiceName(v string) {
x.xxx_hidden_ServiceName = v
}
func (x *NetworkService) SetSoftware(v *software_go_proto.Software) {
x.xxx_hidden_Software = v
}
func (x *NetworkService) SetVersionSet(v *software_go_proto.VersionSet) {
x.xxx_hidden_VersionSet = v
}
func (x *NetworkService) SetBanner(v []string) {
x.xxx_hidden_Banner = v
}
func (x *NetworkService) SetServiceContext(v *ServiceContext) {
x.xxx_hidden_ServiceContext = v
}
func (x *NetworkService) SetCpes(v []string) {
x.xxx_hidden_Cpes = v
}
func (x *NetworkService) SetSupportedSslVersions(v []string) {
x.xxx_hidden_SupportedSslVersions = v
}
func (x *NetworkService) SetSupportedHttpMethods(v []string) {
x.xxx_hidden_SupportedHttpMethods = v
}
func (x *NetworkService) HasNetworkEndpoint() bool {
if x == nil {
return false
}
return x.xxx_hidden_NetworkEndpoint != nil
}
func (x *NetworkService) HasSoftware() bool {
if x == nil {
return false
}
return x.xxx_hidden_Software != nil
}
func (x *NetworkService) HasVersionSet() bool {
if x == nil {
return false
}
return x.xxx_hidden_VersionSet != nil
}
func (x *NetworkService) HasServiceContext() bool {
if x == nil {
return false
}
return x.xxx_hidden_ServiceContext != nil
}
func (x *NetworkService) ClearNetworkEndpoint() {
x.xxx_hidden_NetworkEndpoint = nil
}
func (x *NetworkService) ClearSoftware() {
x.xxx_hidden_Software = nil
}
func (x *NetworkService) ClearVersionSet() {
x.xxx_hidden_VersionSet = nil
}
func (x *NetworkService) ClearServiceContext() {
x.xxx_hidden_ServiceContext = nil
}
type NetworkService_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// The network endpoint where this network service is served.
NetworkEndpoint *network_go_proto.NetworkEndpoint
// The transport layer protocol used by the service.
TransportProtocol network_go_proto.TransportProtocol
// The name of the network service, following convention in RFC6335. Examples
// are like http, telnet, ssh, etc.
ServiceName string
// The software that provides the service behind the port.
Software *software_go_proto.Software
// The complete set of versions of the software.
VersionSet *software_go_proto.VersionSet
// Banners generated by the service.
Banner []string
// Context information about this network service.
ServiceContext *ServiceContext
// The detected Common Platform Enumeration (CPE) name for service,
// in the uri binding representation, like: cpe:/a:openbsd:openssh:8.4p1
Cpes []string
// List of supported SSL versions (e.g. TLSv1, SSLv3, ...) on the service.
SupportedSslVersions []string
// List of supported HTTP methods (e.g. POST, GET, ...) on the service.
SupportedHttpMethods []string
}
func (b0 NetworkService_builder) Build() *NetworkService {
m0 := &NetworkService{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_NetworkEndpoint = b.NetworkEndpoint
x.xxx_hidden_TransportProtocol = b.TransportProtocol
x.xxx_hidden_ServiceName = b.ServiceName
x.xxx_hidden_Software = b.Software
x.xxx_hidden_VersionSet = b.VersionSet
x.xxx_hidden_Banner = b.Banner
x.xxx_hidden_ServiceContext = b.ServiceContext
x.xxx_hidden_Cpes = b.Cpes
x.xxx_hidden_SupportedSslVersions = b.SupportedSslVersions
x.xxx_hidden_SupportedHttpMethods = b.SupportedHttpMethods
return m0
}
// Context information about a specific network service.
type ServiceContext struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Context isServiceContext_Context `protobuf_oneof:"context"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ServiceContext) Reset() {
*x = ServiceContext{}
mi := &file_network_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ServiceContext) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ServiceContext) ProtoMessage() {}
func (x *ServiceContext) ProtoReflect() protoreflect.Message {
mi := &file_network_service_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *ServiceContext) GetWebServiceContext() *WebServiceContext {
if x != nil {
if x, ok := x.xxx_hidden_Context.(*serviceContext_WebServiceContext); ok {
return x.WebServiceContext
}
}
return nil
}
func (x *ServiceContext) SetWebServiceContext(v *WebServiceContext) {
if v == nil {
x.xxx_hidden_Context = nil
return
}
x.xxx_hidden_Context = &serviceContext_WebServiceContext{v}
}
func (x *ServiceContext) HasContext() bool {
if x == nil {
return false
}
return x.xxx_hidden_Context != nil
}
func (x *ServiceContext) HasWebServiceContext() bool {
if x == nil {
return false
}
_, ok := x.xxx_hidden_Context.(*serviceContext_WebServiceContext)
return ok
}
func (x *ServiceContext) ClearContext() {
x.xxx_hidden_Context = nil
}
func (x *ServiceContext) ClearWebServiceContext() {
if _, ok := x.xxx_hidden_Context.(*serviceContext_WebServiceContext); ok {
x.xxx_hidden_Context = nil
}
}
const ServiceContext_Context_not_set_case case_ServiceContext_Context = 0
const ServiceContext_WebServiceContext_case case_ServiceContext_Context = 1
func (x *ServiceContext) WhichContext() case_ServiceContext_Context {
if x == nil {
return ServiceContext_Context_not_set_case
}
switch x.xxx_hidden_Context.(type) {
case *serviceContext_WebServiceContext:
return ServiceContext_WebServiceContext_case
default:
return ServiceContext_Context_not_set_case
}
}
type ServiceContext_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Fields of oneof xxx_hidden_Context:
WebServiceContext *WebServiceContext
// -- end of xxx_hidden_Context
}
func (b0 ServiceContext_builder) Build() *ServiceContext {
m0 := &ServiceContext{}
b, x := &b0, m0
_, _ = b, x
if b.WebServiceContext != nil {
x.xxx_hidden_Context = &serviceContext_WebServiceContext{b.WebServiceContext}
}
return m0
}
type case_ServiceContext_Context protoreflect.FieldNumber
func (x case_ServiceContext_Context) String() string {
md := file_network_service_proto_msgTypes[1].Descriptor()
if x == 0 {
return "not set"
}
return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))
}
type isServiceContext_Context interface {
isServiceContext_Context()
}
type serviceContext_WebServiceContext struct {
WebServiceContext *WebServiceContext `protobuf:"bytes,1,opt,name=web_service_context,json=webServiceContext,proto3,oneof"`
}
func (*serviceContext_WebServiceContext) isServiceContext_Context() {}
// Context information about a web application.
// NEXT ID: 5
type WebServiceContext struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_ApplicationRoot string `protobuf:"bytes,1,opt,name=application_root,json=applicationRoot,proto3"`
xxx_hidden_Software *software_go_proto.Software `protobuf:"bytes,2,opt,name=software,proto3"`
xxx_hidden_VersionSet *software_go_proto.VersionSet `protobuf:"bytes,3,opt,name=version_set,json=versionSet,proto3"`
xxx_hidden_CrawlResults *[]*web_crawl_go_proto.CrawlResult `protobuf:"bytes,4,rep,name=crawl_results,json=crawlResults,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *WebServiceContext) Reset() {
*x = WebServiceContext{}
mi := &file_network_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *WebServiceContext) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*WebServiceContext) ProtoMessage() {}
func (x *WebServiceContext) ProtoReflect() protoreflect.Message {
mi := &file_network_service_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *WebServiceContext) GetApplicationRoot() string {
if x != nil {
return x.xxx_hidden_ApplicationRoot
}
return ""
}
func (x *WebServiceContext) GetSoftware() *software_go_proto.Software {
if x != nil {
return x.xxx_hidden_Software
}
return nil
}
func (x *WebServiceContext) GetVersionSet() *software_go_proto.VersionSet {
if x != nil {
return x.xxx_hidden_VersionSet
}
return nil
}
func (x *WebServiceContext) GetCrawlResults() []*web_crawl_go_proto.CrawlResult {
if x != nil {
if x.xxx_hidden_CrawlResults != nil {
return *x.xxx_hidden_CrawlResults
}
}
return nil
}
func (x *WebServiceContext) SetApplicationRoot(v string) {
x.xxx_hidden_ApplicationRoot = v
}
func (x *WebServiceContext) SetSoftware(v *software_go_proto.Software) {
x.xxx_hidden_Software = v
}
func (x *WebServiceContext) SetVersionSet(v *software_go_proto.VersionSet) {
x.xxx_hidden_VersionSet = v
}
func (x *WebServiceContext) SetCrawlResults(v []*web_crawl_go_proto.CrawlResult) {
x.xxx_hidden_CrawlResults = &v
}
func (x *WebServiceContext) HasSoftware() bool {
if x == nil {
return false
}
return x.xxx_hidden_Software != nil
}
func (x *WebServiceContext) HasVersionSet() bool {
if x == nil {
return false
}
return x.xxx_hidden_VersionSet != nil
}
func (x *WebServiceContext) ClearSoftware() {
x.xxx_hidden_Software = nil
}
func (x *WebServiceContext) ClearVersionSet() {
x.xxx_hidden_VersionSet = nil
}
type WebServiceContext_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// The root path of the hosted web application.
ApplicationRoot string
// The web application that is serving under the application root.
Software *software_go_proto.Software
// The detected versions of the web application.
VersionSet *software_go_proto.VersionSet
// Fingerprinter's crawling results for this web service.
CrawlResults []*web_crawl_go_proto.CrawlResult
}
func (b0 WebServiceContext_builder) Build() *WebServiceContext {
m0 := &WebServiceContext{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_ApplicationRoot = b.ApplicationRoot
x.xxx_hidden_Software = b.Software
x.xxx_hidden_VersionSet = b.VersionSet
x.xxx_hidden_CrawlResults = &b.CrawlResults
return m0
}
var File_network_service_proto protoreflect.FileDescriptor
const file_network_service_proto_rawDesc = "" +
"\n" +
"\x15network_service.proto\x12\rtsunami.proto\x1a\rnetwork.proto\x1a\x0esoftware.proto\x1a\x0fweb_crawl.proto\"\xa0\x04\n" +
"\x0eNetworkService\x12I\n" +
"\x10network_endpoint\x18\x01 \x01(\v2\x1e.tsunami.proto.NetworkEndpointR\x0fnetworkEndpoint\x12O\n" +
"\x12transport_protocol\x18\x02 \x01(\x0e2 .tsunami.proto.TransportProtocolR\x11transportProtocol\x12!\n" +
"\fservice_name\x18\x03 \x01(\tR\vserviceName\x123\n" +
"\bsoftware\x18\x04 \x01(\v2\x17.tsunami.proto.SoftwareR\bsoftware\x12:\n" +
"\vversion_set\x18\x05 \x01(\v2\x19.tsunami.proto.VersionSetR\n" +
"versionSet\x12\x16\n" +
"\x06banner\x18\x06 \x03(\tR\x06banner\x12F\n" +
"\x0fservice_context\x18\a \x01(\v2\x1d.tsunami.proto.ServiceContextR\x0eserviceContext\x12\x12\n" +
"\x04cpes\x18\b \x03(\tR\x04cpes\x124\n" +
"\x16supported_ssl_versions\x18\t \x03(\tR\x14supportedSslVersions\x124\n" +
"\x16supported_http_methods\x18\n" +
" \x03(\tR\x14supportedHttpMethods\"o\n" +
"\x0eServiceContext\x12R\n" +
"\x13web_service_context\x18\x01 \x01(\v2 .tsunami.proto.WebServiceContextH\x00R\x11webServiceContextB\t\n" +
"\acontext\"\xf0\x01\n" +
"\x11WebServiceContext\x12)\n" +
"\x10application_root\x18\x01 \x01(\tR\x0fapplicationRoot\x123\n" +
"\bsoftware\x18\x02 \x01(\v2\x17.tsunami.proto.SoftwareR\bsoftware\x12:\n" +
"\vversion_set\x18\x03 \x01(\v2\x19.tsunami.proto.VersionSetR\n" +
"versionSet\x12?\n" +
"\rcrawl_results\x18\x04 \x03(\v2\x1a.tsunami.proto.CrawlResultR\fcrawlResultsB\x80\x01\n" +
"\x18com.google.tsunami.protoB\x14NetworkServiceProtosP\x01ZLgithub.com/google/tsunami-security-scanner/proto/go/network_service_go_protob\x06proto3"
var file_network_service_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_network_service_proto_goTypes = []any{
(*NetworkService)(nil), // 0: tsunami.proto.NetworkService
(*ServiceContext)(nil), // 1: tsunami.proto.ServiceContext
(*WebServiceContext)(nil), // 2: tsunami.proto.WebServiceContext
(*network_go_proto.NetworkEndpoint)(nil), // 3: tsunami.proto.NetworkEndpoint
(network_go_proto.TransportProtocol)(0), // 4: tsunami.proto.TransportProtocol
(*software_go_proto.Software)(nil), // 5: tsunami.proto.Software
(*software_go_proto.VersionSet)(nil), // 6: tsunami.proto.VersionSet
(*web_crawl_go_proto.CrawlResult)(nil), // 7: tsunami.proto.CrawlResult
}
var file_network_service_proto_depIdxs = []int32{
3, // 0: tsunami.proto.NetworkService.network_endpoint:type_name -> tsunami.proto.NetworkEndpoint
4, // 1: tsunami.proto.NetworkService.transport_protocol:type_name -> tsunami.proto.TransportProtocol
5, // 2: tsunami.proto.NetworkService.software:type_name -> tsunami.proto.Software
6, // 3: tsunami.proto.NetworkService.version_set:type_name -> tsunami.proto.VersionSet
1, // 4: tsunami.proto.NetworkService.service_context:type_name -> tsunami.proto.ServiceContext
2, // 5: tsunami.proto.ServiceContext.web_service_context:type_name -> tsunami.proto.WebServiceContext
5, // 6: tsunami.proto.WebServiceContext.software:type_name -> tsunami.proto.Software
6, // 7: tsunami.proto.WebServiceContext.version_set:type_name -> tsunami.proto.VersionSet
7, // 8: tsunami.proto.WebServiceContext.crawl_results:type_name -> tsunami.proto.CrawlResult
9, // [9:9] is the sub-list for method output_type
9, // [9:9] is the sub-list for method input_type
9, // [9:9] is the sub-list for extension type_name
9, // [9:9] is the sub-list for extension extendee
0, // [0:9] is the sub-list for field type_name
}
func init() { file_network_service_proto_init() }
func file_network_service_proto_init() {
if File_network_service_proto != nil {
return
}
file_network_service_proto_msgTypes[1].OneofWrappers = []any{
(*serviceContext_WebServiceContext)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_network_service_proto_rawDesc), len(file_network_service_proto_rawDesc)),
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_network_service_proto_goTypes,
DependencyIndexes: file_network_service_proto_depIdxs,
MessageInfos: file_network_service_proto_msgTypes,
}.Build()
File_network_service_proto = out.File
file_network_service_proto_goTypes = nil
file_network_service_proto_depIdxs = nil
}

View File

@ -1,796 +0,0 @@
//
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Data models utilized by the Tsunami Paylaod Generator
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.10
// protoc v3.21.12
// source: payload_generator.proto
package payload_generator_go_proto
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
reflect "reflect"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type PayloadValidationType int32
const (
PayloadValidationType_VALIDATION_TYPE_UNSPECIFIED PayloadValidationType = 0
PayloadValidationType_VALIDATION_REGEX PayloadValidationType = 1
)
// Enum value maps for PayloadValidationType.
var (
PayloadValidationType_name = map[int32]string{
0: "VALIDATION_TYPE_UNSPECIFIED",
1: "VALIDATION_REGEX",
}
PayloadValidationType_value = map[string]int32{
"VALIDATION_TYPE_UNSPECIFIED": 0,
"VALIDATION_REGEX": 1,
}
)
func (x PayloadValidationType) Enum() *PayloadValidationType {
p := new(PayloadValidationType)
*p = x
return p
}
func (x PayloadValidationType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (PayloadValidationType) Descriptor() protoreflect.EnumDescriptor {
return file_payload_generator_proto_enumTypes[0].Descriptor()
}
func (PayloadValidationType) Type() protoreflect.EnumType {
return &file_payload_generator_proto_enumTypes[0]
}
func (x PayloadValidationType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// The type of vulnerability the detector is looking for
type PayloadGeneratorConfig_VulnerabilityType int32
const (
// Unspecified vulnerability type
PayloadGeneratorConfig_VULNERABILITY_TYPE_UNSPECIFIED PayloadGeneratorConfig_VulnerabilityType = 0
// RCE which returns the output of the execution
PayloadGeneratorConfig_REFLECTIVE_RCE PayloadGeneratorConfig_VulnerabilityType = 1
// RCE which does not return the output of the execution
PayloadGeneratorConfig_BLIND_RCE PayloadGeneratorConfig_VulnerabilityType = 2
// Server-Side Request Forgery
PayloadGeneratorConfig_SSRF PayloadGeneratorConfig_VulnerabilityType = 3
// Arbitrary File Write
PayloadGeneratorConfig_ARBITRARY_FILE_WRITE PayloadGeneratorConfig_VulnerabilityType = 4
// RCE without output of the execution + File Read (needed to get
// confirmation string)
PayloadGeneratorConfig_BLIND_RCE_FILE_READ PayloadGeneratorConfig_VulnerabilityType = 5
)
// Enum value maps for PayloadGeneratorConfig_VulnerabilityType.
var (
PayloadGeneratorConfig_VulnerabilityType_name = map[int32]string{
0: "VULNERABILITY_TYPE_UNSPECIFIED",
1: "REFLECTIVE_RCE",
2: "BLIND_RCE",
3: "SSRF",
4: "ARBITRARY_FILE_WRITE",
5: "BLIND_RCE_FILE_READ",
}
PayloadGeneratorConfig_VulnerabilityType_value = map[string]int32{
"VULNERABILITY_TYPE_UNSPECIFIED": 0,
"REFLECTIVE_RCE": 1,
"BLIND_RCE": 2,
"SSRF": 3,
"ARBITRARY_FILE_WRITE": 4,
"BLIND_RCE_FILE_READ": 5,
}
)
func (x PayloadGeneratorConfig_VulnerabilityType) Enum() *PayloadGeneratorConfig_VulnerabilityType {
p := new(PayloadGeneratorConfig_VulnerabilityType)
*p = x
return p
}
func (x PayloadGeneratorConfig_VulnerabilityType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (PayloadGeneratorConfig_VulnerabilityType) Descriptor() protoreflect.EnumDescriptor {
return file_payload_generator_proto_enumTypes[1].Descriptor()
}
func (PayloadGeneratorConfig_VulnerabilityType) Type() protoreflect.EnumType {
return &file_payload_generator_proto_enumTypes[1]
}
func (x PayloadGeneratorConfig_VulnerabilityType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// The environment that processes the payload for execution e.g. a PHP-based
// target likely wants a payload that is itself PHP code.
type PayloadGeneratorConfig_InterpretationEnvironment int32
const (
// Unspecified interpretation environment type
PayloadGeneratorConfig_INTERPRETATION_ENVIRONMENT_UNSPECIFIED PayloadGeneratorConfig_InterpretationEnvironment = 0
// Payload is interpreted within a Linux shell environment
PayloadGeneratorConfig_LINUX_SHELL PayloadGeneratorConfig_InterpretationEnvironment = 1
// Payload is interpreted wihin a Java compiler context
PayloadGeneratorConfig_JAVA PayloadGeneratorConfig_InterpretationEnvironment = 2
// Payload is interpreted wihin a PHP VM context
PayloadGeneratorConfig_PHP PayloadGeneratorConfig_InterpretationEnvironment = 3
// Interpretation environment doesn't matter
PayloadGeneratorConfig_INTERPRETATION_ANY PayloadGeneratorConfig_InterpretationEnvironment = 4
// Payload is interpreted wihin crontab
PayloadGeneratorConfig_LINUX_ROOT_CRONTAB PayloadGeneratorConfig_InterpretationEnvironment = 5
// Payload is interpreted wihin a Windows shell environment
PayloadGeneratorConfig_WINDOWS_SHELL PayloadGeneratorConfig_InterpretationEnvironment = 6
// Payload is interpreted within a JSP shell environment
PayloadGeneratorConfig_JSP PayloadGeneratorConfig_InterpretationEnvironment = 7
)
// Enum value maps for PayloadGeneratorConfig_InterpretationEnvironment.
var (
PayloadGeneratorConfig_InterpretationEnvironment_name = map[int32]string{
0: "INTERPRETATION_ENVIRONMENT_UNSPECIFIED",
1: "LINUX_SHELL",
2: "JAVA",
3: "PHP",
4: "INTERPRETATION_ANY",
5: "LINUX_ROOT_CRONTAB",
6: "WINDOWS_SHELL",
7: "JSP",
}
PayloadGeneratorConfig_InterpretationEnvironment_value = map[string]int32{
"INTERPRETATION_ENVIRONMENT_UNSPECIFIED": 0,
"LINUX_SHELL": 1,
"JAVA": 2,
"PHP": 3,
"INTERPRETATION_ANY": 4,
"LINUX_ROOT_CRONTAB": 5,
"WINDOWS_SHELL": 6,
"JSP": 7,
}
)
func (x PayloadGeneratorConfig_InterpretationEnvironment) Enum() *PayloadGeneratorConfig_InterpretationEnvironment {
p := new(PayloadGeneratorConfig_InterpretationEnvironment)
*p = x
return p
}
func (x PayloadGeneratorConfig_InterpretationEnvironment) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (PayloadGeneratorConfig_InterpretationEnvironment) Descriptor() protoreflect.EnumDescriptor {
return file_payload_generator_proto_enumTypes[2].Descriptor()
}
func (PayloadGeneratorConfig_InterpretationEnvironment) Type() protoreflect.EnumType {
return &file_payload_generator_proto_enumTypes[2]
}
func (x PayloadGeneratorConfig_InterpretationEnvironment) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// The actual runtime environment when the payload is run e.g. while a
// PHP-based target wants a PHP-interpretation environment, the actual code
// execution may happen via the Linux shell: exec(“echo \”this is running in
// the system.\””).
type PayloadGeneratorConfig_ExecutionEnvironment int32
const (
// Unspecified execution environment type
PayloadGeneratorConfig_EXECUTION_ENVIRONMENT_UNSPECIFIED PayloadGeneratorConfig_ExecutionEnvironment = 0
// Execute within the InterpretationEnvironment
PayloadGeneratorConfig_EXEC_INTERPRETATION_ENVIRONMENT PayloadGeneratorConfig_ExecutionEnvironment = 1
// Execution environment doesn't matter
PayloadGeneratorConfig_EXEC_ANY PayloadGeneratorConfig_ExecutionEnvironment = 2
)
// Enum value maps for PayloadGeneratorConfig_ExecutionEnvironment.
var (
PayloadGeneratorConfig_ExecutionEnvironment_name = map[int32]string{
0: "EXECUTION_ENVIRONMENT_UNSPECIFIED",
1: "EXEC_INTERPRETATION_ENVIRONMENT",
2: "EXEC_ANY",
}
PayloadGeneratorConfig_ExecutionEnvironment_value = map[string]int32{
"EXECUTION_ENVIRONMENT_UNSPECIFIED": 0,
"EXEC_INTERPRETATION_ENVIRONMENT": 1,
"EXEC_ANY": 2,
}
)
func (x PayloadGeneratorConfig_ExecutionEnvironment) Enum() *PayloadGeneratorConfig_ExecutionEnvironment {
p := new(PayloadGeneratorConfig_ExecutionEnvironment)
*p = x
return p
}
func (x PayloadGeneratorConfig_ExecutionEnvironment) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (PayloadGeneratorConfig_ExecutionEnvironment) Descriptor() protoreflect.EnumDescriptor {
return file_payload_generator_proto_enumTypes[3].Descriptor()
}
func (PayloadGeneratorConfig_ExecutionEnvironment) Type() protoreflect.EnumType {
return &file_payload_generator_proto_enumTypes[3]
}
func (x PayloadGeneratorConfig_ExecutionEnvironment) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Attributes utilized by the PayloadGenerator to select a payload
type PayloadGeneratorConfig struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_VulnerabilityType PayloadGeneratorConfig_VulnerabilityType `protobuf:"varint,2,opt,name=vulnerability_type,json=vulnerabilityType,proto3,enum=tsunami.proto.PayloadGeneratorConfig_VulnerabilityType"`
xxx_hidden_InterpretationEnvironment PayloadGeneratorConfig_InterpretationEnvironment `protobuf:"varint,3,opt,name=interpretation_environment,json=interpretationEnvironment,proto3,enum=tsunami.proto.PayloadGeneratorConfig_InterpretationEnvironment"`
xxx_hidden_ExecutionEnvironment PayloadGeneratorConfig_ExecutionEnvironment `protobuf:"varint,4,opt,name=execution_environment,json=executionEnvironment,proto3,enum=tsunami.proto.PayloadGeneratorConfig_ExecutionEnvironment"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PayloadGeneratorConfig) Reset() {
*x = PayloadGeneratorConfig{}
mi := &file_payload_generator_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PayloadGeneratorConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PayloadGeneratorConfig) ProtoMessage() {}
func (x *PayloadGeneratorConfig) ProtoReflect() protoreflect.Message {
mi := &file_payload_generator_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *PayloadGeneratorConfig) GetVulnerabilityType() PayloadGeneratorConfig_VulnerabilityType {
if x != nil {
return x.xxx_hidden_VulnerabilityType
}
return PayloadGeneratorConfig_VULNERABILITY_TYPE_UNSPECIFIED
}
func (x *PayloadGeneratorConfig) GetInterpretationEnvironment() PayloadGeneratorConfig_InterpretationEnvironment {
if x != nil {
return x.xxx_hidden_InterpretationEnvironment
}
return PayloadGeneratorConfig_INTERPRETATION_ENVIRONMENT_UNSPECIFIED
}
func (x *PayloadGeneratorConfig) GetExecutionEnvironment() PayloadGeneratorConfig_ExecutionEnvironment {
if x != nil {
return x.xxx_hidden_ExecutionEnvironment
}
return PayloadGeneratorConfig_EXECUTION_ENVIRONMENT_UNSPECIFIED
}
func (x *PayloadGeneratorConfig) SetVulnerabilityType(v PayloadGeneratorConfig_VulnerabilityType) {
x.xxx_hidden_VulnerabilityType = v
}
func (x *PayloadGeneratorConfig) SetInterpretationEnvironment(v PayloadGeneratorConfig_InterpretationEnvironment) {
x.xxx_hidden_InterpretationEnvironment = v
}
func (x *PayloadGeneratorConfig) SetExecutionEnvironment(v PayloadGeneratorConfig_ExecutionEnvironment) {
x.xxx_hidden_ExecutionEnvironment = v
}
type PayloadGeneratorConfig_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
VulnerabilityType PayloadGeneratorConfig_VulnerabilityType
InterpretationEnvironment PayloadGeneratorConfig_InterpretationEnvironment
ExecutionEnvironment PayloadGeneratorConfig_ExecutionEnvironment
}
func (b0 PayloadGeneratorConfig_builder) Build() *PayloadGeneratorConfig {
m0 := &PayloadGeneratorConfig{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_VulnerabilityType = b.VulnerabilityType
x.xxx_hidden_InterpretationEnvironment = b.InterpretationEnvironment
x.xxx_hidden_ExecutionEnvironment = b.ExecutionEnvironment
return m0
}
// Attributes of a payload. A detector can check these attributes to change its
// logic based on the payload type.
type PayloadAttributes struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_UsesCallbackServer bool `protobuf:"varint,1,opt,name=uses_callback_server,json=usesCallbackServer,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PayloadAttributes) Reset() {
*x = PayloadAttributes{}
mi := &file_payload_generator_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PayloadAttributes) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PayloadAttributes) ProtoMessage() {}
func (x *PayloadAttributes) ProtoReflect() protoreflect.Message {
mi := &file_payload_generator_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *PayloadAttributes) GetUsesCallbackServer() bool {
if x != nil {
return x.xxx_hidden_UsesCallbackServer
}
return false
}
func (x *PayloadAttributes) SetUsesCallbackServer(v bool) {
x.xxx_hidden_UsesCallbackServer = v
}
type PayloadAttributes_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Whether the payload uses the callback server
UsesCallbackServer bool
}
func (b0 PayloadAttributes_builder) Build() *PayloadAttributes {
m0 := &PayloadAttributes{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_UsesCallbackServer = b.UsesCallbackServer
return m0
}
// Container type for payload_definitions.yaml
type PayloadLibrary struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Payloads *[]*PayloadDefinition `protobuf:"bytes,1,rep,name=payloads,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PayloadLibrary) Reset() {
*x = PayloadLibrary{}
mi := &file_payload_generator_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PayloadLibrary) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PayloadLibrary) ProtoMessage() {}
func (x *PayloadLibrary) ProtoReflect() protoreflect.Message {
mi := &file_payload_generator_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *PayloadLibrary) GetPayloads() []*PayloadDefinition {
if x != nil {
if x.xxx_hidden_Payloads != nil {
return *x.xxx_hidden_Payloads
}
}
return nil
}
func (x *PayloadLibrary) SetPayloads(v []*PayloadDefinition) {
x.xxx_hidden_Payloads = &v
}
type PayloadLibrary_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
Payloads []*PayloadDefinition
}
func (b0 PayloadLibrary_builder) Build() *PayloadLibrary {
m0 := &PayloadLibrary{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Payloads = &b.Payloads
return m0
}
// Schema for each entry in payload_definitions.yaml
// Note: this message uses StringValue and BoolValue because we validate whether
// each payload definition in the yaml file has the correct fields present.
// Since empty proto fields are given default values (proto fields are not
// nullable), we use the wrapped types to check for actual presence.
type PayloadDefinition struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Name *wrapperspb.StringValue `protobuf:"bytes,1,opt,name=name,proto3"`
xxx_hidden_InterpretationEnvironment PayloadGeneratorConfig_InterpretationEnvironment `protobuf:"varint,2,opt,name=interpretation_environment,json=interpretationEnvironment,proto3,enum=tsunami.proto.PayloadGeneratorConfig_InterpretationEnvironment"`
xxx_hidden_ExecutionEnvironment PayloadGeneratorConfig_ExecutionEnvironment `protobuf:"varint,3,opt,name=execution_environment,json=executionEnvironment,proto3,enum=tsunami.proto.PayloadGeneratorConfig_ExecutionEnvironment"`
xxx_hidden_VulnerabilityType []PayloadGeneratorConfig_VulnerabilityType `protobuf:"varint,4,rep,packed,name=vulnerability_type,json=vulnerabilityType,proto3,enum=tsunami.proto.PayloadGeneratorConfig_VulnerabilityType"`
xxx_hidden_UsesCallbackServer *wrapperspb.BoolValue `protobuf:"bytes,5,opt,name=uses_callback_server,json=usesCallbackServer,proto3"`
xxx_hidden_PayloadString *wrapperspb.StringValue `protobuf:"bytes,6,opt,name=payload_string,json=payloadString,proto3"`
xxx_hidden_ValidationType PayloadValidationType `protobuf:"varint,7,opt,name=validation_type,json=validationType,proto3,enum=tsunami.proto.PayloadValidationType"`
xxx_hidden_ValidationRegex *wrapperspb.StringValue `protobuf:"bytes,8,opt,name=validation_regex,json=validationRegex,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PayloadDefinition) Reset() {
*x = PayloadDefinition{}
mi := &file_payload_generator_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PayloadDefinition) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PayloadDefinition) ProtoMessage() {}
func (x *PayloadDefinition) ProtoReflect() protoreflect.Message {
mi := &file_payload_generator_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *PayloadDefinition) GetName() *wrapperspb.StringValue {
if x != nil {
return x.xxx_hidden_Name
}
return nil
}
func (x *PayloadDefinition) GetInterpretationEnvironment() PayloadGeneratorConfig_InterpretationEnvironment {
if x != nil {
return x.xxx_hidden_InterpretationEnvironment
}
return PayloadGeneratorConfig_INTERPRETATION_ENVIRONMENT_UNSPECIFIED
}
func (x *PayloadDefinition) GetExecutionEnvironment() PayloadGeneratorConfig_ExecutionEnvironment {
if x != nil {
return x.xxx_hidden_ExecutionEnvironment
}
return PayloadGeneratorConfig_EXECUTION_ENVIRONMENT_UNSPECIFIED
}
func (x *PayloadDefinition) GetVulnerabilityType() []PayloadGeneratorConfig_VulnerabilityType {
if x != nil {
return x.xxx_hidden_VulnerabilityType
}
return nil
}
func (x *PayloadDefinition) GetUsesCallbackServer() *wrapperspb.BoolValue {
if x != nil {
return x.xxx_hidden_UsesCallbackServer
}
return nil
}
func (x *PayloadDefinition) GetPayloadString() *wrapperspb.StringValue {
if x != nil {
return x.xxx_hidden_PayloadString
}
return nil
}
func (x *PayloadDefinition) GetValidationType() PayloadValidationType {
if x != nil {
return x.xxx_hidden_ValidationType
}
return PayloadValidationType_VALIDATION_TYPE_UNSPECIFIED
}
func (x *PayloadDefinition) GetValidationRegex() *wrapperspb.StringValue {
if x != nil {
return x.xxx_hidden_ValidationRegex
}
return nil
}
func (x *PayloadDefinition) SetName(v *wrapperspb.StringValue) {
x.xxx_hidden_Name = v
}
func (x *PayloadDefinition) SetInterpretationEnvironment(v PayloadGeneratorConfig_InterpretationEnvironment) {
x.xxx_hidden_InterpretationEnvironment = v
}
func (x *PayloadDefinition) SetExecutionEnvironment(v PayloadGeneratorConfig_ExecutionEnvironment) {
x.xxx_hidden_ExecutionEnvironment = v
}
func (x *PayloadDefinition) SetVulnerabilityType(v []PayloadGeneratorConfig_VulnerabilityType) {
x.xxx_hidden_VulnerabilityType = v
}
func (x *PayloadDefinition) SetUsesCallbackServer(v *wrapperspb.BoolValue) {
x.xxx_hidden_UsesCallbackServer = v
}
func (x *PayloadDefinition) SetPayloadString(v *wrapperspb.StringValue) {
x.xxx_hidden_PayloadString = v
}
func (x *PayloadDefinition) SetValidationType(v PayloadValidationType) {
x.xxx_hidden_ValidationType = v
}
func (x *PayloadDefinition) SetValidationRegex(v *wrapperspb.StringValue) {
x.xxx_hidden_ValidationRegex = v
}
func (x *PayloadDefinition) HasName() bool {
if x == nil {
return false
}
return x.xxx_hidden_Name != nil
}
func (x *PayloadDefinition) HasUsesCallbackServer() bool {
if x == nil {
return false
}
return x.xxx_hidden_UsesCallbackServer != nil
}
func (x *PayloadDefinition) HasPayloadString() bool {
if x == nil {
return false
}
return x.xxx_hidden_PayloadString != nil
}
func (x *PayloadDefinition) HasValidationRegex() bool {
if x == nil {
return false
}
return x.xxx_hidden_ValidationRegex != nil
}
func (x *PayloadDefinition) ClearName() {
x.xxx_hidden_Name = nil
}
func (x *PayloadDefinition) ClearUsesCallbackServer() {
x.xxx_hidden_UsesCallbackServer = nil
}
func (x *PayloadDefinition) ClearPayloadString() {
x.xxx_hidden_PayloadString = nil
}
func (x *PayloadDefinition) ClearValidationRegex() {
x.xxx_hidden_ValidationRegex = nil
}
type PayloadDefinition_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// The human-readable string to identify the payload
Name *wrapperspb.StringValue
InterpretationEnvironment PayloadGeneratorConfig_InterpretationEnvironment
ExecutionEnvironment PayloadGeneratorConfig_ExecutionEnvironment
// All vulnerability types this payload can be used for
VulnerabilityType []PayloadGeneratorConfig_VulnerabilityType
// If true, payload_string must contain the $TSUNAMI_PAYLOAD_TOKEN_URL
// token. Validation will automatically check against the callback server, so
// the validation* fields do not need to be set.
UsesCallbackServer *wrapperspb.BoolValue
// The actual payload command string. The following special tokens can be
// used which will cause the framework to inject dynamic content into the
// command:
// - $TSUNAMI_PAYLOAD_TOKEN_URL: url for the callback server
// - a random string, used to reduce false positives.
PayloadString *wrapperspb.StringValue
// The type of validation function for determining if the payload was
// executed. Currently, only REGEX is supported.
ValidationType PayloadValidationType
// Required if validation_type == REGEX. Must be compatible with
// java.util.regex.Pattern. The string will first be preprocessed before
// applied as a regex, replacing any of the following tokens with the
// corresponding values supplied by the framework:
// - $TSUNAMI_PAYLOAD_TOKEN_RANDOM: a random string, used to reduce false
// positives. The value is guaranteed to be the same as the value supplied
// to payload_string.
ValidationRegex *wrapperspb.StringValue
}
func (b0 PayloadDefinition_builder) Build() *PayloadDefinition {
m0 := &PayloadDefinition{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Name = b.Name
x.xxx_hidden_InterpretationEnvironment = b.InterpretationEnvironment
x.xxx_hidden_ExecutionEnvironment = b.ExecutionEnvironment
x.xxx_hidden_VulnerabilityType = b.VulnerabilityType
x.xxx_hidden_UsesCallbackServer = b.UsesCallbackServer
x.xxx_hidden_PayloadString = b.PayloadString
x.xxx_hidden_ValidationType = b.ValidationType
x.xxx_hidden_ValidationRegex = b.ValidationRegex
return m0
}
var File_payload_generator_proto protoreflect.FileDescriptor
const file_payload_generator_proto_rawDesc = "" +
"\n" +
"\x17payload_generator.proto\x12\rtsunami.proto\x1a\x1egoogle/protobuf/wrappers.proto\"\xb7\x06\n" +
"\x16PayloadGeneratorConfig\x12f\n" +
"\x12vulnerability_type\x18\x02 \x01(\x0e27.tsunami.proto.PayloadGeneratorConfig.VulnerabilityTypeR\x11vulnerabilityType\x12~\n" +
"\x1ainterpretation_environment\x18\x03 \x01(\x0e2?.tsunami.proto.PayloadGeneratorConfig.InterpretationEnvironmentR\x19interpretationEnvironment\x12o\n" +
"\x15execution_environment\x18\x04 \x01(\x0e2:.tsunami.proto.PayloadGeneratorConfig.ExecutionEnvironmentR\x14executionEnvironment\"\x97\x01\n" +
"\x11VulnerabilityType\x12\"\n" +
"\x1eVULNERABILITY_TYPE_UNSPECIFIED\x10\x00\x12\x12\n" +
"\x0eREFLECTIVE_RCE\x10\x01\x12\r\n" +
"\tBLIND_RCE\x10\x02\x12\b\n" +
"\x04SSRF\x10\x03\x12\x18\n" +
"\x14ARBITRARY_FILE_WRITE\x10\x04\x12\x17\n" +
"\x13BLIND_RCE_FILE_READ\x10\x05\"\xb7\x01\n" +
"\x19InterpretationEnvironment\x12*\n" +
"&INTERPRETATION_ENVIRONMENT_UNSPECIFIED\x10\x00\x12\x0f\n" +
"\vLINUX_SHELL\x10\x01\x12\b\n" +
"\x04JAVA\x10\x02\x12\a\n" +
"\x03PHP\x10\x03\x12\x16\n" +
"\x12INTERPRETATION_ANY\x10\x04\x12\x16\n" +
"\x12LINUX_ROOT_CRONTAB\x10\x05\x12\x11\n" +
"\rWINDOWS_SHELL\x10\x06\x12\a\n" +
"\x03JSP\x10\a\"p\n" +
"\x14ExecutionEnvironment\x12%\n" +
"!EXECUTION_ENVIRONMENT_UNSPECIFIED\x10\x00\x12#\n" +
"\x1fEXEC_INTERPRETATION_ENVIRONMENT\x10\x01\x12\f\n" +
"\bEXEC_ANY\x10\x02\"E\n" +
"\x11PayloadAttributes\x120\n" +
"\x14uses_callback_server\x18\x01 \x01(\bR\x12usesCallbackServer\"N\n" +
"\x0ePayloadLibrary\x12<\n" +
"\bpayloads\x18\x01 \x03(\v2 .tsunami.proto.PayloadDefinitionR\bpayloads\"\xc9\x05\n" +
"\x11PayloadDefinition\x120\n" +
"\x04name\x18\x01 \x01(\v2\x1c.google.protobuf.StringValueR\x04name\x12~\n" +
"\x1ainterpretation_environment\x18\x02 \x01(\x0e2?.tsunami.proto.PayloadGeneratorConfig.InterpretationEnvironmentR\x19interpretationEnvironment\x12o\n" +
"\x15execution_environment\x18\x03 \x01(\x0e2:.tsunami.proto.PayloadGeneratorConfig.ExecutionEnvironmentR\x14executionEnvironment\x12f\n" +
"\x12vulnerability_type\x18\x04 \x03(\x0e27.tsunami.proto.PayloadGeneratorConfig.VulnerabilityTypeR\x11vulnerabilityType\x12L\n" +
"\x14uses_callback_server\x18\x05 \x01(\v2\x1a.google.protobuf.BoolValueR\x12usesCallbackServer\x12C\n" +
"\x0epayload_string\x18\x06 \x01(\v2\x1c.google.protobuf.StringValueR\rpayloadString\x12M\n" +
"\x0fvalidation_type\x18\a \x01(\x0e2$.tsunami.proto.PayloadValidationTypeR\x0evalidationType\x12G\n" +
"\x10validation_regex\x18\b \x01(\v2\x1c.google.protobuf.StringValueR\x0fvalidationRegex*N\n" +
"\x15PayloadValidationType\x12\x1f\n" +
"\x1bVALIDATION_TYPE_UNSPECIFIED\x10\x00\x12\x14\n" +
"\x10VALIDATION_REGEX\x10\x01B\x84\x01\n" +
"\x18com.google.tsunami.protoB\x16PayloadGeneratorProtosP\x01ZNgithub.com/google/tsunami-security-scanner/proto/go/payload_generator_go_protob\x06proto3"
var file_payload_generator_proto_enumTypes = make([]protoimpl.EnumInfo, 4)
var file_payload_generator_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_payload_generator_proto_goTypes = []any{
(PayloadValidationType)(0), // 0: tsunami.proto.PayloadValidationType
(PayloadGeneratorConfig_VulnerabilityType)(0), // 1: tsunami.proto.PayloadGeneratorConfig.VulnerabilityType
(PayloadGeneratorConfig_InterpretationEnvironment)(0), // 2: tsunami.proto.PayloadGeneratorConfig.InterpretationEnvironment
(PayloadGeneratorConfig_ExecutionEnvironment)(0), // 3: tsunami.proto.PayloadGeneratorConfig.ExecutionEnvironment
(*PayloadGeneratorConfig)(nil), // 4: tsunami.proto.PayloadGeneratorConfig
(*PayloadAttributes)(nil), // 5: tsunami.proto.PayloadAttributes
(*PayloadLibrary)(nil), // 6: tsunami.proto.PayloadLibrary
(*PayloadDefinition)(nil), // 7: tsunami.proto.PayloadDefinition
(*wrapperspb.StringValue)(nil), // 8: google.protobuf.StringValue
(*wrapperspb.BoolValue)(nil), // 9: google.protobuf.BoolValue
}
var file_payload_generator_proto_depIdxs = []int32{
1, // 0: tsunami.proto.PayloadGeneratorConfig.vulnerability_type:type_name -> tsunami.proto.PayloadGeneratorConfig.VulnerabilityType
2, // 1: tsunami.proto.PayloadGeneratorConfig.interpretation_environment:type_name -> tsunami.proto.PayloadGeneratorConfig.InterpretationEnvironment
3, // 2: tsunami.proto.PayloadGeneratorConfig.execution_environment:type_name -> tsunami.proto.PayloadGeneratorConfig.ExecutionEnvironment
7, // 3: tsunami.proto.PayloadLibrary.payloads:type_name -> tsunami.proto.PayloadDefinition
8, // 4: tsunami.proto.PayloadDefinition.name:type_name -> google.protobuf.StringValue
2, // 5: tsunami.proto.PayloadDefinition.interpretation_environment:type_name -> tsunami.proto.PayloadGeneratorConfig.InterpretationEnvironment
3, // 6: tsunami.proto.PayloadDefinition.execution_environment:type_name -> tsunami.proto.PayloadGeneratorConfig.ExecutionEnvironment
1, // 7: tsunami.proto.PayloadDefinition.vulnerability_type:type_name -> tsunami.proto.PayloadGeneratorConfig.VulnerabilityType
9, // 8: tsunami.proto.PayloadDefinition.uses_callback_server:type_name -> google.protobuf.BoolValue
8, // 9: tsunami.proto.PayloadDefinition.payload_string:type_name -> google.protobuf.StringValue
0, // 10: tsunami.proto.PayloadDefinition.validation_type:type_name -> tsunami.proto.PayloadValidationType
8, // 11: tsunami.proto.PayloadDefinition.validation_regex:type_name -> google.protobuf.StringValue
12, // [12:12] is the sub-list for method output_type
12, // [12:12] is the sub-list for method input_type
12, // [12:12] is the sub-list for extension type_name
12, // [12:12] is the sub-list for extension extendee
0, // [0:12] is the sub-list for field type_name
}
func init() { file_payload_generator_proto_init() }
func file_payload_generator_proto_init() {
if File_payload_generator_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_payload_generator_proto_rawDesc), len(file_payload_generator_proto_rawDesc)),
NumEnums: 4,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_payload_generator_proto_goTypes,
DependencyIndexes: file_payload_generator_proto_depIdxs,
EnumInfos: file_payload_generator_proto_enumTypes,
MessageInfos: file_payload_generator_proto_msgTypes,
}.Build()
File_payload_generator_proto = out.File
file_payload_generator_proto_goTypes = nil
file_payload_generator_proto_depIdxs = nil
}

View File

@ -1,686 +0,0 @@
//
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Representation of a tsunami plugin definition passed between language
// servers.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.10
// protoc v3.21.12
// source: plugin_representation.proto
package plugin_representation_go_proto
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type PluginInfo_PluginType int32
const (
// Plugin is an unspecified type.
PluginInfo_PLUGIN_TYPE_UNSPECIFIED PluginInfo_PluginType = 0
// Plugin is a port scanner.
PluginInfo_PORT_SCAN PluginInfo_PluginType = 1
// Plugin is a service fingerprinter.
PluginInfo_SERVICE_FINGERPRINT PluginInfo_PluginType = 2
// Plugin is a vulnerability detector.
PluginInfo_VULN_DETECTION PluginInfo_PluginType = 3
)
// Enum value maps for PluginInfo_PluginType.
var (
PluginInfo_PluginType_name = map[int32]string{
0: "PLUGIN_TYPE_UNSPECIFIED",
1: "PORT_SCAN",
2: "SERVICE_FINGERPRINT",
3: "VULN_DETECTION",
}
PluginInfo_PluginType_value = map[string]int32{
"PLUGIN_TYPE_UNSPECIFIED": 0,
"PORT_SCAN": 1,
"SERVICE_FINGERPRINT": 2,
"VULN_DETECTION": 3,
}
)
func (x PluginInfo_PluginType) Enum() *PluginInfo_PluginType {
p := new(PluginInfo_PluginType)
*p = x
return p
}
func (x PluginInfo_PluginType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (PluginInfo_PluginType) Descriptor() protoreflect.EnumDescriptor {
return file_plugin_representation_proto_enumTypes[0].Descriptor()
}
func (PluginInfo_PluginType) Type() protoreflect.EnumType {
return &file_plugin_representation_proto_enumTypes[0]
}
func (x PluginInfo_PluginType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Represents a PluginDefinition placeholder.
type PluginDefinition struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Info *PluginInfo `protobuf:"bytes,1,opt,name=info,proto3"`
xxx_hidden_TargetServiceName *TargetServiceName `protobuf:"bytes,2,opt,name=target_service_name,json=targetServiceName,proto3"`
xxx_hidden_TargetSoftware *TargetSoftware `protobuf:"bytes,3,opt,name=target_software,json=targetSoftware,proto3"`
xxx_hidden_ForWebService bool `protobuf:"varint,4,opt,name=for_web_service,json=forWebService,proto3"`
xxx_hidden_TargetOperatingSystemClass *TargetOperatingSystemClass `protobuf:"bytes,5,opt,name=target_operating_system_class,json=targetOperatingSystemClass,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PluginDefinition) Reset() {
*x = PluginDefinition{}
mi := &file_plugin_representation_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PluginDefinition) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PluginDefinition) ProtoMessage() {}
func (x *PluginDefinition) ProtoReflect() protoreflect.Message {
mi := &file_plugin_representation_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *PluginDefinition) GetInfo() *PluginInfo {
if x != nil {
return x.xxx_hidden_Info
}
return nil
}
func (x *PluginDefinition) GetTargetServiceName() *TargetServiceName {
if x != nil {
return x.xxx_hidden_TargetServiceName
}
return nil
}
func (x *PluginDefinition) GetTargetSoftware() *TargetSoftware {
if x != nil {
return x.xxx_hidden_TargetSoftware
}
return nil
}
func (x *PluginDefinition) GetForWebService() bool {
if x != nil {
return x.xxx_hidden_ForWebService
}
return false
}
func (x *PluginDefinition) GetTargetOperatingSystemClass() *TargetOperatingSystemClass {
if x != nil {
return x.xxx_hidden_TargetOperatingSystemClass
}
return nil
}
func (x *PluginDefinition) SetInfo(v *PluginInfo) {
x.xxx_hidden_Info = v
}
func (x *PluginDefinition) SetTargetServiceName(v *TargetServiceName) {
x.xxx_hidden_TargetServiceName = v
}
func (x *PluginDefinition) SetTargetSoftware(v *TargetSoftware) {
x.xxx_hidden_TargetSoftware = v
}
func (x *PluginDefinition) SetForWebService(v bool) {
x.xxx_hidden_ForWebService = v
}
func (x *PluginDefinition) SetTargetOperatingSystemClass(v *TargetOperatingSystemClass) {
x.xxx_hidden_TargetOperatingSystemClass = v
}
func (x *PluginDefinition) HasInfo() bool {
if x == nil {
return false
}
return x.xxx_hidden_Info != nil
}
func (x *PluginDefinition) HasTargetServiceName() bool {
if x == nil {
return false
}
return x.xxx_hidden_TargetServiceName != nil
}
func (x *PluginDefinition) HasTargetSoftware() bool {
if x == nil {
return false
}
return x.xxx_hidden_TargetSoftware != nil
}
func (x *PluginDefinition) HasTargetOperatingSystemClass() bool {
if x == nil {
return false
}
return x.xxx_hidden_TargetOperatingSystemClass != nil
}
func (x *PluginDefinition) ClearInfo() {
x.xxx_hidden_Info = nil
}
func (x *PluginDefinition) ClearTargetServiceName() {
x.xxx_hidden_TargetServiceName = nil
}
func (x *PluginDefinition) ClearTargetSoftware() {
x.xxx_hidden_TargetSoftware = nil
}
func (x *PluginDefinition) ClearTargetOperatingSystemClass() {
x.xxx_hidden_TargetOperatingSystemClass = nil
}
type PluginDefinition_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// PluginInfo of this definition.
Info *PluginInfo
// The name of the target service.
TargetServiceName *TargetServiceName
// The name of the target software.
TargetSoftware *TargetSoftware
// If the definition is for a web service or not.
ForWebService bool
// If the definition is for a specific operating system or not.
// Note: this filter is executed within an AND condition with the other
// filters. E.g. if target_service_name.value is "http" and
// target_operating_system.osclass.family is "Linux" then the plugin will only
// match if the service is http and the operating system is Linux.
TargetOperatingSystemClass *TargetOperatingSystemClass
}
func (b0 PluginDefinition_builder) Build() *PluginDefinition {
m0 := &PluginDefinition{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Info = b.Info
x.xxx_hidden_TargetServiceName = b.TargetServiceName
x.xxx_hidden_TargetSoftware = b.TargetSoftware
x.xxx_hidden_ForWebService = b.ForWebService
x.xxx_hidden_TargetOperatingSystemClass = b.TargetOperatingSystemClass
return m0
}
// Represents a PluginInfo annotation placeholder used by the
// PluginDefinition proto above.
type PluginInfo struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Type PluginInfo_PluginType `protobuf:"varint,1,opt,name=type,proto3,enum=tsunami.proto.PluginInfo_PluginType"`
xxx_hidden_Name string `protobuf:"bytes,2,opt,name=name,proto3"`
xxx_hidden_Version string `protobuf:"bytes,3,opt,name=version,proto3"`
xxx_hidden_Description string `protobuf:"bytes,4,opt,name=description,proto3"`
xxx_hidden_Author string `protobuf:"bytes,5,opt,name=author,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PluginInfo) Reset() {
*x = PluginInfo{}
mi := &file_plugin_representation_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PluginInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PluginInfo) ProtoMessage() {}
func (x *PluginInfo) ProtoReflect() protoreflect.Message {
mi := &file_plugin_representation_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *PluginInfo) GetType() PluginInfo_PluginType {
if x != nil {
return x.xxx_hidden_Type
}
return PluginInfo_PLUGIN_TYPE_UNSPECIFIED
}
func (x *PluginInfo) GetName() string {
if x != nil {
return x.xxx_hidden_Name
}
return ""
}
func (x *PluginInfo) GetVersion() string {
if x != nil {
return x.xxx_hidden_Version
}
return ""
}
func (x *PluginInfo) GetDescription() string {
if x != nil {
return x.xxx_hidden_Description
}
return ""
}
func (x *PluginInfo) GetAuthor() string {
if x != nil {
return x.xxx_hidden_Author
}
return ""
}
func (x *PluginInfo) SetType(v PluginInfo_PluginType) {
x.xxx_hidden_Type = v
}
func (x *PluginInfo) SetName(v string) {
x.xxx_hidden_Name = v
}
func (x *PluginInfo) SetVersion(v string) {
x.xxx_hidden_Version = v
}
func (x *PluginInfo) SetDescription(v string) {
x.xxx_hidden_Description = v
}
func (x *PluginInfo) SetAuthor(v string) {
x.xxx_hidden_Author = v
}
type PluginInfo_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Type of plugin.
Type PluginInfo_PluginType
// Name of the plugin.
Name string
// Version of the plugin
Version string
// Description of the plugin.
Description string
// Author of the plugin.
Author string
}
func (b0 PluginInfo_builder) Build() *PluginInfo {
m0 := &PluginInfo{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Type = b.Type
x.xxx_hidden_Name = b.Name
x.xxx_hidden_Version = b.Version
x.xxx_hidden_Description = b.Description
x.xxx_hidden_Author = b.Author
return m0
}
// Represents a ForServiceName annotation placeholder used by the
// PluginDefinition proto above.
type TargetServiceName struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Value []string `protobuf:"bytes,1,rep,name=value,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *TargetServiceName) Reset() {
*x = TargetServiceName{}
mi := &file_plugin_representation_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *TargetServiceName) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TargetServiceName) ProtoMessage() {}
func (x *TargetServiceName) ProtoReflect() protoreflect.Message {
mi := &file_plugin_representation_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *TargetServiceName) GetValue() []string {
if x != nil {
return x.xxx_hidden_Value
}
return nil
}
func (x *TargetServiceName) SetValue(v []string) {
x.xxx_hidden_Value = v
}
type TargetServiceName_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// The value of the name of the target.
Value []string
}
func (b0 TargetServiceName_builder) Build() *TargetServiceName {
m0 := &TargetServiceName{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Value = b.Value
return m0
}
// Represents a ForSoftware annotation placeholder used by the
// PluginDefinition proto above.
type TargetSoftware struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Name string `protobuf:"bytes,1,opt,name=name,proto3"`
xxx_hidden_Value []string `protobuf:"bytes,2,rep,name=value,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *TargetSoftware) Reset() {
*x = TargetSoftware{}
mi := &file_plugin_representation_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *TargetSoftware) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TargetSoftware) ProtoMessage() {}
func (x *TargetSoftware) ProtoReflect() protoreflect.Message {
mi := &file_plugin_representation_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *TargetSoftware) GetName() string {
if x != nil {
return x.xxx_hidden_Name
}
return ""
}
func (x *TargetSoftware) GetValue() []string {
if x != nil {
return x.xxx_hidden_Value
}
return nil
}
func (x *TargetSoftware) SetName(v string) {
x.xxx_hidden_Name = v
}
func (x *TargetSoftware) SetValue(v []string) {
x.xxx_hidden_Value = v
}
type TargetSoftware_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// The name of the target software, case insensitive.
Name string
// Array of versions and version ranges of the target software.
Value []string
}
func (b0 TargetSoftware_builder) Build() *TargetSoftware {
m0 := &TargetSoftware{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Name = b.Name
x.xxx_hidden_Value = b.Value
return m0
}
// Represents a ForOperatingSystem annotation placeholder used by the
// PluginDefinition proto above. These values are coming directly from the
// port scanner's output (e.g. nmap).
type TargetOperatingSystemClass struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Vendor []string `protobuf:"bytes,1,rep,name=vendor,proto3"`
xxx_hidden_OsFamily []string `protobuf:"bytes,2,rep,name=os_family,json=osFamily,proto3"`
xxx_hidden_MinAccuracy uint32 `protobuf:"varint,3,opt,name=min_accuracy,json=minAccuracy,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *TargetOperatingSystemClass) Reset() {
*x = TargetOperatingSystemClass{}
mi := &file_plugin_representation_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *TargetOperatingSystemClass) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TargetOperatingSystemClass) ProtoMessage() {}
func (x *TargetOperatingSystemClass) ProtoReflect() protoreflect.Message {
mi := &file_plugin_representation_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *TargetOperatingSystemClass) GetVendor() []string {
if x != nil {
return x.xxx_hidden_Vendor
}
return nil
}
func (x *TargetOperatingSystemClass) GetOsFamily() []string {
if x != nil {
return x.xxx_hidden_OsFamily
}
return nil
}
func (x *TargetOperatingSystemClass) GetMinAccuracy() uint32 {
if x != nil {
return x.xxx_hidden_MinAccuracy
}
return 0
}
func (x *TargetOperatingSystemClass) SetVendor(v []string) {
x.xxx_hidden_Vendor = v
}
func (x *TargetOperatingSystemClass) SetOsFamily(v []string) {
x.xxx_hidden_OsFamily = v
}
func (x *TargetOperatingSystemClass) SetMinAccuracy(v uint32) {
x.xxx_hidden_MinAccuracy = v
}
type TargetOperatingSystemClass_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// The vendor of the target operating system, e.g. "Microsoft"
Vendor []string
// The family of the target operating system, e.g. "Windows"
OsFamily []string
// The minimum accuracy of the target operating system, e.g. 90
MinAccuracy uint32
}
func (b0 TargetOperatingSystemClass_builder) Build() *TargetOperatingSystemClass {
m0 := &TargetOperatingSystemClass{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Vendor = b.Vendor
x.xxx_hidden_OsFamily = b.OsFamily
x.xxx_hidden_MinAccuracy = b.MinAccuracy
return m0
}
var File_plugin_representation_proto protoreflect.FileDescriptor
const file_plugin_representation_proto_rawDesc = "" +
"\n" +
"\x1bplugin_representation.proto\x12\rtsunami.proto\"\xf1\x02\n" +
"\x10PluginDefinition\x12-\n" +
"\x04info\x18\x01 \x01(\v2\x19.tsunami.proto.PluginInfoR\x04info\x12P\n" +
"\x13target_service_name\x18\x02 \x01(\v2 .tsunami.proto.TargetServiceNameR\x11targetServiceName\x12F\n" +
"\x0ftarget_software\x18\x03 \x01(\v2\x1d.tsunami.proto.TargetSoftwareR\x0etargetSoftware\x12&\n" +
"\x0ffor_web_service\x18\x04 \x01(\bR\rforWebService\x12l\n" +
"\x1dtarget_operating_system_class\x18\x05 \x01(\v2).tsunami.proto.TargetOperatingSystemClassR\x1atargetOperatingSystemClass\"\x95\x02\n" +
"\n" +
"PluginInfo\x128\n" +
"\x04type\x18\x01 \x01(\x0e2$.tsunami.proto.PluginInfo.PluginTypeR\x04type\x12\x12\n" +
"\x04name\x18\x02 \x01(\tR\x04name\x12\x18\n" +
"\aversion\x18\x03 \x01(\tR\aversion\x12 \n" +
"\vdescription\x18\x04 \x01(\tR\vdescription\x12\x16\n" +
"\x06author\x18\x05 \x01(\tR\x06author\"e\n" +
"\n" +
"PluginType\x12\x1b\n" +
"\x17PLUGIN_TYPE_UNSPECIFIED\x10\x00\x12\r\n" +
"\tPORT_SCAN\x10\x01\x12\x17\n" +
"\x13SERVICE_FINGERPRINT\x10\x02\x12\x12\n" +
"\x0eVULN_DETECTION\x10\x03\")\n" +
"\x11TargetServiceName\x12\x14\n" +
"\x05value\x18\x01 \x03(\tR\x05value\":\n" +
"\x0eTargetSoftware\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n" +
"\x05value\x18\x02 \x03(\tR\x05value\"t\n" +
"\x1aTargetOperatingSystemClass\x12\x16\n" +
"\x06vendor\x18\x01 \x03(\tR\x06vendor\x12\x1b\n" +
"\tos_family\x18\x02 \x03(\tR\bosFamily\x12!\n" +
"\fmin_accuracy\x18\x03 \x01(\rR\vminAccuracyB\x8c\x01\n" +
"\x18com.google.tsunami.protoB\x1aPluginRepresentationProtosP\x01ZRgithub.com/google/tsunami-security-scanner/proto/go/plugin_representation_go_protob\x06proto3"
var file_plugin_representation_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_plugin_representation_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_plugin_representation_proto_goTypes = []any{
(PluginInfo_PluginType)(0), // 0: tsunami.proto.PluginInfo.PluginType
(*PluginDefinition)(nil), // 1: tsunami.proto.PluginDefinition
(*PluginInfo)(nil), // 2: tsunami.proto.PluginInfo
(*TargetServiceName)(nil), // 3: tsunami.proto.TargetServiceName
(*TargetSoftware)(nil), // 4: tsunami.proto.TargetSoftware
(*TargetOperatingSystemClass)(nil), // 5: tsunami.proto.TargetOperatingSystemClass
}
var file_plugin_representation_proto_depIdxs = []int32{
2, // 0: tsunami.proto.PluginDefinition.info:type_name -> tsunami.proto.PluginInfo
3, // 1: tsunami.proto.PluginDefinition.target_service_name:type_name -> tsunami.proto.TargetServiceName
4, // 2: tsunami.proto.PluginDefinition.target_software:type_name -> tsunami.proto.TargetSoftware
5, // 3: tsunami.proto.PluginDefinition.target_operating_system_class:type_name -> tsunami.proto.TargetOperatingSystemClass
0, // 4: tsunami.proto.PluginInfo.type:type_name -> tsunami.proto.PluginInfo.PluginType
5, // [5:5] is the sub-list for method output_type
5, // [5:5] is the sub-list for method input_type
5, // [5:5] is the sub-list for extension type_name
5, // [5:5] is the sub-list for extension extendee
0, // [0:5] is the sub-list for field type_name
}
func init() { file_plugin_representation_proto_init() }
func file_plugin_representation_proto_init() {
if File_plugin_representation_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_plugin_representation_proto_rawDesc), len(file_plugin_representation_proto_rawDesc)),
NumEnums: 1,
NumMessages: 5,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_plugin_representation_proto_goTypes,
DependencyIndexes: file_plugin_representation_proto_depIdxs,
EnumInfos: file_plugin_representation_proto_enumTypes,
MessageInfos: file_plugin_representation_proto_msgTypes,
}.Build()
File_plugin_representation_proto = out.File
file_plugin_representation_proto_goTypes = nil
file_plugin_representation_proto_depIdxs = nil
}

View File

@ -1,702 +0,0 @@
//
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Model for the plugin RPC service protocol.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.10
// protoc v3.21.12
// source: plugin_service.proto
package plugin_service_go_proto
import (
detection_go_proto "github.com/google/tsunami-security-scanner/proto/go/detection_go_proto"
network_service_go_proto "github.com/google/tsunami-security-scanner/proto/go/network_service_go_proto"
plugin_representation_go_proto "github.com/google/tsunami-security-scanner/proto/go/plugin_representation_go_proto"
reconnaissance_go_proto "github.com/google/tsunami-security-scanner/proto/go/reconnaissance_go_proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Represents a run request with all matched plugins that will need to run
// as well as the target to run against.
type RunRequest struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Target *reconnaissance_go_proto.TargetInfo `protobuf:"bytes,1,opt,name=target,proto3"`
xxx_hidden_Plugins *[]*MatchedPlugin `protobuf:"bytes,2,rep,name=plugins,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RunRequest) Reset() {
*x = RunRequest{}
mi := &file_plugin_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RunRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RunRequest) ProtoMessage() {}
func (x *RunRequest) ProtoReflect() protoreflect.Message {
mi := &file_plugin_service_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *RunRequest) GetTarget() *reconnaissance_go_proto.TargetInfo {
if x != nil {
return x.xxx_hidden_Target
}
return nil
}
func (x *RunRequest) GetPlugins() []*MatchedPlugin {
if x != nil {
if x.xxx_hidden_Plugins != nil {
return *x.xxx_hidden_Plugins
}
}
return nil
}
func (x *RunRequest) SetTarget(v *reconnaissance_go_proto.TargetInfo) {
x.xxx_hidden_Target = v
}
func (x *RunRequest) SetPlugins(v []*MatchedPlugin) {
x.xxx_hidden_Plugins = &v
}
func (x *RunRequest) HasTarget() bool {
if x == nil {
return false
}
return x.xxx_hidden_Target != nil
}
func (x *RunRequest) ClearTarget() {
x.xxx_hidden_Target = nil
}
type RunRequest_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Target of the plugins.
Target *reconnaissance_go_proto.TargetInfo
// All matched plugins that will need to run.
Plugins []*MatchedPlugin
}
func (b0 RunRequest_builder) Build() *RunRequest {
m0 := &RunRequest{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Target = b.Target
x.xxx_hidden_Plugins = &b.Plugins
return m0
}
// Compact representation of RunRequest.
type RunCompactRequest struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Target *reconnaissance_go_proto.TargetInfo `protobuf:"bytes,1,opt,name=target,proto3"`
xxx_hidden_Services *[]*network_service_go_proto.NetworkService `protobuf:"bytes,2,rep,name=services,proto3"`
xxx_hidden_Plugins *[]*plugin_representation_go_proto.PluginDefinition `protobuf:"bytes,3,rep,name=plugins,proto3"`
xxx_hidden_ScanTargets *[]*RunCompactRequest_PluginNetworkServiceTarget `protobuf:"bytes,4,rep,name=scan_targets,json=scanTargets,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RunCompactRequest) Reset() {
*x = RunCompactRequest{}
mi := &file_plugin_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RunCompactRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RunCompactRequest) ProtoMessage() {}
func (x *RunCompactRequest) ProtoReflect() protoreflect.Message {
mi := &file_plugin_service_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *RunCompactRequest) GetTarget() *reconnaissance_go_proto.TargetInfo {
if x != nil {
return x.xxx_hidden_Target
}
return nil
}
func (x *RunCompactRequest) GetServices() []*network_service_go_proto.NetworkService {
if x != nil {
if x.xxx_hidden_Services != nil {
return *x.xxx_hidden_Services
}
}
return nil
}
func (x *RunCompactRequest) GetPlugins() []*plugin_representation_go_proto.PluginDefinition {
if x != nil {
if x.xxx_hidden_Plugins != nil {
return *x.xxx_hidden_Plugins
}
}
return nil
}
func (x *RunCompactRequest) GetScanTargets() []*RunCompactRequest_PluginNetworkServiceTarget {
if x != nil {
if x.xxx_hidden_ScanTargets != nil {
return *x.xxx_hidden_ScanTargets
}
}
return nil
}
func (x *RunCompactRequest) SetTarget(v *reconnaissance_go_proto.TargetInfo) {
x.xxx_hidden_Target = v
}
func (x *RunCompactRequest) SetServices(v []*network_service_go_proto.NetworkService) {
x.xxx_hidden_Services = &v
}
func (x *RunCompactRequest) SetPlugins(v []*plugin_representation_go_proto.PluginDefinition) {
x.xxx_hidden_Plugins = &v
}
func (x *RunCompactRequest) SetScanTargets(v []*RunCompactRequest_PluginNetworkServiceTarget) {
x.xxx_hidden_ScanTargets = &v
}
func (x *RunCompactRequest) HasTarget() bool {
if x == nil {
return false
}
return x.xxx_hidden_Target != nil
}
func (x *RunCompactRequest) ClearTarget() {
x.xxx_hidden_Target = nil
}
type RunCompactRequest_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Target of the plugins.
Target *reconnaissance_go_proto.TargetInfo
// All network services that are targeted by some of the plugins.
Services []*network_service_go_proto.NetworkService
// All plugins that should be executed during the run.
Plugins []*plugin_representation_go_proto.PluginDefinition
// The concrete map of plugin/network service pairs that should be scanned.
ScanTargets []*RunCompactRequest_PluginNetworkServiceTarget
}
func (b0 RunCompactRequest_builder) Build() *RunCompactRequest {
m0 := &RunCompactRequest{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Target = b.Target
x.xxx_hidden_Services = &b.Services
x.xxx_hidden_Plugins = &b.Plugins
x.xxx_hidden_ScanTargets = &b.ScanTargets
return m0
}
// Represents the plugin needed to run by the language-specific server
// as well as all the matched network services for the plugin.
type MatchedPlugin struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Services *[]*network_service_go_proto.NetworkService `protobuf:"bytes,1,rep,name=services,proto3"`
xxx_hidden_Plugin *plugin_representation_go_proto.PluginDefinition `protobuf:"bytes,2,opt,name=plugin,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *MatchedPlugin) Reset() {
*x = MatchedPlugin{}
mi := &file_plugin_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *MatchedPlugin) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*MatchedPlugin) ProtoMessage() {}
func (x *MatchedPlugin) ProtoReflect() protoreflect.Message {
mi := &file_plugin_service_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *MatchedPlugin) GetServices() []*network_service_go_proto.NetworkService {
if x != nil {
if x.xxx_hidden_Services != nil {
return *x.xxx_hidden_Services
}
}
return nil
}
func (x *MatchedPlugin) GetPlugin() *plugin_representation_go_proto.PluginDefinition {
if x != nil {
return x.xxx_hidden_Plugin
}
return nil
}
func (x *MatchedPlugin) SetServices(v []*network_service_go_proto.NetworkService) {
x.xxx_hidden_Services = &v
}
func (x *MatchedPlugin) SetPlugin(v *plugin_representation_go_proto.PluginDefinition) {
x.xxx_hidden_Plugin = v
}
func (x *MatchedPlugin) HasPlugin() bool {
if x == nil {
return false
}
return x.xxx_hidden_Plugin != nil
}
func (x *MatchedPlugin) ClearPlugin() {
x.xxx_hidden_Plugin = nil
}
type MatchedPlugin_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// All matched network services from the reconnaissance report.
Services []*network_service_go_proto.NetworkService
// Plugin to run.
Plugin *plugin_representation_go_proto.PluginDefinition
}
func (b0 MatchedPlugin_builder) Build() *MatchedPlugin {
m0 := &MatchedPlugin{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Services = &b.Services
x.xxx_hidden_Plugin = b.Plugin
return m0
}
// Represents a run response with the only field being all DetectionReports
// generated by the language-specific server.
type RunResponse struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Reports *detection_go_proto.DetectionReportList `protobuf:"bytes,1,opt,name=reports,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RunResponse) Reset() {
*x = RunResponse{}
mi := &file_plugin_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RunResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RunResponse) ProtoMessage() {}
func (x *RunResponse) ProtoReflect() protoreflect.Message {
mi := &file_plugin_service_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *RunResponse) GetReports() *detection_go_proto.DetectionReportList {
if x != nil {
return x.xxx_hidden_Reports
}
return nil
}
func (x *RunResponse) SetReports(v *detection_go_proto.DetectionReportList) {
x.xxx_hidden_Reports = v
}
func (x *RunResponse) HasReports() bool {
if x == nil {
return false
}
return x.xxx_hidden_Reports != nil
}
func (x *RunResponse) ClearReports() {
x.xxx_hidden_Reports = nil
}
type RunResponse_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
Reports *detection_go_proto.DetectionReportList
}
func (b0 RunResponse_builder) Build() *RunResponse {
m0 := &RunResponse{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Reports = b.Reports
return m0
}
// Represents a request to list all plugins from the requested server.
type ListPluginsRequest struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListPluginsRequest) Reset() {
*x = ListPluginsRequest{}
mi := &file_plugin_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListPluginsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListPluginsRequest) ProtoMessage() {}
func (x *ListPluginsRequest) ProtoReflect() protoreflect.Message {
mi := &file_plugin_service_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
type ListPluginsRequest_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
}
func (b0 ListPluginsRequest_builder) Build() *ListPluginsRequest {
m0 := &ListPluginsRequest{}
b, x := &b0, m0
_, _ = b, x
return m0
}
// Represents a response containing a list of all plugins
// from the requested server.
type ListPluginsResponse struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Plugins *[]*plugin_representation_go_proto.PluginDefinition `protobuf:"bytes,1,rep,name=plugins,proto3"`
xxx_hidden_WantCompactRunRequest bool `protobuf:"varint,2,opt,name=want_compact_run_request,json=wantCompactRunRequest,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ListPluginsResponse) Reset() {
*x = ListPluginsResponse{}
mi := &file_plugin_service_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ListPluginsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListPluginsResponse) ProtoMessage() {}
func (x *ListPluginsResponse) ProtoReflect() protoreflect.Message {
mi := &file_plugin_service_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *ListPluginsResponse) GetPlugins() []*plugin_representation_go_proto.PluginDefinition {
if x != nil {
if x.xxx_hidden_Plugins != nil {
return *x.xxx_hidden_Plugins
}
}
return nil
}
func (x *ListPluginsResponse) GetWantCompactRunRequest() bool {
if x != nil {
return x.xxx_hidden_WantCompactRunRequest
}
return false
}
func (x *ListPluginsResponse) SetPlugins(v []*plugin_representation_go_proto.PluginDefinition) {
x.xxx_hidden_Plugins = &v
}
func (x *ListPluginsResponse) SetWantCompactRunRequest(v bool) {
x.xxx_hidden_WantCompactRunRequest = v
}
type ListPluginsResponse_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
Plugins []*plugin_representation_go_proto.PluginDefinition
// Plugin service can indicate here that it RunRequest should be compact
// (compact_targets should be populated instead of MatchedPlugin plugins).
WantCompactRunRequest bool
}
func (b0 ListPluginsResponse_builder) Build() *ListPluginsResponse {
m0 := &ListPluginsResponse{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Plugins = &b.Plugins
x.xxx_hidden_WantCompactRunRequest = b.WantCompactRunRequest
return m0
}
// Indexes in the following structure point to the services/plugins defined
// below. (The order is safe, guaranteed by the proto specification: "The
// order of the elements with respect to each other is preserved when parsing,
// though the ordering with respect to other fields is lost.")
type RunCompactRequest_PluginNetworkServiceTarget struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_PluginIndex uint32 `protobuf:"varint,1,opt,name=plugin_index,json=pluginIndex,proto3"`
xxx_hidden_ServiceIndex uint32 `protobuf:"varint,2,opt,name=service_index,json=serviceIndex,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *RunCompactRequest_PluginNetworkServiceTarget) Reset() {
*x = RunCompactRequest_PluginNetworkServiceTarget{}
mi := &file_plugin_service_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *RunCompactRequest_PluginNetworkServiceTarget) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RunCompactRequest_PluginNetworkServiceTarget) ProtoMessage() {}
func (x *RunCompactRequest_PluginNetworkServiceTarget) ProtoReflect() protoreflect.Message {
mi := &file_plugin_service_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *RunCompactRequest_PluginNetworkServiceTarget) GetPluginIndex() uint32 {
if x != nil {
return x.xxx_hidden_PluginIndex
}
return 0
}
func (x *RunCompactRequest_PluginNetworkServiceTarget) GetServiceIndex() uint32 {
if x != nil {
return x.xxx_hidden_ServiceIndex
}
return 0
}
func (x *RunCompactRequest_PluginNetworkServiceTarget) SetPluginIndex(v uint32) {
x.xxx_hidden_PluginIndex = v
}
func (x *RunCompactRequest_PluginNetworkServiceTarget) SetServiceIndex(v uint32) {
x.xxx_hidden_ServiceIndex = v
}
type RunCompactRequest_PluginNetworkServiceTarget_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// The index of the plugin to run.
PluginIndex uint32
// The index of the network service to run against.
ServiceIndex uint32
}
func (b0 RunCompactRequest_PluginNetworkServiceTarget_builder) Build() *RunCompactRequest_PluginNetworkServiceTarget {
m0 := &RunCompactRequest_PluginNetworkServiceTarget{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_PluginIndex = b.PluginIndex
x.xxx_hidden_ServiceIndex = b.ServiceIndex
return m0
}
var File_plugin_service_proto protoreflect.FileDescriptor
const file_plugin_service_proto_rawDesc = "" +
"\n" +
"\x14plugin_service.proto\x12\rtsunami.proto\x1a\x0fdetection.proto\x1a\x15network_service.proto\x1a\x1bplugin_representation.proto\x1a\x14reconnaissance.proto\"w\n" +
"\n" +
"RunRequest\x121\n" +
"\x06target\x18\x01 \x01(\v2\x19.tsunami.proto.TargetInfoR\x06target\x126\n" +
"\aplugins\x18\x02 \x03(\v2\x1c.tsunami.proto.MatchedPluginR\aplugins\"\x82\x03\n" +
"\x11RunCompactRequest\x121\n" +
"\x06target\x18\x01 \x01(\v2\x19.tsunami.proto.TargetInfoR\x06target\x129\n" +
"\bservices\x18\x02 \x03(\v2\x1d.tsunami.proto.NetworkServiceR\bservices\x129\n" +
"\aplugins\x18\x03 \x03(\v2\x1f.tsunami.proto.PluginDefinitionR\aplugins\x12^\n" +
"\fscan_targets\x18\x04 \x03(\v2;.tsunami.proto.RunCompactRequest.PluginNetworkServiceTargetR\vscanTargets\x1ad\n" +
"\x1aPluginNetworkServiceTarget\x12!\n" +
"\fplugin_index\x18\x01 \x01(\rR\vpluginIndex\x12#\n" +
"\rservice_index\x18\x02 \x01(\rR\fserviceIndex\"\x83\x01\n" +
"\rMatchedPlugin\x129\n" +
"\bservices\x18\x01 \x03(\v2\x1d.tsunami.proto.NetworkServiceR\bservices\x127\n" +
"\x06plugin\x18\x02 \x01(\v2\x1f.tsunami.proto.PluginDefinitionR\x06plugin\"K\n" +
"\vRunResponse\x12<\n" +
"\areports\x18\x01 \x01(\v2\".tsunami.proto.DetectionReportListR\areports\"\x14\n" +
"\x12ListPluginsRequest\"\x89\x01\n" +
"\x13ListPluginsResponse\x129\n" +
"\aplugins\x18\x01 \x03(\v2\x1f.tsunami.proto.PluginDefinitionR\aplugins\x127\n" +
"\x18want_compact_run_request\x18\x02 \x01(\bR\x15wantCompactRunRequest2\xf5\x01\n" +
"\rPluginService\x12>\n" +
"\x03Run\x12\x19.tsunami.proto.RunRequest\x1a\x1a.tsunami.proto.RunResponse\"\x00\x12L\n" +
"\n" +
"RunCompact\x12 .tsunami.proto.RunCompactRequest\x1a\x1a.tsunami.proto.RunResponse\"\x00\x12V\n" +
"\vListPlugins\x12!.tsunami.proto.ListPluginsRequest\x1a\".tsunami.proto.ListPluginsResponse\"\x00B~\n" +
"\x18com.google.tsunami.protoB\x13PluginServiceProtosP\x01ZKgithub.com/google/tsunami-security-scanner/proto/go/plugin_service_go_protob\x06proto3"
var file_plugin_service_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_plugin_service_proto_goTypes = []any{
(*RunRequest)(nil), // 0: tsunami.proto.RunRequest
(*RunCompactRequest)(nil), // 1: tsunami.proto.RunCompactRequest
(*MatchedPlugin)(nil), // 2: tsunami.proto.MatchedPlugin
(*RunResponse)(nil), // 3: tsunami.proto.RunResponse
(*ListPluginsRequest)(nil), // 4: tsunami.proto.ListPluginsRequest
(*ListPluginsResponse)(nil), // 5: tsunami.proto.ListPluginsResponse
(*RunCompactRequest_PluginNetworkServiceTarget)(nil), // 6: tsunami.proto.RunCompactRequest.PluginNetworkServiceTarget
(*reconnaissance_go_proto.TargetInfo)(nil), // 7: tsunami.proto.TargetInfo
(*network_service_go_proto.NetworkService)(nil), // 8: tsunami.proto.NetworkService
(*plugin_representation_go_proto.PluginDefinition)(nil), // 9: tsunami.proto.PluginDefinition
(*detection_go_proto.DetectionReportList)(nil), // 10: tsunami.proto.DetectionReportList
}
var file_plugin_service_proto_depIdxs = []int32{
7, // 0: tsunami.proto.RunRequest.target:type_name -> tsunami.proto.TargetInfo
2, // 1: tsunami.proto.RunRequest.plugins:type_name -> tsunami.proto.MatchedPlugin
7, // 2: tsunami.proto.RunCompactRequest.target:type_name -> tsunami.proto.TargetInfo
8, // 3: tsunami.proto.RunCompactRequest.services:type_name -> tsunami.proto.NetworkService
9, // 4: tsunami.proto.RunCompactRequest.plugins:type_name -> tsunami.proto.PluginDefinition
6, // 5: tsunami.proto.RunCompactRequest.scan_targets:type_name -> tsunami.proto.RunCompactRequest.PluginNetworkServiceTarget
8, // 6: tsunami.proto.MatchedPlugin.services:type_name -> tsunami.proto.NetworkService
9, // 7: tsunami.proto.MatchedPlugin.plugin:type_name -> tsunami.proto.PluginDefinition
10, // 8: tsunami.proto.RunResponse.reports:type_name -> tsunami.proto.DetectionReportList
9, // 9: tsunami.proto.ListPluginsResponse.plugins:type_name -> tsunami.proto.PluginDefinition
0, // 10: tsunami.proto.PluginService.Run:input_type -> tsunami.proto.RunRequest
1, // 11: tsunami.proto.PluginService.RunCompact:input_type -> tsunami.proto.RunCompactRequest
4, // 12: tsunami.proto.PluginService.ListPlugins:input_type -> tsunami.proto.ListPluginsRequest
3, // 13: tsunami.proto.PluginService.Run:output_type -> tsunami.proto.RunResponse
3, // 14: tsunami.proto.PluginService.RunCompact:output_type -> tsunami.proto.RunResponse
5, // 15: tsunami.proto.PluginService.ListPlugins:output_type -> tsunami.proto.ListPluginsResponse
13, // [13:16] is the sub-list for method output_type
10, // [10:13] is the sub-list for method input_type
10, // [10:10] is the sub-list for extension type_name
10, // [10:10] is the sub-list for extension extendee
0, // [0:10] is the sub-list for field type_name
}
func init() { file_plugin_service_proto_init() }
func file_plugin_service_proto_init() {
if File_plugin_service_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_plugin_service_proto_rawDesc), len(file_plugin_service_proto_rawDesc)),
NumEnums: 0,
NumMessages: 7,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_plugin_service_proto_goTypes,
DependencyIndexes: file_plugin_service_proto_depIdxs,
MessageInfos: file_plugin_service_proto_msgTypes,
}.Build()
File_plugin_service_proto = out.File
file_plugin_service_proto_goTypes = nil
file_plugin_service_proto_depIdxs = nil
}

View File

@ -1,550 +0,0 @@
//
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Data models for all the reconnaissance information gathered by Tsunami.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.10
// protoc v3.21.12
// source: reconnaissance.proto
package reconnaissance_go_proto
import (
network_go_proto "github.com/google/tsunami-security-scanner/proto/go/network_go_proto"
network_service_go_proto "github.com/google/tsunami-security-scanner/proto/go/network_service_go_proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Detailed information about the scanning target.
type TargetInfo struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_NetworkEndpoints *[]*network_go_proto.NetworkEndpoint `protobuf:"bytes,1,rep,name=network_endpoints,json=networkEndpoints,proto3"`
xxx_hidden_OperatingSystemClasses *[]*OperatingSystemClass `protobuf:"bytes,2,rep,name=operating_system_classes,json=operatingSystemClasses,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *TargetInfo) Reset() {
*x = TargetInfo{}
mi := &file_reconnaissance_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *TargetInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TargetInfo) ProtoMessage() {}
func (x *TargetInfo) ProtoReflect() protoreflect.Message {
mi := &file_reconnaissance_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *TargetInfo) GetNetworkEndpoints() []*network_go_proto.NetworkEndpoint {
if x != nil {
if x.xxx_hidden_NetworkEndpoints != nil {
return *x.xxx_hidden_NetworkEndpoints
}
}
return nil
}
func (x *TargetInfo) GetOperatingSystemClasses() []*OperatingSystemClass {
if x != nil {
if x.xxx_hidden_OperatingSystemClasses != nil {
return *x.xxx_hidden_OperatingSystemClasses
}
}
return nil
}
func (x *TargetInfo) SetNetworkEndpoints(v []*network_go_proto.NetworkEndpoint) {
x.xxx_hidden_NetworkEndpoints = &v
}
func (x *TargetInfo) SetOperatingSystemClasses(v []*OperatingSystemClass) {
x.xxx_hidden_OperatingSystemClasses = &v
}
type TargetInfo_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// All the known network endpoints of the scanning target.
NetworkEndpoints []*network_go_proto.NetworkEndpoint
OperatingSystemClasses []*OperatingSystemClass
}
func (b0 TargetInfo_builder) Build() *TargetInfo {
m0 := &TargetInfo{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_NetworkEndpoints = &b.NetworkEndpoints
x.xxx_hidden_OperatingSystemClasses = &b.OperatingSystemClasses
return m0
}
// Represents a ForOperatingSystem annotation placeholder used by the
// PluginDefinition proto above.
// For possible values, consult the following database:
// https://raw.githubusercontent.com/nmap/nmap/master/nmap-os-db
type OperatingSystemClass struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Type string `protobuf:"bytes,1,opt,name=type,proto3"`
xxx_hidden_Vendor string `protobuf:"bytes,2,opt,name=vendor,proto3"`
xxx_hidden_OsFamily string `protobuf:"bytes,3,opt,name=os_family,json=osFamily,proto3"`
xxx_hidden_OsGeneration string `protobuf:"bytes,4,opt,name=os_generation,json=osGeneration,proto3"`
xxx_hidden_Accuracy uint32 `protobuf:"varint,5,opt,name=accuracy,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *OperatingSystemClass) Reset() {
*x = OperatingSystemClass{}
mi := &file_reconnaissance_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *OperatingSystemClass) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*OperatingSystemClass) ProtoMessage() {}
func (x *OperatingSystemClass) ProtoReflect() protoreflect.Message {
mi := &file_reconnaissance_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *OperatingSystemClass) GetType() string {
if x != nil {
return x.xxx_hidden_Type
}
return ""
}
func (x *OperatingSystemClass) GetVendor() string {
if x != nil {
return x.xxx_hidden_Vendor
}
return ""
}
func (x *OperatingSystemClass) GetOsFamily() string {
if x != nil {
return x.xxx_hidden_OsFamily
}
return ""
}
func (x *OperatingSystemClass) GetOsGeneration() string {
if x != nil {
return x.xxx_hidden_OsGeneration
}
return ""
}
func (x *OperatingSystemClass) GetAccuracy() uint32 {
if x != nil {
return x.xxx_hidden_Accuracy
}
return 0
}
func (x *OperatingSystemClass) SetType(v string) {
x.xxx_hidden_Type = v
}
func (x *OperatingSystemClass) SetVendor(v string) {
x.xxx_hidden_Vendor = v
}
func (x *OperatingSystemClass) SetOsFamily(v string) {
x.xxx_hidden_OsFamily = v
}
func (x *OperatingSystemClass) SetOsGeneration(v string) {
x.xxx_hidden_OsGeneration = v
}
func (x *OperatingSystemClass) SetAccuracy(v uint32) {
x.xxx_hidden_Accuracy = v
}
type OperatingSystemClass_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// The type of the target operating system, e.g. "general purpose"
Type string
// The vendor of the target operating system, e.g. "Linux"
Vendor string
// The family of the target operating system, e.g. "Linux"
OsFamily string
// The generation of the target operating system, e.g. "2.6.X"
OsGeneration string
// The estimated accuracy of the target operating system, e.g. 90
Accuracy uint32
}
func (b0 OperatingSystemClass_builder) Build() *OperatingSystemClass {
m0 := &OperatingSystemClass{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Type = b.Type
x.xxx_hidden_Vendor = b.Vendor
x.xxx_hidden_OsFamily = b.OsFamily
x.xxx_hidden_OsGeneration = b.OsGeneration
x.xxx_hidden_Accuracy = b.Accuracy
return m0
}
// Report from a port scanner.
type PortScanningReport struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_TargetInfo *TargetInfo `protobuf:"bytes,1,opt,name=target_info,json=targetInfo,proto3"`
xxx_hidden_NetworkServices *[]*network_service_go_proto.NetworkService `protobuf:"bytes,2,rep,name=network_services,json=networkServices,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PortScanningReport) Reset() {
*x = PortScanningReport{}
mi := &file_reconnaissance_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PortScanningReport) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PortScanningReport) ProtoMessage() {}
func (x *PortScanningReport) ProtoReflect() protoreflect.Message {
mi := &file_reconnaissance_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *PortScanningReport) GetTargetInfo() *TargetInfo {
if x != nil {
return x.xxx_hidden_TargetInfo
}
return nil
}
func (x *PortScanningReport) GetNetworkServices() []*network_service_go_proto.NetworkService {
if x != nil {
if x.xxx_hidden_NetworkServices != nil {
return *x.xxx_hidden_NetworkServices
}
}
return nil
}
func (x *PortScanningReport) SetTargetInfo(v *TargetInfo) {
x.xxx_hidden_TargetInfo = v
}
func (x *PortScanningReport) SetNetworkServices(v []*network_service_go_proto.NetworkService) {
x.xxx_hidden_NetworkServices = &v
}
func (x *PortScanningReport) HasTargetInfo() bool {
if x == nil {
return false
}
return x.xxx_hidden_TargetInfo != nil
}
func (x *PortScanningReport) ClearTargetInfo() {
x.xxx_hidden_TargetInfo = nil
}
type PortScanningReport_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Information about the scanning target.
TargetInfo *TargetInfo
// List of all the exposed network services.
NetworkServices []*network_service_go_proto.NetworkService
}
func (b0 PortScanningReport_builder) Build() *PortScanningReport {
m0 := &PortScanningReport{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_TargetInfo = b.TargetInfo
x.xxx_hidden_NetworkServices = &b.NetworkServices
return m0
}
// Report from a service fingerprinter.
type FingerprintingReport struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_NetworkServices *[]*network_service_go_proto.NetworkService `protobuf:"bytes,3,rep,name=network_services,json=networkServices,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *FingerprintingReport) Reset() {
*x = FingerprintingReport{}
mi := &file_reconnaissance_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *FingerprintingReport) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FingerprintingReport) ProtoMessage() {}
func (x *FingerprintingReport) ProtoReflect() protoreflect.Message {
mi := &file_reconnaissance_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *FingerprintingReport) GetNetworkServices() []*network_service_go_proto.NetworkService {
if x != nil {
if x.xxx_hidden_NetworkServices != nil {
return *x.xxx_hidden_NetworkServices
}
}
return nil
}
func (x *FingerprintingReport) SetNetworkServices(v []*network_service_go_proto.NetworkService) {
x.xxx_hidden_NetworkServices = &v
}
type FingerprintingReport_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// List of all the identified network services after fingerprinting.
NetworkServices []*network_service_go_proto.NetworkService
}
func (b0 FingerprintingReport_builder) Build() *FingerprintingReport {
m0 := &FingerprintingReport{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_NetworkServices = &b.NetworkServices
return m0
}
// Full reconnaissance report about a single scanning target.
type ReconnaissanceReport struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_TargetInfo *TargetInfo `protobuf:"bytes,1,opt,name=target_info,json=targetInfo,proto3"`
xxx_hidden_NetworkServices *[]*network_service_go_proto.NetworkService `protobuf:"bytes,2,rep,name=network_services,json=networkServices,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ReconnaissanceReport) Reset() {
*x = ReconnaissanceReport{}
mi := &file_reconnaissance_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ReconnaissanceReport) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ReconnaissanceReport) ProtoMessage() {}
func (x *ReconnaissanceReport) ProtoReflect() protoreflect.Message {
mi := &file_reconnaissance_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *ReconnaissanceReport) GetTargetInfo() *TargetInfo {
if x != nil {
return x.xxx_hidden_TargetInfo
}
return nil
}
func (x *ReconnaissanceReport) GetNetworkServices() []*network_service_go_proto.NetworkService {
if x != nil {
if x.xxx_hidden_NetworkServices != nil {
return *x.xxx_hidden_NetworkServices
}
}
return nil
}
func (x *ReconnaissanceReport) SetTargetInfo(v *TargetInfo) {
x.xxx_hidden_TargetInfo = v
}
func (x *ReconnaissanceReport) SetNetworkServices(v []*network_service_go_proto.NetworkService) {
x.xxx_hidden_NetworkServices = &v
}
func (x *ReconnaissanceReport) HasTargetInfo() bool {
if x == nil {
return false
}
return x.xxx_hidden_TargetInfo != nil
}
func (x *ReconnaissanceReport) ClearTargetInfo() {
x.xxx_hidden_TargetInfo = nil
}
type ReconnaissanceReport_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Information about the scanning target.
TargetInfo *TargetInfo
// All exposed network services of the scanning target.
NetworkServices []*network_service_go_proto.NetworkService
}
func (b0 ReconnaissanceReport_builder) Build() *ReconnaissanceReport {
m0 := &ReconnaissanceReport{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_TargetInfo = b.TargetInfo
x.xxx_hidden_NetworkServices = &b.NetworkServices
return m0
}
var File_reconnaissance_proto protoreflect.FileDescriptor
const file_reconnaissance_proto_rawDesc = "" +
"\n" +
"\x14reconnaissance.proto\x12\rtsunami.proto\x1a\rnetwork.proto\x1a\x15network_service.proto\"\xb8\x01\n" +
"\n" +
"TargetInfo\x12K\n" +
"\x11network_endpoints\x18\x01 \x03(\v2\x1e.tsunami.proto.NetworkEndpointR\x10networkEndpoints\x12]\n" +
"\x18operating_system_classes\x18\x02 \x03(\v2#.tsunami.proto.OperatingSystemClassR\x16operatingSystemClasses\"\xa0\x01\n" +
"\x14OperatingSystemClass\x12\x12\n" +
"\x04type\x18\x01 \x01(\tR\x04type\x12\x16\n" +
"\x06vendor\x18\x02 \x01(\tR\x06vendor\x12\x1b\n" +
"\tos_family\x18\x03 \x01(\tR\bosFamily\x12#\n" +
"\ros_generation\x18\x04 \x01(\tR\fosGeneration\x12\x1a\n" +
"\baccuracy\x18\x05 \x01(\rR\baccuracy\"\x9a\x01\n" +
"\x12PortScanningReport\x12:\n" +
"\vtarget_info\x18\x01 \x01(\v2\x19.tsunami.proto.TargetInfoR\n" +
"targetInfo\x12H\n" +
"\x10network_services\x18\x02 \x03(\v2\x1d.tsunami.proto.NetworkServiceR\x0fnetworkServices\"`\n" +
"\x14FingerprintingReport\x12H\n" +
"\x10network_services\x18\x03 \x03(\v2\x1d.tsunami.proto.NetworkServiceR\x0fnetworkServices\"\x9c\x01\n" +
"\x14ReconnaissanceReport\x12:\n" +
"\vtarget_info\x18\x01 \x01(\v2\x19.tsunami.proto.TargetInfoR\n" +
"targetInfo\x12H\n" +
"\x10network_services\x18\x02 \x03(\v2\x1d.tsunami.proto.NetworkServiceR\x0fnetworkServicesB\x7f\n" +
"\x18com.google.tsunami.protoB\x14ReconnaissanceProtosP\x01ZKgithub.com/google/tsunami-security-scanner/proto/go/reconnaissance_go_protob\x06proto3"
var file_reconnaissance_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_reconnaissance_proto_goTypes = []any{
(*TargetInfo)(nil), // 0: tsunami.proto.TargetInfo
(*OperatingSystemClass)(nil), // 1: tsunami.proto.OperatingSystemClass
(*PortScanningReport)(nil), // 2: tsunami.proto.PortScanningReport
(*FingerprintingReport)(nil), // 3: tsunami.proto.FingerprintingReport
(*ReconnaissanceReport)(nil), // 4: tsunami.proto.ReconnaissanceReport
(*network_go_proto.NetworkEndpoint)(nil), // 5: tsunami.proto.NetworkEndpoint
(*network_service_go_proto.NetworkService)(nil), // 6: tsunami.proto.NetworkService
}
var file_reconnaissance_proto_depIdxs = []int32{
5, // 0: tsunami.proto.TargetInfo.network_endpoints:type_name -> tsunami.proto.NetworkEndpoint
1, // 1: tsunami.proto.TargetInfo.operating_system_classes:type_name -> tsunami.proto.OperatingSystemClass
0, // 2: tsunami.proto.PortScanningReport.target_info:type_name -> tsunami.proto.TargetInfo
6, // 3: tsunami.proto.PortScanningReport.network_services:type_name -> tsunami.proto.NetworkService
6, // 4: tsunami.proto.FingerprintingReport.network_services:type_name -> tsunami.proto.NetworkService
0, // 5: tsunami.proto.ReconnaissanceReport.target_info:type_name -> tsunami.proto.TargetInfo
6, // 6: tsunami.proto.ReconnaissanceReport.network_services:type_name -> tsunami.proto.NetworkService
7, // [7:7] is the sub-list for method output_type
7, // [7:7] is the sub-list for method input_type
7, // [7:7] is the sub-list for extension type_name
7, // [7:7] is the sub-list for extension extendee
0, // [0:7] is the sub-list for field type_name
}
func init() { file_reconnaissance_proto_init() }
func file_reconnaissance_proto_init() {
if File_reconnaissance_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_reconnaissance_proto_rawDesc), len(file_reconnaissance_proto_rawDesc)),
NumEnums: 0,
NumMessages: 5,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_reconnaissance_proto_goTypes,
DependencyIndexes: file_reconnaissance_proto_depIdxs,
MessageInfos: file_reconnaissance_proto_msgTypes,
}.Build()
File_reconnaissance_proto = out.File
file_reconnaissance_proto_goTypes = nil
file_reconnaissance_proto_depIdxs = nil
}

View File

@ -1,586 +0,0 @@
//
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Data models for describing scanning results.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.10
// protoc v3.21.12
// source: scan_results.proto
package scan_results_go_proto
import (
detection_go_proto "github.com/google/tsunami-security-scanner/proto/go/detection_go_proto"
network_service_go_proto "github.com/google/tsunami-security-scanner/proto/go/network_service_go_proto"
reconnaissance_go_proto "github.com/google/tsunami-security-scanner/proto/go/reconnaissance_go_proto"
vulnerability_go_proto "github.com/google/tsunami-security-scanner/proto/go/vulnerability_go_proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
durationpb "google.golang.org/protobuf/types/known/durationpb"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
reflect "reflect"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Execution status of the scan.
// NEXT ID: 5
type ScanStatus int32
const (
// Unspecified status.
ScanStatus_SCAN_STATUS_UNSPECIFIED ScanStatus = 0
// Scan finished successfully.
ScanStatus_SUCCEEDED ScanStatus = 1
// Scan finished with only a small set of selected detectors succeeded.
ScanStatus_PARTIALLY_SUCCEEDED ScanStatus = 4
// Scan failed.
ScanStatus_FAILED ScanStatus = 2
// Scan cancelled.
ScanStatus_CANCELLED ScanStatus = 3
)
// Enum value maps for ScanStatus.
var (
ScanStatus_name = map[int32]string{
0: "SCAN_STATUS_UNSPECIFIED",
1: "SUCCEEDED",
4: "PARTIALLY_SUCCEEDED",
2: "FAILED",
3: "CANCELLED",
}
ScanStatus_value = map[string]int32{
"SCAN_STATUS_UNSPECIFIED": 0,
"SUCCEEDED": 1,
"PARTIALLY_SUCCEEDED": 4,
"FAILED": 2,
"CANCELLED": 3,
}
)
func (x ScanStatus) Enum() *ScanStatus {
p := new(ScanStatus)
*p = x
return p
}
func (x ScanStatus) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ScanStatus) Descriptor() protoreflect.EnumDescriptor {
return file_scan_results_proto_enumTypes[0].Descriptor()
}
func (ScanStatus) Type() protoreflect.EnumType {
return &file_scan_results_proto_enumTypes[0]
}
func (x ScanStatus) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// A single vulnerability finding for a specific service.
type ScanFinding struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_TargetInfo *reconnaissance_go_proto.TargetInfo `protobuf:"bytes,1,opt,name=target_info,json=targetInfo,proto3"`
xxx_hidden_NetworkService *network_service_go_proto.NetworkService `protobuf:"bytes,2,opt,name=network_service,json=networkService,proto3"`
xxx_hidden_Vulnerability *vulnerability_go_proto.Vulnerability `protobuf:"bytes,3,opt,name=vulnerability,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ScanFinding) Reset() {
*x = ScanFinding{}
mi := &file_scan_results_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ScanFinding) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ScanFinding) ProtoMessage() {}
func (x *ScanFinding) ProtoReflect() protoreflect.Message {
mi := &file_scan_results_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *ScanFinding) GetTargetInfo() *reconnaissance_go_proto.TargetInfo {
if x != nil {
return x.xxx_hidden_TargetInfo
}
return nil
}
func (x *ScanFinding) GetNetworkService() *network_service_go_proto.NetworkService {
if x != nil {
return x.xxx_hidden_NetworkService
}
return nil
}
func (x *ScanFinding) GetVulnerability() *vulnerability_go_proto.Vulnerability {
if x != nil {
return x.xxx_hidden_Vulnerability
}
return nil
}
func (x *ScanFinding) SetTargetInfo(v *reconnaissance_go_proto.TargetInfo) {
x.xxx_hidden_TargetInfo = v
}
func (x *ScanFinding) SetNetworkService(v *network_service_go_proto.NetworkService) {
x.xxx_hidden_NetworkService = v
}
func (x *ScanFinding) SetVulnerability(v *vulnerability_go_proto.Vulnerability) {
x.xxx_hidden_Vulnerability = v
}
func (x *ScanFinding) HasTargetInfo() bool {
if x == nil {
return false
}
return x.xxx_hidden_TargetInfo != nil
}
func (x *ScanFinding) HasNetworkService() bool {
if x == nil {
return false
}
return x.xxx_hidden_NetworkService != nil
}
func (x *ScanFinding) HasVulnerability() bool {
if x == nil {
return false
}
return x.xxx_hidden_Vulnerability != nil
}
func (x *ScanFinding) ClearTargetInfo() {
x.xxx_hidden_TargetInfo = nil
}
func (x *ScanFinding) ClearNetworkService() {
x.xxx_hidden_NetworkService = nil
}
func (x *ScanFinding) ClearVulnerability() {
x.xxx_hidden_Vulnerability = nil
}
type ScanFinding_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Information about the scanned target.
TargetInfo *reconnaissance_go_proto.TargetInfo
// Information about the scanned network service.
NetworkService *network_service_go_proto.NetworkService
// Details about the detected vulnerability.
Vulnerability *vulnerability_go_proto.Vulnerability
}
func (b0 ScanFinding_builder) Build() *ScanFinding {
m0 := &ScanFinding{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_TargetInfo = b.TargetInfo
x.xxx_hidden_NetworkService = b.NetworkService
x.xxx_hidden_Vulnerability = b.Vulnerability
return m0
}
// Full scanning results.
// NEXT ID: 9
type ScanResults struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_ScanStatus ScanStatus `protobuf:"varint,1,opt,name=scan_status,json=scanStatus,proto3,enum=tsunami.proto.ScanStatus"`
xxx_hidden_StatusMessage string `protobuf:"bytes,6,opt,name=status_message,json=statusMessage,proto3"`
xxx_hidden_TargetAlive bool `protobuf:"varint,8,opt,name=target_alive,json=targetAlive,proto3"`
xxx_hidden_ScanFindings *[]*ScanFinding `protobuf:"bytes,2,rep,name=scan_findings,json=scanFindings,proto3"`
xxx_hidden_ScanStartTimestamp *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=scan_start_timestamp,json=scanStartTimestamp,proto3"`
xxx_hidden_ScanDuration *durationpb.Duration `protobuf:"bytes,4,opt,name=scan_duration,json=scanDuration,proto3"`
xxx_hidden_FullDetectionReports *FullDetectionReports `protobuf:"bytes,5,opt,name=full_detection_reports,json=fullDetectionReports,proto3"`
xxx_hidden_ReconnaissanceReport *reconnaissance_go_proto.ReconnaissanceReport `protobuf:"bytes,7,opt,name=reconnaissance_report,json=reconnaissanceReport,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ScanResults) Reset() {
*x = ScanResults{}
mi := &file_scan_results_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ScanResults) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ScanResults) ProtoMessage() {}
func (x *ScanResults) ProtoReflect() protoreflect.Message {
mi := &file_scan_results_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *ScanResults) GetScanStatus() ScanStatus {
if x != nil {
return x.xxx_hidden_ScanStatus
}
return ScanStatus_SCAN_STATUS_UNSPECIFIED
}
func (x *ScanResults) GetStatusMessage() string {
if x != nil {
return x.xxx_hidden_StatusMessage
}
return ""
}
func (x *ScanResults) GetTargetAlive() bool {
if x != nil {
return x.xxx_hidden_TargetAlive
}
return false
}
func (x *ScanResults) GetScanFindings() []*ScanFinding {
if x != nil {
if x.xxx_hidden_ScanFindings != nil {
return *x.xxx_hidden_ScanFindings
}
}
return nil
}
func (x *ScanResults) GetScanStartTimestamp() *timestamppb.Timestamp {
if x != nil {
return x.xxx_hidden_ScanStartTimestamp
}
return nil
}
func (x *ScanResults) GetScanDuration() *durationpb.Duration {
if x != nil {
return x.xxx_hidden_ScanDuration
}
return nil
}
func (x *ScanResults) GetFullDetectionReports() *FullDetectionReports {
if x != nil {
return x.xxx_hidden_FullDetectionReports
}
return nil
}
func (x *ScanResults) GetReconnaissanceReport() *reconnaissance_go_proto.ReconnaissanceReport {
if x != nil {
return x.xxx_hidden_ReconnaissanceReport
}
return nil
}
func (x *ScanResults) SetScanStatus(v ScanStatus) {
x.xxx_hidden_ScanStatus = v
}
func (x *ScanResults) SetStatusMessage(v string) {
x.xxx_hidden_StatusMessage = v
}
func (x *ScanResults) SetTargetAlive(v bool) {
x.xxx_hidden_TargetAlive = v
}
func (x *ScanResults) SetScanFindings(v []*ScanFinding) {
x.xxx_hidden_ScanFindings = &v
}
func (x *ScanResults) SetScanStartTimestamp(v *timestamppb.Timestamp) {
x.xxx_hidden_ScanStartTimestamp = v
}
func (x *ScanResults) SetScanDuration(v *durationpb.Duration) {
x.xxx_hidden_ScanDuration = v
}
func (x *ScanResults) SetFullDetectionReports(v *FullDetectionReports) {
x.xxx_hidden_FullDetectionReports = v
}
func (x *ScanResults) SetReconnaissanceReport(v *reconnaissance_go_proto.ReconnaissanceReport) {
x.xxx_hidden_ReconnaissanceReport = v
}
func (x *ScanResults) HasScanStartTimestamp() bool {
if x == nil {
return false
}
return x.xxx_hidden_ScanStartTimestamp != nil
}
func (x *ScanResults) HasScanDuration() bool {
if x == nil {
return false
}
return x.xxx_hidden_ScanDuration != nil
}
func (x *ScanResults) HasFullDetectionReports() bool {
if x == nil {
return false
}
return x.xxx_hidden_FullDetectionReports != nil
}
func (x *ScanResults) HasReconnaissanceReport() bool {
if x == nil {
return false
}
return x.xxx_hidden_ReconnaissanceReport != nil
}
func (x *ScanResults) ClearScanStartTimestamp() {
x.xxx_hidden_ScanStartTimestamp = nil
}
func (x *ScanResults) ClearScanDuration() {
x.xxx_hidden_ScanDuration = nil
}
func (x *ScanResults) ClearFullDetectionReports() {
x.xxx_hidden_FullDetectionReports = nil
}
func (x *ScanResults) ClearReconnaissanceReport() {
x.xxx_hidden_ReconnaissanceReport = nil
}
type ScanResults_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Status of this scan.
ScanStatus ScanStatus
// Detailed message for the scan status.
StatusMessage string
// Reports whether the target was alive during the scan.
// A target is considered alive if at least one network service was identified
// or at least one vulnerability was detected.
TargetAlive bool
// All findings from this scan.
ScanFindings []*ScanFinding
// Time when this scan was started.
ScanStartTimestamp *timestamppb.Timestamp
// Duration of the full scan.
ScanDuration *durationpb.Duration
// Detection reports from all triggered Tsunami detection plugins.
FullDetectionReports *FullDetectionReports
// Reconnaissance reports from the fingerprinting stage.
ReconnaissanceReport *reconnaissance_go_proto.ReconnaissanceReport
}
func (b0 ScanResults_builder) Build() *ScanResults {
m0 := &ScanResults{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_ScanStatus = b.ScanStatus
x.xxx_hidden_StatusMessage = b.StatusMessage
x.xxx_hidden_TargetAlive = b.TargetAlive
x.xxx_hidden_ScanFindings = &b.ScanFindings
x.xxx_hidden_ScanStartTimestamp = b.ScanStartTimestamp
x.xxx_hidden_ScanDuration = b.ScanDuration
x.xxx_hidden_FullDetectionReports = b.FullDetectionReports
x.xxx_hidden_ReconnaissanceReport = b.ReconnaissanceReport
return m0
}
// Full detection reports from all triggered Tsunami detection plugins.
type FullDetectionReports struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_DetectionReports *[]*detection_go_proto.DetectionReport `protobuf:"bytes,1,rep,name=detection_reports,json=detectionReports,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *FullDetectionReports) Reset() {
*x = FullDetectionReports{}
mi := &file_scan_results_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *FullDetectionReports) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FullDetectionReports) ProtoMessage() {}
func (x *FullDetectionReports) ProtoReflect() protoreflect.Message {
mi := &file_scan_results_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *FullDetectionReports) GetDetectionReports() []*detection_go_proto.DetectionReport {
if x != nil {
if x.xxx_hidden_DetectionReports != nil {
return *x.xxx_hidden_DetectionReports
}
}
return nil
}
func (x *FullDetectionReports) SetDetectionReports(v []*detection_go_proto.DetectionReport) {
x.xxx_hidden_DetectionReports = &v
}
type FullDetectionReports_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
DetectionReports []*detection_go_proto.DetectionReport
}
func (b0 FullDetectionReports_builder) Build() *FullDetectionReports {
m0 := &FullDetectionReports{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_DetectionReports = &b.DetectionReports
return m0
}
var File_scan_results_proto protoreflect.FileDescriptor
const file_scan_results_proto_rawDesc = "" +
"\n" +
"\x12scan_results.proto\x12\rtsunami.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x0fdetection.proto\x1a\x15network_service.proto\x1a\x14reconnaissance.proto\x1a\x13vulnerability.proto\"\xd5\x01\n" +
"\vScanFinding\x12:\n" +
"\vtarget_info\x18\x01 \x01(\v2\x19.tsunami.proto.TargetInfoR\n" +
"targetInfo\x12F\n" +
"\x0fnetwork_service\x18\x02 \x01(\v2\x1d.tsunami.proto.NetworkServiceR\x0enetworkService\x12B\n" +
"\rvulnerability\x18\x03 \x01(\v2\x1c.tsunami.proto.VulnerabilityR\rvulnerability\"\x97\x04\n" +
"\vScanResults\x12:\n" +
"\vscan_status\x18\x01 \x01(\x0e2\x19.tsunami.proto.ScanStatusR\n" +
"scanStatus\x12%\n" +
"\x0estatus_message\x18\x06 \x01(\tR\rstatusMessage\x12!\n" +
"\ftarget_alive\x18\b \x01(\bR\vtargetAlive\x12?\n" +
"\rscan_findings\x18\x02 \x03(\v2\x1a.tsunami.proto.ScanFindingR\fscanFindings\x12L\n" +
"\x14scan_start_timestamp\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\x12scanStartTimestamp\x12>\n" +
"\rscan_duration\x18\x04 \x01(\v2\x19.google.protobuf.DurationR\fscanDuration\x12Y\n" +
"\x16full_detection_reports\x18\x05 \x01(\v2#.tsunami.proto.FullDetectionReportsR\x14fullDetectionReports\x12X\n" +
"\x15reconnaissance_report\x18\a \x01(\v2#.tsunami.proto.ReconnaissanceReportR\x14reconnaissanceReport\"c\n" +
"\x14FullDetectionReports\x12K\n" +
"\x11detection_reports\x18\x01 \x03(\v2\x1e.tsunami.proto.DetectionReportR\x10detectionReports*l\n" +
"\n" +
"ScanStatus\x12\x1b\n" +
"\x17SCAN_STATUS_UNSPECIFIED\x10\x00\x12\r\n" +
"\tSUCCEEDED\x10\x01\x12\x17\n" +
"\x13PARTIALLY_SUCCEEDED\x10\x04\x12\n" +
"\n" +
"\x06FAILED\x10\x02\x12\r\n" +
"\tCANCELLED\x10\x03Bz\n" +
"\x18com.google.tsunami.protoB\x11ScanResultsProtosP\x01ZIgithub.com/google/tsunami-security-scanner/proto/go/scan_results_go_protob\x06proto3"
var file_scan_results_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_scan_results_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_scan_results_proto_goTypes = []any{
(ScanStatus)(0), // 0: tsunami.proto.ScanStatus
(*ScanFinding)(nil), // 1: tsunami.proto.ScanFinding
(*ScanResults)(nil), // 2: tsunami.proto.ScanResults
(*FullDetectionReports)(nil), // 3: tsunami.proto.FullDetectionReports
(*reconnaissance_go_proto.TargetInfo)(nil), // 4: tsunami.proto.TargetInfo
(*network_service_go_proto.NetworkService)(nil), // 5: tsunami.proto.NetworkService
(*vulnerability_go_proto.Vulnerability)(nil), // 6: tsunami.proto.Vulnerability
(*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp
(*durationpb.Duration)(nil), // 8: google.protobuf.Duration
(*reconnaissance_go_proto.ReconnaissanceReport)(nil), // 9: tsunami.proto.ReconnaissanceReport
(*detection_go_proto.DetectionReport)(nil), // 10: tsunami.proto.DetectionReport
}
var file_scan_results_proto_depIdxs = []int32{
4, // 0: tsunami.proto.ScanFinding.target_info:type_name -> tsunami.proto.TargetInfo
5, // 1: tsunami.proto.ScanFinding.network_service:type_name -> tsunami.proto.NetworkService
6, // 2: tsunami.proto.ScanFinding.vulnerability:type_name -> tsunami.proto.Vulnerability
0, // 3: tsunami.proto.ScanResults.scan_status:type_name -> tsunami.proto.ScanStatus
1, // 4: tsunami.proto.ScanResults.scan_findings:type_name -> tsunami.proto.ScanFinding
7, // 5: tsunami.proto.ScanResults.scan_start_timestamp:type_name -> google.protobuf.Timestamp
8, // 6: tsunami.proto.ScanResults.scan_duration:type_name -> google.protobuf.Duration
3, // 7: tsunami.proto.ScanResults.full_detection_reports:type_name -> tsunami.proto.FullDetectionReports
9, // 8: tsunami.proto.ScanResults.reconnaissance_report:type_name -> tsunami.proto.ReconnaissanceReport
10, // 9: tsunami.proto.FullDetectionReports.detection_reports:type_name -> tsunami.proto.DetectionReport
10, // [10:10] is the sub-list for method output_type
10, // [10:10] is the sub-list for method input_type
10, // [10:10] is the sub-list for extension type_name
10, // [10:10] is the sub-list for extension extendee
0, // [0:10] is the sub-list for field type_name
}
func init() { file_scan_results_proto_init() }
func file_scan_results_proto_init() {
if File_scan_results_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_scan_results_proto_rawDesc), len(file_scan_results_proto_rawDesc)),
NumEnums: 1,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_scan_results_proto_goTypes,
DependencyIndexes: file_scan_results_proto_depIdxs,
EnumInfos: file_scan_results_proto_enumTypes,
MessageInfos: file_scan_results_proto_msgTypes,
}.Build()
File_scan_results_proto = out.File
file_scan_results_proto_goTypes = nil
file_scan_results_proto_depIdxs = nil
}

View File

@ -1,272 +0,0 @@
//
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Data models for describing a scanning target.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.10
// protoc v3.21.12
// source: scan_target.proto
package scan_target_go_proto
import (
network_go_proto "github.com/google/tsunami-security-scanner/proto/go/network_go_proto"
network_service_go_proto "github.com/google/tsunami-security-scanner/proto/go/network_service_go_proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// The information about a scan target.
type ScanTarget struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Target isScanTarget_Target `protobuf_oneof:"target"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *ScanTarget) Reset() {
*x = ScanTarget{}
mi := &file_scan_target_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *ScanTarget) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ScanTarget) ProtoMessage() {}
func (x *ScanTarget) ProtoReflect() protoreflect.Message {
mi := &file_scan_target_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *ScanTarget) GetNetworkEndpoint() *network_go_proto.NetworkEndpoint {
if x != nil {
if x, ok := x.xxx_hidden_Target.(*scanTarget_NetworkEndpoint); ok {
return x.NetworkEndpoint
}
}
return nil
}
func (x *ScanTarget) GetNetworkService() *network_service_go_proto.NetworkService {
if x != nil {
if x, ok := x.xxx_hidden_Target.(*scanTarget_NetworkService); ok {
return x.NetworkService
}
}
return nil
}
func (x *ScanTarget) SetNetworkEndpoint(v *network_go_proto.NetworkEndpoint) {
if v == nil {
x.xxx_hidden_Target = nil
return
}
x.xxx_hidden_Target = &scanTarget_NetworkEndpoint{v}
}
func (x *ScanTarget) SetNetworkService(v *network_service_go_proto.NetworkService) {
if v == nil {
x.xxx_hidden_Target = nil
return
}
x.xxx_hidden_Target = &scanTarget_NetworkService{v}
}
func (x *ScanTarget) HasTarget() bool {
if x == nil {
return false
}
return x.xxx_hidden_Target != nil
}
func (x *ScanTarget) HasNetworkEndpoint() bool {
if x == nil {
return false
}
_, ok := x.xxx_hidden_Target.(*scanTarget_NetworkEndpoint)
return ok
}
func (x *ScanTarget) HasNetworkService() bool {
if x == nil {
return false
}
_, ok := x.xxx_hidden_Target.(*scanTarget_NetworkService)
return ok
}
func (x *ScanTarget) ClearTarget() {
x.xxx_hidden_Target = nil
}
func (x *ScanTarget) ClearNetworkEndpoint() {
if _, ok := x.xxx_hidden_Target.(*scanTarget_NetworkEndpoint); ok {
x.xxx_hidden_Target = nil
}
}
func (x *ScanTarget) ClearNetworkService() {
if _, ok := x.xxx_hidden_Target.(*scanTarget_NetworkService); ok {
x.xxx_hidden_Target = nil
}
}
const ScanTarget_Target_not_set_case case_ScanTarget_Target = 0
const ScanTarget_NetworkEndpoint_case case_ScanTarget_Target = 1
const ScanTarget_NetworkService_case case_ScanTarget_Target = 2
func (x *ScanTarget) WhichTarget() case_ScanTarget_Target {
if x == nil {
return ScanTarget_Target_not_set_case
}
switch x.xxx_hidden_Target.(type) {
case *scanTarget_NetworkEndpoint:
return ScanTarget_NetworkEndpoint_case
case *scanTarget_NetworkService:
return ScanTarget_NetworkService_case
default:
return ScanTarget_Target_not_set_case
}
}
type ScanTarget_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Fields of oneof xxx_hidden_Target:
// The network endpoint to be scanned.
NetworkEndpoint *network_go_proto.NetworkEndpoint
// The network service to be scanned.
NetworkService *network_service_go_proto.NetworkService
// -- end of xxx_hidden_Target
}
func (b0 ScanTarget_builder) Build() *ScanTarget {
m0 := &ScanTarget{}
b, x := &b0, m0
_, _ = b, x
if b.NetworkEndpoint != nil {
x.xxx_hidden_Target = &scanTarget_NetworkEndpoint{b.NetworkEndpoint}
}
if b.NetworkService != nil {
x.xxx_hidden_Target = &scanTarget_NetworkService{b.NetworkService}
}
return m0
}
type case_ScanTarget_Target protoreflect.FieldNumber
func (x case_ScanTarget_Target) String() string {
md := file_scan_target_proto_msgTypes[0].Descriptor()
if x == 0 {
return "not set"
}
return protoimpl.X.MessageFieldStringOf(md, protoreflect.FieldNumber(x))
}
type isScanTarget_Target interface {
isScanTarget_Target()
}
type scanTarget_NetworkEndpoint struct {
// The network endpoint to be scanned.
NetworkEndpoint *network_go_proto.NetworkEndpoint `protobuf:"bytes,1,opt,name=network_endpoint,json=networkEndpoint,proto3,oneof"`
}
type scanTarget_NetworkService struct {
// The network service to be scanned.
NetworkService *network_service_go_proto.NetworkService `protobuf:"bytes,2,opt,name=network_service,json=networkService,proto3,oneof"`
}
func (*scanTarget_NetworkEndpoint) isScanTarget_Target() {}
func (*scanTarget_NetworkService) isScanTarget_Target() {}
var File_scan_target_proto protoreflect.FileDescriptor
const file_scan_target_proto_rawDesc = "" +
"\n" +
"\x11scan_target.proto\x12\rtsunami.proto\x1a\rnetwork.proto\x1a\x15network_service.proto\"\xad\x01\n" +
"\n" +
"ScanTarget\x12K\n" +
"\x10network_endpoint\x18\x01 \x01(\v2\x1e.tsunami.proto.NetworkEndpointH\x00R\x0fnetworkEndpoint\x12H\n" +
"\x0fnetwork_service\x18\x02 \x01(\v2\x1d.tsunami.proto.NetworkServiceH\x00R\x0enetworkServiceB\b\n" +
"\x06targetBx\n" +
"\x18com.google.tsunami.protoB\x10ScanTargetProtosP\x01ZHgithub.com/google/tsunami-security-scanner/proto/go/scan_target_go_protob\x06proto3"
var file_scan_target_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_scan_target_proto_goTypes = []any{
(*ScanTarget)(nil), // 0: tsunami.proto.ScanTarget
(*network_go_proto.NetworkEndpoint)(nil), // 1: tsunami.proto.NetworkEndpoint
(*network_service_go_proto.NetworkService)(nil), // 2: tsunami.proto.NetworkService
}
var file_scan_target_proto_depIdxs = []int32{
1, // 0: tsunami.proto.ScanTarget.network_endpoint:type_name -> tsunami.proto.NetworkEndpoint
2, // 1: tsunami.proto.ScanTarget.network_service:type_name -> tsunami.proto.NetworkService
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_scan_target_proto_init() }
func file_scan_target_proto_init() {
if File_scan_target_proto != nil {
return
}
file_scan_target_proto_msgTypes[0].OneofWrappers = []any{
(*scanTarget_NetworkEndpoint)(nil),
(*scanTarget_NetworkService)(nil),
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_scan_target_proto_rawDesc), len(file_scan_target_proto_rawDesc)),
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_scan_target_proto_goTypes,
DependencyIndexes: file_scan_target_proto_depIdxs,
MessageInfos: file_scan_target_proto_msgTypes,
}.Build()
File_scan_target_proto = out.File
file_scan_target_proto_goTypes = nil
file_scan_target_proto_depIdxs = nil
}

View File

@ -1,571 +0,0 @@
//
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Data models for describing a software.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.10
// protoc v3.21.12
// source: software.proto
package software_go_proto
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Type of the Version message, identifying an ordinary software version or a
// sentinel MINIMUM/MAXIMUM version. See comments below for what is a sentinel
// version.
type Version_VersionType int32
const (
Version_VERSION_TYPE_UNSPECIFIED Version_VersionType = 0
// A normal software version.
Version_NORMAL Version_VersionType = 1
// A sentinel version representing negative infinity, i.e. MINIMUM version
// is less than any NORMAL and MAXIMUM versions.
Version_MINIMUM Version_VersionType = 2
// A sentinel version representing positive infinity, i.e. MAXIMUM version
// is greater than any NORMAL and MINIMUM versions.
Version_MAXIMUM Version_VersionType = 3
)
// Enum value maps for Version_VersionType.
var (
Version_VersionType_name = map[int32]string{
0: "VERSION_TYPE_UNSPECIFIED",
1: "NORMAL",
2: "MINIMUM",
3: "MAXIMUM",
}
Version_VersionType_value = map[string]int32{
"VERSION_TYPE_UNSPECIFIED": 0,
"NORMAL": 1,
"MINIMUM": 2,
"MAXIMUM": 3,
}
)
func (x Version_VersionType) Enum() *Version_VersionType {
p := new(Version_VersionType)
*p = x
return p
}
func (x Version_VersionType) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (Version_VersionType) Descriptor() protoreflect.EnumDescriptor {
return file_software_proto_enumTypes[0].Descriptor()
}
func (Version_VersionType) Type() protoreflect.EnumType {
return &file_software_proto_enumTypes[0]
}
func (x Version_VersionType) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Whether the range endpoint is inclusive or exclusive.
type VersionRange_Inclusiveness int32
const (
VersionRange_INCLUSIVENESS_UNSPECIFIED VersionRange_Inclusiveness = 0
VersionRange_INCLUSIVE VersionRange_Inclusiveness = 1
VersionRange_EXCLUSIVE VersionRange_Inclusiveness = 2
)
// Enum value maps for VersionRange_Inclusiveness.
var (
VersionRange_Inclusiveness_name = map[int32]string{
0: "INCLUSIVENESS_UNSPECIFIED",
1: "INCLUSIVE",
2: "EXCLUSIVE",
}
VersionRange_Inclusiveness_value = map[string]int32{
"INCLUSIVENESS_UNSPECIFIED": 0,
"INCLUSIVE": 1,
"EXCLUSIVE": 2,
}
)
func (x VersionRange_Inclusiveness) Enum() *VersionRange_Inclusiveness {
p := new(VersionRange_Inclusiveness)
*p = x
return p
}
func (x VersionRange_Inclusiveness) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (VersionRange_Inclusiveness) Descriptor() protoreflect.EnumDescriptor {
return file_software_proto_enumTypes[1].Descriptor()
}
func (VersionRange_Inclusiveness) Type() protoreflect.EnumType {
return &file_software_proto_enumTypes[1]
}
func (x VersionRange_Inclusiveness) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// The exact version of a software.
type Version struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Type Version_VersionType `protobuf:"varint,1,opt,name=type,proto3,enum=tsunami.proto.Version_VersionType"`
xxx_hidden_FullVersionString string `protobuf:"bytes,2,opt,name=full_version_string,json=fullVersionString,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Version) Reset() {
*x = Version{}
mi := &file_software_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Version) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Version) ProtoMessage() {}
func (x *Version) ProtoReflect() protoreflect.Message {
mi := &file_software_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *Version) GetType() Version_VersionType {
if x != nil {
return x.xxx_hidden_Type
}
return Version_VERSION_TYPE_UNSPECIFIED
}
func (x *Version) GetFullVersionString() string {
if x != nil {
return x.xxx_hidden_FullVersionString
}
return ""
}
func (x *Version) SetType(v Version_VersionType) {
x.xxx_hidden_Type = v
}
func (x *Version) SetFullVersionString(v string) {
x.xxx_hidden_FullVersionString = v
}
type Version_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Distinguishes between sentinel MIN/MAX versions and normal versions.
Type Version_VersionType
// Human readable version number, e.g. 1.0.3. This is set only when type is
// NORMAL. Tsunami uses raw string to represent a version number instead of
// any structured messages in order to handle different kinds of version
// schemes. Tsunami will tokenize this version string and store tokens
// internally. When performing version comparisons, Tsunami follows the
// precedence defined by Semantic Versioning (semver.org). More details can be
// found in Tsunami's internal Version class.
FullVersionString string
}
func (b0 Version_builder) Build() *Version {
m0 := &Version{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Type = b.Type
x.xxx_hidden_FullVersionString = b.FullVersionString
return m0
}
// An inclusive range of versions for a software.
type VersionRange struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_MinVersion *Version `protobuf:"bytes,1,opt,name=min_version,json=minVersion,proto3"`
xxx_hidden_MinVersionInclusiveness VersionRange_Inclusiveness `protobuf:"varint,2,opt,name=min_version_inclusiveness,json=minVersionInclusiveness,proto3,enum=tsunami.proto.VersionRange_Inclusiveness"`
xxx_hidden_MaxVersion *Version `protobuf:"bytes,3,opt,name=max_version,json=maxVersion,proto3"`
xxx_hidden_MaxVersionInclusiveness VersionRange_Inclusiveness `protobuf:"varint,4,opt,name=max_version_inclusiveness,json=maxVersionInclusiveness,proto3,enum=tsunami.proto.VersionRange_Inclusiveness"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *VersionRange) Reset() {
*x = VersionRange{}
mi := &file_software_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *VersionRange) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*VersionRange) ProtoMessage() {}
func (x *VersionRange) ProtoReflect() protoreflect.Message {
mi := &file_software_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *VersionRange) GetMinVersion() *Version {
if x != nil {
return x.xxx_hidden_MinVersion
}
return nil
}
func (x *VersionRange) GetMinVersionInclusiveness() VersionRange_Inclusiveness {
if x != nil {
return x.xxx_hidden_MinVersionInclusiveness
}
return VersionRange_INCLUSIVENESS_UNSPECIFIED
}
func (x *VersionRange) GetMaxVersion() *Version {
if x != nil {
return x.xxx_hidden_MaxVersion
}
return nil
}
func (x *VersionRange) GetMaxVersionInclusiveness() VersionRange_Inclusiveness {
if x != nil {
return x.xxx_hidden_MaxVersionInclusiveness
}
return VersionRange_INCLUSIVENESS_UNSPECIFIED
}
func (x *VersionRange) SetMinVersion(v *Version) {
x.xxx_hidden_MinVersion = v
}
func (x *VersionRange) SetMinVersionInclusiveness(v VersionRange_Inclusiveness) {
x.xxx_hidden_MinVersionInclusiveness = v
}
func (x *VersionRange) SetMaxVersion(v *Version) {
x.xxx_hidden_MaxVersion = v
}
func (x *VersionRange) SetMaxVersionInclusiveness(v VersionRange_Inclusiveness) {
x.xxx_hidden_MaxVersionInclusiveness = v
}
func (x *VersionRange) HasMinVersion() bool {
if x == nil {
return false
}
return x.xxx_hidden_MinVersion != nil
}
func (x *VersionRange) HasMaxVersion() bool {
if x == nil {
return false
}
return x.xxx_hidden_MaxVersion != nil
}
func (x *VersionRange) ClearMinVersion() {
x.xxx_hidden_MinVersion = nil
}
func (x *VersionRange) ClearMaxVersion() {
x.xxx_hidden_MaxVersion = nil
}
type VersionRange_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Minimum version that belongs in the range.
MinVersion *Version
// Inclusiveness of the min_version. When min_version points to negative
// infinity, this value will always be EXCLUSIVE to matching the
// representation of (-inf, 1.0]. Note that negative infinity version should
// ***NOT*** be compared with a version range as it is just a bogus sentinel
// version without any meaning.
MinVersionInclusiveness VersionRange_Inclusiveness
// Maximum version that belongs in the range.
MaxVersion *Version
// Inclusiveness of the max_version. When max_version points to positive
// infinity, this value will always be EXCLUSIVE to matching the
// representation of [1.0, inf). Note that positive infinity version should
// ***NOT*** be compared with a version range as it is just a bogus sentinel
// version without any meaning.
MaxVersionInclusiveness VersionRange_Inclusiveness
}
func (b0 VersionRange_builder) Build() *VersionRange {
m0 := &VersionRange{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_MinVersion = b.MinVersion
x.xxx_hidden_MinVersionInclusiveness = b.MinVersionInclusiveness
x.xxx_hidden_MaxVersion = b.MaxVersion
x.xxx_hidden_MaxVersionInclusiveness = b.MaxVersionInclusiveness
return m0
}
// A set of Versions and VersionRanges that completely describes a set of
// software releases, e.g. {3.9.1, 3.9.3, [4.7.1, 4.7.8], 4.8}
type VersionSet struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Versions *[]*Version `protobuf:"bytes,1,rep,name=versions,proto3"`
xxx_hidden_VersionRanges *[]*VersionRange `protobuf:"bytes,2,rep,name=version_ranges,json=versionRanges,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *VersionSet) Reset() {
*x = VersionSet{}
mi := &file_software_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *VersionSet) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*VersionSet) ProtoMessage() {}
func (x *VersionSet) ProtoReflect() protoreflect.Message {
mi := &file_software_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *VersionSet) GetVersions() []*Version {
if x != nil {
if x.xxx_hidden_Versions != nil {
return *x.xxx_hidden_Versions
}
}
return nil
}
func (x *VersionSet) GetVersionRanges() []*VersionRange {
if x != nil {
if x.xxx_hidden_VersionRanges != nil {
return *x.xxx_hidden_VersionRanges
}
}
return nil
}
func (x *VersionSet) SetVersions(v []*Version) {
x.xxx_hidden_Versions = &v
}
func (x *VersionSet) SetVersionRanges(v []*VersionRange) {
x.xxx_hidden_VersionRanges = &v
}
type VersionSet_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
Versions []*Version
VersionRanges []*VersionRange
}
func (b0 VersionSet_builder) Build() *VersionSet {
m0 := &VersionSet{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Versions = &b.Versions
x.xxx_hidden_VersionRanges = &b.VersionRanges
return m0
}
// A structured description about a software.
type Software struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Name string `protobuf:"bytes,1,opt,name=name,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Software) Reset() {
*x = Software{}
mi := &file_software_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Software) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Software) ProtoMessage() {}
func (x *Software) ProtoReflect() protoreflect.Message {
mi := &file_software_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *Software) GetName() string {
if x != nil {
return x.xxx_hidden_Name
}
return ""
}
func (x *Software) SetName(v string) {
x.xxx_hidden_Name = v
}
type Software_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// The name of this software.
Name string
}
func (b0 Software_builder) Build() *Software {
m0 := &Software{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Name = b.Name
return m0
}
var File_software_proto protoreflect.FileDescriptor
const file_software_proto_rawDesc = "" +
"\n" +
"\x0esoftware.proto\x12\rtsunami.proto\"\xc4\x01\n" +
"\aVersion\x126\n" +
"\x04type\x18\x01 \x01(\x0e2\".tsunami.proto.Version.VersionTypeR\x04type\x12.\n" +
"\x13full_version_string\x18\x02 \x01(\tR\x11fullVersionString\"Q\n" +
"\vVersionType\x12\x1c\n" +
"\x18VERSION_TYPE_UNSPECIFIED\x10\x00\x12\n" +
"\n" +
"\x06NORMAL\x10\x01\x12\v\n" +
"\aMINIMUM\x10\x02\x12\v\n" +
"\aMAXIMUM\x10\x03\"\x9c\x03\n" +
"\fVersionRange\x127\n" +
"\vmin_version\x18\x01 \x01(\v2\x16.tsunami.proto.VersionR\n" +
"minVersion\x12e\n" +
"\x19min_version_inclusiveness\x18\x02 \x01(\x0e2).tsunami.proto.VersionRange.InclusivenessR\x17minVersionInclusiveness\x127\n" +
"\vmax_version\x18\x03 \x01(\v2\x16.tsunami.proto.VersionR\n" +
"maxVersion\x12e\n" +
"\x19max_version_inclusiveness\x18\x04 \x01(\x0e2).tsunami.proto.VersionRange.InclusivenessR\x17maxVersionInclusiveness\"L\n" +
"\rInclusiveness\x12\x1d\n" +
"\x19INCLUSIVENESS_UNSPECIFIED\x10\x00\x12\r\n" +
"\tINCLUSIVE\x10\x01\x12\r\n" +
"\tEXCLUSIVE\x10\x02\"\x84\x01\n" +
"\n" +
"VersionSet\x122\n" +
"\bversions\x18\x01 \x03(\v2\x16.tsunami.proto.VersionR\bversions\x12B\n" +
"\x0eversion_ranges\x18\x02 \x03(\v2\x1b.tsunami.proto.VersionRangeR\rversionRanges\"\x1e\n" +
"\bSoftware\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04nameBs\n" +
"\x18com.google.tsunami.protoB\x0eSoftwareProtosP\x01ZEgithub.com/google/tsunami-security-scanner/proto/go/software_go_protob\x06proto3"
var file_software_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_software_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_software_proto_goTypes = []any{
(Version_VersionType)(0), // 0: tsunami.proto.Version.VersionType
(VersionRange_Inclusiveness)(0), // 1: tsunami.proto.VersionRange.Inclusiveness
(*Version)(nil), // 2: tsunami.proto.Version
(*VersionRange)(nil), // 3: tsunami.proto.VersionRange
(*VersionSet)(nil), // 4: tsunami.proto.VersionSet
(*Software)(nil), // 5: tsunami.proto.Software
}
var file_software_proto_depIdxs = []int32{
0, // 0: tsunami.proto.Version.type:type_name -> tsunami.proto.Version.VersionType
2, // 1: tsunami.proto.VersionRange.min_version:type_name -> tsunami.proto.Version
1, // 2: tsunami.proto.VersionRange.min_version_inclusiveness:type_name -> tsunami.proto.VersionRange.Inclusiveness
2, // 3: tsunami.proto.VersionRange.max_version:type_name -> tsunami.proto.Version
1, // 4: tsunami.proto.VersionRange.max_version_inclusiveness:type_name -> tsunami.proto.VersionRange.Inclusiveness
2, // 5: tsunami.proto.VersionSet.versions:type_name -> tsunami.proto.Version
3, // 6: tsunami.proto.VersionSet.version_ranges:type_name -> tsunami.proto.VersionRange
7, // [7:7] is the sub-list for method output_type
7, // [7:7] is the sub-list for method input_type
7, // [7:7] is the sub-list for extension type_name
7, // [7:7] is the sub-list for extension extendee
0, // [0:7] is the sub-list for field type_name
}
func init() { file_software_proto_init() }
func file_software_proto_init() {
if File_software_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_software_proto_rawDesc), len(file_software_proto_rawDesc)),
NumEnums: 2,
NumMessages: 4,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_software_proto_goTypes,
DependencyIndexes: file_software_proto_depIdxs,
EnumInfos: file_software_proto_enumTypes,
MessageInfos: file_software_proto_msgTypes,
}.Build()
File_software_proto = out.File
file_software_proto_goTypes = nil
file_software_proto_depIdxs = nil
}

File diff suppressed because it is too large Load Diff

View File

@ -1,645 +0,0 @@
//
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Data models for the web crawler.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.10
// protoc v3.21.12
// source: web_crawl.proto
package web_crawl_go_proto
import (
network_go_proto "github.com/google/tsunami-security-scanner/proto/go/network_go_proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
unsafe "unsafe"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Next ID: 7
type CrawlConfig struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_SeedingUrls []string `protobuf:"bytes,1,rep,name=seeding_urls,json=seedingUrls,proto3"`
xxx_hidden_MaxDepth int32 `protobuf:"varint,2,opt,name=max_depth,json=maxDepth,proto3"`
xxx_hidden_Scopes *[]*CrawlConfig_Scope `protobuf:"bytes,3,rep,name=scopes,proto3"`
xxx_hidden_ShouldEnforceScopeCheck bool `protobuf:"varint,5,opt,name=should_enforce_scope_check,json=shouldEnforceScopeCheck,proto3"`
xxx_hidden_NetworkEndpoint *network_go_proto.NetworkEndpoint `protobuf:"bytes,6,opt,name=network_endpoint,json=networkEndpoint,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CrawlConfig) Reset() {
*x = CrawlConfig{}
mi := &file_web_crawl_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CrawlConfig) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CrawlConfig) ProtoMessage() {}
func (x *CrawlConfig) ProtoReflect() protoreflect.Message {
mi := &file_web_crawl_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *CrawlConfig) GetSeedingUrls() []string {
if x != nil {
return x.xxx_hidden_SeedingUrls
}
return nil
}
func (x *CrawlConfig) GetMaxDepth() int32 {
if x != nil {
return x.xxx_hidden_MaxDepth
}
return 0
}
func (x *CrawlConfig) GetScopes() []*CrawlConfig_Scope {
if x != nil {
if x.xxx_hidden_Scopes != nil {
return *x.xxx_hidden_Scopes
}
}
return nil
}
func (x *CrawlConfig) GetShouldEnforceScopeCheck() bool {
if x != nil {
return x.xxx_hidden_ShouldEnforceScopeCheck
}
return false
}
func (x *CrawlConfig) GetNetworkEndpoint() *network_go_proto.NetworkEndpoint {
if x != nil {
return x.xxx_hidden_NetworkEndpoint
}
return nil
}
func (x *CrawlConfig) SetSeedingUrls(v []string) {
x.xxx_hidden_SeedingUrls = v
}
func (x *CrawlConfig) SetMaxDepth(v int32) {
x.xxx_hidden_MaxDepth = v
}
func (x *CrawlConfig) SetScopes(v []*CrawlConfig_Scope) {
x.xxx_hidden_Scopes = &v
}
func (x *CrawlConfig) SetShouldEnforceScopeCheck(v bool) {
x.xxx_hidden_ShouldEnforceScopeCheck = v
}
func (x *CrawlConfig) SetNetworkEndpoint(v *network_go_proto.NetworkEndpoint) {
x.xxx_hidden_NetworkEndpoint = v
}
func (x *CrawlConfig) HasNetworkEndpoint() bool {
if x == nil {
return false
}
return x.xxx_hidden_NetworkEndpoint != nil
}
func (x *CrawlConfig) ClearNetworkEndpoint() {
x.xxx_hidden_NetworkEndpoint = nil
}
type CrawlConfig_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// Starting points of a web crawl.
// Required.
SeedingUrls []string
// The maximum depth of a web crawl.
// Required.
MaxDepth int32
// Allowed crawling scopes.
// Optional. When empty, scopes are autogenerated from seeding_urls.
Scopes []*CrawlConfig_Scope
// Whether crawling scope check should be enforced.
// Optional.
ShouldEnforceScopeCheck bool
// The network endpoint to be crawled.
// Required.
NetworkEndpoint *network_go_proto.NetworkEndpoint
}
func (b0 CrawlConfig_builder) Build() *CrawlConfig {
m0 := &CrawlConfig{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_SeedingUrls = b.SeedingUrls
x.xxx_hidden_MaxDepth = b.MaxDepth
x.xxx_hidden_Scopes = &b.Scopes
x.xxx_hidden_ShouldEnforceScopeCheck = b.ShouldEnforceScopeCheck
x.xxx_hidden_NetworkEndpoint = b.NetworkEndpoint
return m0
}
type CrawlTarget struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Url string `protobuf:"bytes,1,opt,name=url,proto3"`
xxx_hidden_HttpMethod string `protobuf:"bytes,2,opt,name=http_method,json=httpMethod,proto3"`
xxx_hidden_HttpRequestBody []byte `protobuf:"bytes,3,opt,name=http_request_body,json=httpRequestBody,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CrawlTarget) Reset() {
*x = CrawlTarget{}
mi := &file_web_crawl_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CrawlTarget) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CrawlTarget) ProtoMessage() {}
func (x *CrawlTarget) ProtoReflect() protoreflect.Message {
mi := &file_web_crawl_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *CrawlTarget) GetUrl() string {
if x != nil {
return x.xxx_hidden_Url
}
return ""
}
func (x *CrawlTarget) GetHttpMethod() string {
if x != nil {
return x.xxx_hidden_HttpMethod
}
return ""
}
func (x *CrawlTarget) GetHttpRequestBody() []byte {
if x != nil {
return x.xxx_hidden_HttpRequestBody
}
return nil
}
func (x *CrawlTarget) SetUrl(v string) {
x.xxx_hidden_Url = v
}
func (x *CrawlTarget) SetHttpMethod(v string) {
x.xxx_hidden_HttpMethod = v
}
func (x *CrawlTarget) SetHttpRequestBody(v []byte) {
if v == nil {
v = []byte{}
}
x.xxx_hidden_HttpRequestBody = v
}
type CrawlTarget_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// The URL pointing to the document.
Url string
// HTTP method to reach the url. Value must be in all upper case, like "GET".
HttpMethod string
// An optional HTTP request body sent to the crawl URL.
HttpRequestBody []byte
}
func (b0 CrawlTarget_builder) Build() *CrawlTarget {
m0 := &CrawlTarget{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Url = b.Url
x.xxx_hidden_HttpMethod = b.HttpMethod
x.xxx_hidden_HttpRequestBody = b.HttpRequestBody
return m0
}
// Represents an HTTP header.
type HttpHeader struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Key string `protobuf:"bytes,1,opt,name=key,proto3"`
xxx_hidden_Value string `protobuf:"bytes,2,opt,name=value,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *HttpHeader) Reset() {
*x = HttpHeader{}
mi := &file_web_crawl_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *HttpHeader) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*HttpHeader) ProtoMessage() {}
func (x *HttpHeader) ProtoReflect() protoreflect.Message {
mi := &file_web_crawl_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *HttpHeader) GetKey() string {
if x != nil {
return x.xxx_hidden_Key
}
return ""
}
func (x *HttpHeader) GetValue() string {
if x != nil {
return x.xxx_hidden_Value
}
return ""
}
func (x *HttpHeader) SetKey(v string) {
x.xxx_hidden_Key = v
}
func (x *HttpHeader) SetValue(v string) {
x.xxx_hidden_Value = v
}
type HttpHeader_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
Key string
Value string
}
func (b0 HttpHeader_builder) Build() *HttpHeader {
m0 := &HttpHeader{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Key = b.Key
x.xxx_hidden_Value = b.Value
return m0
}
type CrawlResult struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_CrawlTarget *CrawlTarget `protobuf:"bytes,1,opt,name=crawl_target,json=crawlTarget,proto3"`
xxx_hidden_CrawlDepth int32 `protobuf:"varint,2,opt,name=crawl_depth,json=crawlDepth,proto3"`
xxx_hidden_ResponseCode int32 `protobuf:"varint,3,opt,name=response_code,json=responseCode,proto3"`
xxx_hidden_ContentType string `protobuf:"bytes,4,opt,name=content_type,json=contentType,proto3"`
xxx_hidden_Content []byte `protobuf:"bytes,5,opt,name=content,proto3"`
xxx_hidden_ResponseHeaders *[]*HttpHeader `protobuf:"bytes,6,rep,name=response_headers,json=responseHeaders,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CrawlResult) Reset() {
*x = CrawlResult{}
mi := &file_web_crawl_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CrawlResult) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CrawlResult) ProtoMessage() {}
func (x *CrawlResult) ProtoReflect() protoreflect.Message {
mi := &file_web_crawl_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *CrawlResult) GetCrawlTarget() *CrawlTarget {
if x != nil {
return x.xxx_hidden_CrawlTarget
}
return nil
}
func (x *CrawlResult) GetCrawlDepth() int32 {
if x != nil {
return x.xxx_hidden_CrawlDepth
}
return 0
}
func (x *CrawlResult) GetResponseCode() int32 {
if x != nil {
return x.xxx_hidden_ResponseCode
}
return 0
}
func (x *CrawlResult) GetContentType() string {
if x != nil {
return x.xxx_hidden_ContentType
}
return ""
}
func (x *CrawlResult) GetContent() []byte {
if x != nil {
return x.xxx_hidden_Content
}
return nil
}
func (x *CrawlResult) GetResponseHeaders() []*HttpHeader {
if x != nil {
if x.xxx_hidden_ResponseHeaders != nil {
return *x.xxx_hidden_ResponseHeaders
}
}
return nil
}
func (x *CrawlResult) SetCrawlTarget(v *CrawlTarget) {
x.xxx_hidden_CrawlTarget = v
}
func (x *CrawlResult) SetCrawlDepth(v int32) {
x.xxx_hidden_CrawlDepth = v
}
func (x *CrawlResult) SetResponseCode(v int32) {
x.xxx_hidden_ResponseCode = v
}
func (x *CrawlResult) SetContentType(v string) {
x.xxx_hidden_ContentType = v
}
func (x *CrawlResult) SetContent(v []byte) {
if v == nil {
v = []byte{}
}
x.xxx_hidden_Content = v
}
func (x *CrawlResult) SetResponseHeaders(v []*HttpHeader) {
x.xxx_hidden_ResponseHeaders = &v
}
func (x *CrawlResult) HasCrawlTarget() bool {
if x == nil {
return false
}
return x.xxx_hidden_CrawlTarget != nil
}
func (x *CrawlResult) ClearCrawlTarget() {
x.xxx_hidden_CrawlTarget = nil
}
type CrawlResult_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// The target visited by the crawler.
CrawlTarget *CrawlTarget
// Depth at which the target was visited.
CrawlDepth int32
// Response code from the crawled target.
ResponseCode int32
// Content type of the resource served at the crawl target.
ContentType string
// The content of the resource served at the crawl target.
Content []byte
// Http headers of the response
ResponseHeaders []*HttpHeader
}
func (b0 CrawlResult_builder) Build() *CrawlResult {
m0 := &CrawlResult{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_CrawlTarget = b.CrawlTarget
x.xxx_hidden_CrawlDepth = b.CrawlDepth
x.xxx_hidden_ResponseCode = b.ResponseCode
x.xxx_hidden_ContentType = b.ContentType
x.xxx_hidden_Content = b.Content
x.xxx_hidden_ResponseHeaders = &b.ResponseHeaders
return m0
}
// The crawler should only interact with web resources under certain scopes.
type CrawlConfig_Scope struct {
state protoimpl.MessageState `protogen:"opaque.v1"`
xxx_hidden_Domain string `protobuf:"bytes,1,opt,name=domain,proto3"`
xxx_hidden_Path string `protobuf:"bytes,2,opt,name=path,proto3"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CrawlConfig_Scope) Reset() {
*x = CrawlConfig_Scope{}
mi := &file_web_crawl_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CrawlConfig_Scope) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CrawlConfig_Scope) ProtoMessage() {}
func (x *CrawlConfig_Scope) ProtoReflect() protoreflect.Message {
mi := &file_web_crawl_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
func (x *CrawlConfig_Scope) GetDomain() string {
if x != nil {
return x.xxx_hidden_Domain
}
return ""
}
func (x *CrawlConfig_Scope) GetPath() string {
if x != nil {
return x.xxx_hidden_Path
}
return ""
}
func (x *CrawlConfig_Scope) SetDomain(v string) {
x.xxx_hidden_Domain = v
}
func (x *CrawlConfig_Scope) SetPath(v string) {
x.xxx_hidden_Path = v
}
type CrawlConfig_Scope_builder struct {
_ [0]func() // Prevents comparability and use of unkeyed literals for the builder.
// The domain of the scope, only URLs that are on the same domain or a
// subdomain will be admitted for crawling. Domain might include a port.
// Required.
Domain string
// The path of the scope, only URLs that are under the same path will be
// admitted for crawling.
// Optional. When empty, all URLs under the same domain are allowed,
// regardless of the paths.
Path string
}
func (b0 CrawlConfig_Scope_builder) Build() *CrawlConfig_Scope {
m0 := &CrawlConfig_Scope{}
b, x := &b0, m0
_, _ = b, x
x.xxx_hidden_Domain = b.Domain
x.xxx_hidden_Path = b.Path
return m0
}
var File_web_crawl_proto protoreflect.FileDescriptor
const file_web_crawl_proto_rawDesc = "" +
"\n" +
"\x0fweb_crawl.proto\x12\rtsunami.proto\x1a\rnetwork.proto\"\xca\x02\n" +
"\vCrawlConfig\x12!\n" +
"\fseeding_urls\x18\x01 \x03(\tR\vseedingUrls\x12\x1b\n" +
"\tmax_depth\x18\x02 \x01(\x05R\bmaxDepth\x128\n" +
"\x06scopes\x18\x03 \x03(\v2 .tsunami.proto.CrawlConfig.ScopeR\x06scopes\x12;\n" +
"\x1ashould_enforce_scope_check\x18\x05 \x01(\bR\x17shouldEnforceScopeCheck\x12I\n" +
"\x10network_endpoint\x18\x06 \x01(\v2\x1e.tsunami.proto.NetworkEndpointR\x0fnetworkEndpoint\x1a3\n" +
"\x05Scope\x12\x16\n" +
"\x06domain\x18\x01 \x01(\tR\x06domain\x12\x12\n" +
"\x04path\x18\x02 \x01(\tR\x04pathJ\x04\b\x04\x10\x05\"l\n" +
"\vCrawlTarget\x12\x10\n" +
"\x03url\x18\x01 \x01(\tR\x03url\x12\x1f\n" +
"\vhttp_method\x18\x02 \x01(\tR\n" +
"httpMethod\x12*\n" +
"\x11http_request_body\x18\x03 \x01(\fR\x0fhttpRequestBody\"4\n" +
"\n" +
"HttpHeader\x12\x10\n" +
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
"\x05value\x18\x02 \x01(\tR\x05value\"\x95\x02\n" +
"\vCrawlResult\x12=\n" +
"\fcrawl_target\x18\x01 \x01(\v2\x1a.tsunami.proto.CrawlTargetR\vcrawlTarget\x12\x1f\n" +
"\vcrawl_depth\x18\x02 \x01(\x05R\n" +
"crawlDepth\x12#\n" +
"\rresponse_code\x18\x03 \x01(\x05R\fresponseCode\x12!\n" +
"\fcontent_type\x18\x04 \x01(\tR\vcontentType\x12\x18\n" +
"\acontent\x18\x05 \x01(\fR\acontent\x12D\n" +
"\x10response_headers\x18\x06 \x03(\v2\x19.tsunami.proto.HttpHeaderR\x0fresponseHeadersBt\n" +
"\x18com.google.tsunami.protoB\x0eWebCrawlProtosP\x01ZFgithub.com/google/tsunami-security-scanner/proto/go/web_crawl_go_protob\x06proto3"
var file_web_crawl_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_web_crawl_proto_goTypes = []any{
(*CrawlConfig)(nil), // 0: tsunami.proto.CrawlConfig
(*CrawlTarget)(nil), // 1: tsunami.proto.CrawlTarget
(*HttpHeader)(nil), // 2: tsunami.proto.HttpHeader
(*CrawlResult)(nil), // 3: tsunami.proto.CrawlResult
(*CrawlConfig_Scope)(nil), // 4: tsunami.proto.CrawlConfig.Scope
(*network_go_proto.NetworkEndpoint)(nil), // 5: tsunami.proto.NetworkEndpoint
}
var file_web_crawl_proto_depIdxs = []int32{
4, // 0: tsunami.proto.CrawlConfig.scopes:type_name -> tsunami.proto.CrawlConfig.Scope
5, // 1: tsunami.proto.CrawlConfig.network_endpoint:type_name -> tsunami.proto.NetworkEndpoint
1, // 2: tsunami.proto.CrawlResult.crawl_target:type_name -> tsunami.proto.CrawlTarget
2, // 3: tsunami.proto.CrawlResult.response_headers:type_name -> tsunami.proto.HttpHeader
4, // [4:4] is the sub-list for method output_type
4, // [4:4] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
}
func init() { file_web_crawl_proto_init() }
func file_web_crawl_proto_init() {
if File_web_crawl_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_web_crawl_proto_rawDesc), len(file_web_crawl_proto_rawDesc)),
NumEnums: 0,
NumMessages: 5,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_web_crawl_proto_goTypes,
DependencyIndexes: file_web_crawl_proto_depIdxs,
MessageInfos: file_web_crawl_proto_msgTypes,
}.Build()
File_web_crawl_proto = out.File
file_web_crawl_proto_goTypes = nil
file_web_crawl_proto_depIdxs = nil
}

View File

@ -22,7 +22,7 @@ package tsunami.proto;
option java_multiple_files = true;
option java_outer_classname = "NetworkProtos";
option java_package = "com.google.tsunami.proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/go/network_go_proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/tsunami_go_proto";
// The address family of an IP address.
enum AddressFamily {

View File

@ -26,7 +26,7 @@ import "web_crawl.proto";
option java_multiple_files = true;
option java_outer_classname = "NetworkServiceProtos";
option java_package = "com.google.tsunami.proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/go/network_service_go_proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/tsunami_go_proto";
// General information about a network service running on a target.
message NetworkService {

View File

@ -24,7 +24,7 @@ import 'google/protobuf/wrappers.proto';
option java_multiple_files = true;
option java_outer_classname = "PayloadGeneratorProtos";
option java_package = "com.google.tsunami.proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/go/payload_generator_go_proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/tsunami_go_proto";
// Attributes utilized by the PayloadGenerator to select a payload
message PayloadGeneratorConfig {

View File

@ -23,7 +23,7 @@ package tsunami.proto;
option java_multiple_files = true;
option java_outer_classname = "PluginRepresentationProtos";
option java_package = "com.google.tsunami.proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/go/plugin_representation_go_proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/tsunami_go_proto";
// Represents a PluginDefinition placeholder.
message PluginDefinition {

View File

@ -27,7 +27,7 @@ import "reconnaissance.proto";
option java_multiple_files = true;
option java_outer_classname = "PluginServiceProtos";
option java_package = "com.google.tsunami.proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/go/plugin_service_go_proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/tsunami_go_proto";
// Represents a run request with all matched plugins that will need to run
// as well as the target to run against.

View File

@ -25,7 +25,7 @@ import "network_service.proto";
option java_multiple_files = true;
option java_outer_classname = "ReconnaissanceProtos";
option java_package = "com.google.tsunami.proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/go/reconnaissance_go_proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/tsunami_go_proto";
// Detailed information about the scanning target.
message TargetInfo {

View File

@ -29,7 +29,7 @@ import "vulnerability.proto";
option java_multiple_files = true;
option java_outer_classname = "ScanResultsProtos";
option java_package = "com.google.tsunami.proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/go/scan_results_go_proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/tsunami_go_proto";
// Execution status of the scan.
// NEXT ID: 5

View File

@ -25,7 +25,7 @@ import "network_service.proto";
option java_multiple_files = true;
option java_outer_classname = "ScanTargetProtos";
option java_package = "com.google.tsunami.proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/go/scan_target_go_proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/tsunami_go_proto";
// The information about a scan target.
message ScanTarget {

View File

@ -22,7 +22,7 @@ package tsunami.proto;
option java_multiple_files = true;
option java_outer_classname = "SoftwareProtos";
option java_package = "com.google.tsunami.proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/go/software_go_proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/tsunami_go_proto";
// The exact version of a software.
message Version {

View File

@ -22,7 +22,7 @@ package tsunami.proto;
option java_multiple_files = true;
option java_outer_classname = "VulnerabilityProtos";
option java_package = "com.google.tsunami.proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/go/vulnerability_go_proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/tsunami_go_proto";
// Severity of a vulnerability.
enum Severity {

View File

@ -24,7 +24,7 @@ import "network.proto";
option java_multiple_files = true;
option java_outer_classname = "WebCrawlProtos";
option java_package = "com.google.tsunami.proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/go/web_crawl_go_proto";
option go_package = "github.com/google/tsunami-security-scanner/proto/tsunami_go_proto";
// Next ID: 7
message CrawlConfig {

View File

@ -22,10 +22,9 @@ project(':tsunami-plugin').projectDir = "$rootDir/plugin" as File
project(':tsunami-proto').projectDir = "$rootDir/proto" as File
project(':tsunami-workflow').projectDir = "$rootDir/workflow" as File
def tcsRepository = System.getenv("GITREPO_TSUNAMI_TCS") ?: "https://github.com/google/tsunami-security-scanner-callback-server.git"
sourceControl {
gitRepository("${tcsRepository}") {
gitRepository("https://github.com/google/tsunami-security-scanner-callback-server.git") {
producesModule("com.google.tsunami:tcs-common")
producesModule("com.google.tsunami:tcs-proto")
}

View File

@ -5,18 +5,18 @@ dependencies {
implementation project(':tsunami-plugin')
implementation project(':tsunami-proto')
implementation "com.google.flogger:flogger:0.9"
implementation "com.google.flogger:google-extensions:0.9"
implementation "com.google.guava:guava:33.0.0-jre"
implementation "com.google.protobuf:protobuf-java-util:3.25.5"
implementation "com.google.protobuf:protobuf-java:3.25.5"
implementation "com.google.flogger:flogger:0.5.1"
implementation "com.google.flogger:google-extensions:0.5.1"
implementation "com.google.guava:guava:28.2-jre"
implementation "com.google.protobuf:protobuf-java-util:3.25.2"
implementation "com.google.protobuf:protobuf-java:3.25.2"
implementation "javax.inject:javax.inject:1"
testImplementation "com.google.guava:guava-testlib:33.0.0-jre"
testImplementation "com.google.truth:truth:1.4.4"
testImplementation "com.google.truth.extensions:truth-java8-extension:1.4.4"
testImplementation "com.google.truth.extensions:truth-proto-extension:1.4.4"
testImplementation "junit:junit:4.13.2"
testImplementation "com.google.guava:guava-testlib:28.2-jre"
testImplementation "com.google.truth:truth:1.4.0"
testImplementation "com.google.truth.extensions:truth-java8-extension:1.4.0"
testImplementation "com.google.truth.extensions:truth-proto-extension:1.4.0"
testImplementation "junit:junit:4.13"
}
tasks.named("javadoc") {
@ -37,8 +37,3 @@ tasks.named("compileTestJava") {
tasks.named("compileJava") {
dependsOn(":tsunami-plugin:shadowJar")
}
tasks.named('compileJava') {
dependsOn(':tsunami-proto:shadowJar')
}