Skip to content

Commit bc7800a

Browse files
author
P4T12ICK
committed
bug fix
1 parent b4c8df2 commit bc7800a

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

files/osquery_install.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
#!/bin/bash
2+
set -e
3+
24
export OSQUERY_KEY=1484120AC4E9F8A1A577AEEE97A80C63C9D8B80B
3-
export OSQUERY_REPO="deb [arch=amd64] https://pkg.osquery.io/deb deb main"
45

5-
# Download and add the GPG key
6-
curl -sSL https://pkg.osquery.io/deb/pubkey.gpg | sudo apt-key add -
6+
# Create keyrings directory if it doesn't exist
7+
sudo mkdir -p /etc/apt/keyrings
8+
9+
# Download and add the GPG key using modern method
10+
curl -sSL https://pkg.osquery.io/deb/pubkey.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/osquery.gpg
11+
12+
# Set proper permissions on the keyring
13+
sudo chmod 644 /etc/apt/keyrings/osquery.gpg
714

8-
# Add the repository
9-
echo "$OSQUERY_REPO" | sudo tee /etc/apt/sources.list.d/osquery.list
15+
# Add the repository with signed-by directive
16+
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/osquery.gpg] https://pkg.osquery.io/deb deb main" | sudo tee /etc/apt/sources.list.d/osquery.list
1017

1118
# Update and install
1219
sudo apt-get update

tasks/install_osquery_linux.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
name:
77
- software-properties-common
88
- curl
9+
- gnupg
910
state: present
1011
update_cache: true
1112

0 commit comments

Comments
 (0)