LinuxでローカルVMスキャナーを設定する
Aikido VM Scanner is a single-package that installs on your system, automatically scanning and identifying dependencies to provide a detailed view into your environment.
Prerequisites
- Minimum system requirements: at least 1GB RAM.
- Preferred system requirements: at least 2GB RAM and 4 CPUs.
- Ensure you have sudo / admin privileges on your system
- Make sure to use the appropriate commands for your system or cloud provider
- If you need to run with root, place the AIKIDO_TOKEN env var after sudo, like this:
sudo AIKIDO_TOKEN=REPLACE_ME <install_command>
Installation and Upgrade
Make sure you run as sudo and replace AIKIDO_TOKEN with valid token from Local VM scanning page in Aikido. To specify the VM environment (that you will see later in Aikido), you can also set the VM_TYPE variable as one of: production, staging or development.
The VM Scanner Agent runs once a day, at a random time between 4:00 AM - 8:00 AM (machine time).
After install, a first scan will start automatically. If you want to run it on demand, you can manually execute:
/opt/aikido-vm-scanner-1.5.2/aikido-vm-scannerFor Red Hat-based Systems (RHEL, CentOS, Fedora)
x86_64
AIKIDO_TOKEN=REPLACE_ME VM_TYPE=production dnf install -y https://aikido-vm-agent.s3.eu-west-1.amazonaws.com/v1.5.2/aikido-vm-scanner.x86_64.rpm| Hash | aikido-vm-scanner.x86_64.rpm |
|---|---|
| MD5 | 30f49344338a5d4ed76804e4eee09520 |
| SHA256 | c491f00999f7ef98bb4e17210fa094141e4899b2facac46e545e37358e5f96b2 |
aarch64
AIKIDO_TOKEN=REPLACE_ME VM_TYPE=production dnf install -y https://aikido-vm-agent.s3.eu-west-1.amazonaws.com/v1.5.2/aikido-vm-scanner.aarch64.rpm| Hash | aikido-vm-scanner.aarch64.rpm |
|---|---|
| MD5 | 024f02a6415ef4c76485d897723e1a79 |
| SHA256 | f6df7e8c6e9c3cd00d29e7a7ade2ad607cc26405ca5de1d042f7c46830bcaf38 |
For Debian-based Systems (Debian, Ubuntu)
We support Debian >= 10 and Ubuntu >= 20.04.
x86_64
curl -L -O https://aikido-vm-agent.s3.eu-west-1.amazonaws.com/v1.5.2/aikido-vm-scanner.amd64.deb
AIKIDO_TOKEN=REPLACE_ME VM_TYPE=production apt-get install -y ./aikido-vm-scanner.amd64.deb| Hash | aikido-vm-scanner.amd64.deb |
|---|---|
| MD5 | f7237173e2fd9d938b242e0553516795 |
| SHA256 | 06164f5aa7eca359be1bf8fc4fd26ad6198a12e1613216d042edc5c747cc4fef |
aarch64
curl -L -O https://aikido-vm-agent.s3.eu-west-1.amazonaws.com/v1.5.2/aikido-vm-scanner.arm64.deb
AIKIDO_TOKEN=REPLACE_ME VM_TYPE=production apt-get install -y ./aikido-vm-scanner.arm64.deb| Hash | aikido-vm-scanner.arm64.deb |
|---|---|
| MD5 | 932211a27db8a76f51d55ea0f7e9aecd |
| SHA256 | fd1e2058c18cc89c5a0f0c70a9de3ca440f46be9a4a9444093e866d0f357b7c8 |
Latest version
If you have an automated install process and you always want to be on the latest version as soon as we release it, you can replace the version in the install link with latest:
- https://aikido-vm-agent.s3.eu-west-1.amazonaws.com/latest/aikido-vm-scanner.x86\_64.rpm
- https://aikido-vm-agent.s3.eu-west-1.amazonaws.com/latest/aikido-vm-scanner.aarch64.rpm
- https://aikido-vm-agent.s3.eu-west-1.amazonaws.com/latest/aikido-vm-scanner.amd64.deb
- https://aikido-vm-agent.s3.eu-west-1.amazonaws.com/latest/aikido-vm-scanner.arm64.deb
Additional Configuration
Token setup
If for any reason you can't set the AIKIDO_TOKEN at install time, you can set the token post install in one of two ways:
- Paste the token in
/opt/aikido-vm-scanner-1.5.2/.token - Change the contents of
/opt/aikido-vm-scanner-1.5.2/config.json:
{
"api_key": "AIKIDO_TOKEN_HERE",
"exclude": []
}Hostname change
By default, we automatically get the hostname for the scanned machine and submit that to Aikido, in order to be displayed in the Virtual Machines tab.
If you want to change the reported hostname, you can do that using the configuration file:
{
"hostname": "YOUR_HOSTNAME_HERE",
"exclude": []
}Exclude files or paths
In the config.json you can exclude files and paths by adding additional items to the exclude list. You can find some examples below.
- Exclude a single file in a directory:
{
"exclude": [
...
"./home/testing/app/package.json",
]
}- Exclude all releases subdirectories:
{
"exclude": [
...
"./home/testing/*/releases",
]
}- Exclude all .json files in the out folder and all subdirectories:
{
"exclude": [
...
"./out/**/*.json",
]
}- Exclude catalogers from scanning (eg: exclude Golang catalogers):
{
"exclude": [
],
"select_catalogers": "-go"
}Output channel
If you want to control the output channel of the VM scanner, when installing you can specify the OUTPUT variable as stdout, stderr or none.
Example for rpm x86_64:
AIKIDO_TOKEN=REPLACE_ME VM_TYPE=production OUTPUT=stderr dnf install -y https://aikido-vm-agent.s3.eu-west-1.amazonaws.com/v1.5.2/aikido-vm-scanner.x86_64.rpmThis option does not affect the disk logs. These are created no matter what this setting is.
Disable initial scan
When a rpm/deb package is installed, it automatically triggers an initial scan.
If you want to disable this feature, you can set the INITIAL_SCAN parameter to 0 at install time, like this:
AIKIDO_TOKEN=REPLACE_ME INITIAL_SCAN=0 dnf install -y https://aikido-vm-agent.s3.eu-west-1.amazonaws.com/v1.5.2/aikido-vm-scanner.x86_64.rpmEnable threat detection
Threat detection requires systemd and kernel 5.8 or later.
Set RUNTIME_DETECTION_ENABLED=true on the install command. Example for rpm on x86_64:
AIKIDO_TOKEN=REPLACE_ME VM_TYPE=production RUNTIME_DETECTION_ENABLED=true dnf install -y https://aikido-vm-agent.s3.eu-west-1.amazonaws.com/v1.5.2/aikido-vm-scanner.x86_64.rpmWhen the scanner is already installed, run:
sudo systemctl enable --now aikido-runtime-agentCLI parameters
If for any reason you need to start the scanning on demand via the command line, you can specify the following CLI parameters to be used for that scan:
--api-key string
API key for authentication
--hostname string
Hostname of the machine
--select-catalogers string
Comma-separated list of catalogers to use or remove
--vm-type string
Type of the virtual machineThese CLI parameters take precedence over those specified in config.json.
We trigger an automatic scan once per day and those scans will still use the configuration file and not the CLI parameters, so it is always preferred to place these in config.json.
- Example for setting a custom hostname via CLI:
/opt/aikido-vm-scanner-1.5.2/aikido-vm-scanner --hostname "My Custom VM"- Example for excluding Golang catalogers via CLI:
/opt/aikido-vm-scanner-1.5.2/aikido-vm-scanner --select-catalogers "-go"Connecting through a proxy
If your machine reaches the internet through a corporate proxy, the VM Scanner picks it up from the standard HTTPS_PROXY, HTTP_PROXY, and NO_PROXY environment variables. There's no proxy option in config.json and nothing to enable, the scanner uses these variables automatically when they're set.
The scan itself runs entirely locally. The only outbound traffic is HTTPS (port 443) to bg.aikido.dev, or the regional equivalent such as bg.us.aikido.dev.
Proxy support is available from version 1.4.5 onwards.
Setting the proxy for the daily scan
The daily scan runs from root's crontab, and cron jobs start with a minimal environment, so variables you export in a shell session never reach them. Declaring the variables in the crontab itself works on every distribution:
- Run
sudo crontab -e - Add the variables on their own lines, above the existing
aikido-vm-scannerline
HTTPS_PROXY=http://proxy.example.com:8080
NO_PROXY=localhost,127.0.0.1
37 5 * * * /opt/aikido-vm-scanner-1.5.2/aikido-vm-scannerIf your proxy requires authentication, include the credentials in the URL: http://user:password@proxy.example.com:8080.
Variables declared at the top of a crontab apply to every job in that crontab, not just the scanner.
Keep the variables on separate lines rather than inlining them on the scanner line. Upgrading the package rewrites the scanner's cron line, but leaves your variable lines untouched.
To test the proxy immediately, run a scan on demand:
sudo HTTPS_PROXY=http://proxy.example.com:8080 /opt/aikido-vm-scanner-1.5.2/aikido-vm-scannerProxies that perform SSL inspection
When your proxy replaces certificates with ones signed by an internal CA, add that CA to the system trust store:
- Red Hat-based systems: copy the PEM file into
/etc/pki/ca-trust/source/anchors/and runupdate-ca-trust - Debian-based systems: copy the certificate as a
.crtfile into/usr/local/share/ca-certificates/and runupdate-ca-certificates
Alternatively, point the scanner at a PEM bundle by adding SSL_CERT_FILE=/path/to/corporate-ca.pem to the same crontab.
Verifying the proxy is used
Every run records which proxy it detected in the logs at /var/log/aikido-vm-scanner-1.5.2/:
Using proxy http://proxy.example.com:8080 for https://bg.aikido.dev/api/integrations/vm_scan/uploadScanResultIf the proxy isn't picked up, you'll see No proxy detected for ..., connecting directly instead.
Uninstall
Manual uninstall
For Red Hat-based Systems (RHEL, CentOS, Fedora)
dnf remove -y aikido-vm-scannerFor Debian-based Systems (Debian, Ubuntu)
apt-get remove -y aikido-vm-scannerLogs
Logs are available here, along with the last generated SBOM: /var/log/aikido-vm-scanner-1.5.2