-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add capability to serve YARA rules via authenticated Fleet endpoints #23343
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* Add capability for Fleet to serve yara rules to agents over HTTPS authenticated via node key. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's clarify it needs osquery 5.14.X on the hosts. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package tables | ||
|
||
import ( | ||
"database/sql" | ||
"fmt" | ||
) | ||
|
||
func init() { | ||
MigrationClient.AddMigration(Up_20241016155452, Down_20241016155452) | ||
} | ||
|
||
func Up_20241016155452(tx *sql.Tx) error { | ||
_, err := tx.Exec(` | ||
CREATE TABLE yara_rules ( | ||
id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, | ||
name VARCHAR(255) NOT NULL, | ||
contents TEXT NOT NULL, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How big can these get? https://github.com/Yara-Rules/rules/blob/master/crypto/crypto_signatures.yar listed in the osquery docs https://osquery.readthedocs.io/en/stable/deployment/yara/#continuous-monitoring-using-the-yara_events-table is ~76KB. Eventually if customers/users need bigger rules we can migrate and store them in S3. |
||
PRIMARY KEY (id), | ||
UNIQUE KEY idx_yara_rules_name (name) | ||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;`) | ||
if err != nil { | ||
return fmt.Errorf("failed to create yara_rules table: %w", err) | ||
} | ||
return nil | ||
} | ||
|
||
func Down_20241016155452(tx *sql.Tx) error { | ||
return nil | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove this file. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package tables | ||
|
||
import "testing" | ||
|
||
func TestUp_20241025141856(t *testing.T) { | ||
db := applyUpToPrev(t) | ||
|
||
// | ||
// Insert data to test the migration | ||
// | ||
// ... | ||
|
||
// Apply current migration. | ||
applyNext(t, db) | ||
|
||
// | ||
// Check data, insert new entries, e.g. to verify migration is safe. | ||
// | ||
// ... | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use past tense.