Skip to content

Commit

Permalink
Add wazuh manager site config
Browse files Browse the repository at this point in the history
  • Loading branch information
abeverley committed Oct 7, 2024
1 parent 113b588 commit 55c0f2e
Show file tree
Hide file tree
Showing 32 changed files with 5,102 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/Brass.pm
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ any ['get', 'post'] => '/config/site/' => require_role 'config' => sub {
unless user_has_role 'config_write';
$config->smtp_relayhost(body_parameters->get('smtp_relayhost'));
$config->internal_networks(body_parameters->get('internal_networks'));
$config->wazuh_manager(body_parameters->get('wazuh_manager'));
if (process sub { $config->insert_or_update })
{
forwardHome({ success => "The configuration has been updated successfully" }, "config/site/" );
Expand Down
4 changes: 4 additions & 0 deletions lib/Brass/API.pm
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,10 @@ get 'api/site/' => sub {
{
$output = [$config->internal_networks_all];
}
elsif ($action eq 'wazuh_manager')
{
$output = [$config->wazuh_manager];
}
else {
error __x"Unknown action {action}", action => $action;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Brass/Schema.pm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ __PACKAGE__->load_namespaces;
# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-10-01 11:03:29
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:GqW9kl7MrcAx0vieFGh+cw

our $VERSION = 43;
our $VERSION = 44;

# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;
2 changes: 2 additions & 0 deletions lib/Brass/Schema/Result/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 1 },
"smtp_relayhost",
{ data_type => "text", is_nullable => 1 },
"wazuh_manager",
{ data_type => "text", is_nullable => 1 },
);

__PACKAGE__->set_primary_key("id");
Expand Down
185 changes: 185 additions & 0 deletions share/fixtures/44/conf/all_tables.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
{
"sets" : [
{
"class" : "IssueStatus",
"quantity" : "all"
},
{
"class" : "Pw",
"quantity" : "all"
},
{
"class" : "Comment",
"quantity" : "all"
},
{
"quantity" : "all",
"class" : "PwServertype"
},
{
"quantity" : "all",
"class" : "Project"
},
{
"class" : "Servertype",
"quantity" : "all"
},
{
"quantity" : "all",
"class" : "EventPerson"
},
{
"quantity" : "all",
"class" : "Uad"
},
{
"class" : "Event",
"quantity" : "all"
},
{
"class" : "Tag",
"quantity" : "all"
},
{
"quantity" : "all",
"class" : "File"
},
{
"quantity" : "all",
"class" : "Issue"
},
{
"class" : "Docreadtype",
"quantity" : "all"
},
{
"quantity" : "all",
"class" : "Status"
},
{
"quantity" : "all",
"class" : "Docsend"
},
{
"quantity" : "all",
"class" : "Cert"
},
{
"quantity" : "all",
"class" : "Customer"
},
{
"quantity" : "all",
"class" : "Server"
},
{
"class" : "App",
"quantity" : "all"
},
{
"class" : "UserProject",
"quantity" : "all"
},
{
"quantity" : "all",
"class" : "ServerCert"
},
{
"quantity" : "all",
"class" : "Calendar"
},
{
"class" : "DocDocreadtype",
"quantity" : "all"
},
{
"quantity" : "all",
"class" : "UserDocread"
},
{
"class" : "IssuePriority",
"quantity" : "all"
},
{
"class" : "CertLocationUse",
"quantity" : "all"
},
{
"quantity" : "all",
"class" : "Issuetype"
},
{
"class" : "User",
"quantity" : "all"
},
{
"quantity" : "all",
"class" : "Eventtype"
},
{
"quantity" : "all",
"class" : "ServerPw"
},
{
"quantity" : "all",
"class" : "IssueTag"
},
{
"class" : "CertLocation",
"quantity" : "all"
},
{
"quantity" : "all",
"class" : "UserTopic"
},
{
"quantity" : "all",
"class" : "Config"
},
{
"quantity" : "all",
"class" : "ServerServertype"
},
{
"quantity" : "all",
"class" : "Domain"
},
{
"quantity" : "all",
"class" : "Permission"
},
{
"class" : "Site",
"quantity" : "all"
},
{
"quantity" : "all",
"class" : "Priority"
},
{
"class" : "UserDocreadtype",
"quantity" : "all"
},
{
"class" : "UserPermission",
"quantity" : "all"
},
{
"class" : "CertUse",
"quantity" : "all"
},
{
"class" : "UserServertype",
"quantity" : "all"
}
],
"belongs_to" : {
"fetch" : 0
},
"has_many" : {
"fetch" : 0
},
"might_have" : {
"fetch" : 0
}
}
17 changes: 17 additions & 0 deletions share/fixtures/44/conf/permission.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"has_many" : {
"fetch" : 0
},
"sets" : [
{
"quantity" : "all",
"class" : "Permission"
}
],
"might_have" : {
"fetch" : 0
},
"belongs_to" : {
"fetch" : 0
}
}
17 changes: 17 additions & 0 deletions share/fixtures/44/permission/_config_set
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
$VAR1 = {
'belongs_to' => {
'fetch' => 0
},
'has_many' => {
'fetch' => 0
},
'might_have' => {
'fetch' => 0
},
'sets' => [
{
'quantity' => 'all',
'class' => 'Permission'
}
]
};
1 change: 1 addition & 0 deletions share/fixtures/44/permission/_dumper_version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.001039
6 changes: 6 additions & 0 deletions share/fixtures/44/permission/permission/1.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$HASH1 = {
description
=> 'User can view documents',
id => 1,
name => 'doc'
};
6 changes: 6 additions & 0 deletions share/fixtures/44/permission/permission/10.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$HASH1 = {
description
=> 'User can view configuration information',
id => 10,
name => 'config'
};
6 changes: 6 additions & 0 deletions share/fixtures/44/permission/permission/11.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$HASH1 = {
description
=> 'User can write configuration information',
id => 11,
name => 'config_write'
};
6 changes: 6 additions & 0 deletions share/fixtures/44/permission/permission/12.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$HASH1 = {
description
=> 'User can create and update any issue for certain projects',
id => 12,
name => 'issue_write_project'
};
6 changes: 6 additions & 0 deletions share/fixtures/44/permission/permission/13.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$HASH1 = {
description
=> 'User can read the calendar',
id => 13,
name => 'calendar_read'
};
6 changes: 6 additions & 0 deletions share/fixtures/44/permission/permission/14.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$HASH1 = {
description
=> 'User can write to the calendar',
id => 14,
name => 'calendar_write'
};
6 changes: 6 additions & 0 deletions share/fixtures/44/permission/permission/15.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$HASH1 = {
description
=> 'User administrator',
id => 15,
name => 'user_admin'
};
6 changes: 6 additions & 0 deletions share/fixtures/44/permission/permission/16.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$HASH1 = {
description
=> 'User receives brass reports',
id => 16,
name => 'reports'
};
6 changes: 6 additions & 0 deletions share/fixtures/44/permission/permission/17.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$HASH1 = {
description
=> 'User receives notification of all new issues',
id => 17,
name => 'new_issue_alert'
};
6 changes: 6 additions & 0 deletions share/fixtures/44/permission/permission/2.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$HASH1 = {
description
=> 'User can publish documents',
id => 2,
name => 'doc_publish'
};
6 changes: 6 additions & 0 deletions share/fixtures/44/permission/permission/3.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$HASH1 = {
description
=> 'User can save drafts',
id => 3,
name => 'doc_save'
};
6 changes: 6 additions & 0 deletions share/fixtures/44/permission/permission/4.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$HASH1 = {
description
=> 'User can save records',
id => 4,
name => 'doc_record'
};
6 changes: 6 additions & 0 deletions share/fixtures/44/permission/permission/5.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$HASH1 = {
description
=> 'User can view own issues',
id => 5,
name => 'issue_read'
};
6 changes: 6 additions & 0 deletions share/fixtures/44/permission/permission/6.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$HASH1 = {
description
=> 'User can view all issues',
id => 6,
name => 'issue_read_all'
};
6 changes: 6 additions & 0 deletions share/fixtures/44/permission/permission/7.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$HASH1 = {
description
=> 'User can write to new and own issues',
id => 7,
name => 'issue_write'
};
6 changes: 6 additions & 0 deletions share/fixtures/44/permission/permission/8.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$HASH1 = {
description
=> 'User can write to all issues',
id => 8,
name => 'issue_write_all'
};
6 changes: 6 additions & 0 deletions share/fixtures/44/permission/permission/9.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
$HASH1 = {
description
=> 'User can view all issues for certain projects',
id => 9,
name => 'issue_read_project'
};
18 changes: 18 additions & 0 deletions share/migrations/MySQL/deploy/44/001-auto-__VERSION.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--
-- Created by SQL::Translator::Producer::MySQL
-- Created on Mon Oct 7 18:04:26 2024
--
;
SET foreign_key_checks=0;
--
-- Table: `dbix_class_deploymenthandler_versions`
--
CREATE TABLE `dbix_class_deploymenthandler_versions` (
`id` integer NOT NULL auto_increment,
`version` varchar(50) NOT NULL,
`ddl` text NULL,
`upgrade_sql` text NULL,
PRIMARY KEY (`id`),
UNIQUE `dbix_class_deploymenthandler_versions_version` (`version`)
);
SET foreign_key_checks=1;
Loading

0 comments on commit 55c0f2e

Please sign in to comment.