Skip to content

Allow new plugin for intrusion proxy sensor 'alert_http' for http-based alerts #1

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

Open
wants to merge 6 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
Binary file removed packaging/rpm/SOURCES/cookbook-snort3-0.0.1.tar.gz
Binary file not shown.
164 changes: 0 additions & 164 deletions packaging/rpm/pkgs/build.log

This file was deleted.

Binary file not shown.
54 changes: 0 additions & 54 deletions packaging/rpm/pkgs/hw_info.log

This file was deleted.

222 changes: 0 additions & 222 deletions packaging/rpm/pkgs/installed_pkgs.log

This file was deleted.

4,190 changes: 0 additions & 4,190 deletions packaging/rpm/pkgs/root.log

This file was deleted.

87 changes: 0 additions & 87 deletions packaging/rpm/pkgs/state.log

This file was deleted.

10 changes: 9 additions & 1 deletion resources/providers/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,22 @@
end

args = "-Q #{args}" if mode == 'IPS'

output_plugin = ''
output_plugin = if node['redborder']['cloud'] == true || node['redborder']['cloud'].to_s == '1'
'alert_http'
else
'alert_kafka'
end

template "/etc/snort/#{instance_name}/env" do
source 'env.erb'
cookbook 'snort3'
owner 'root'
group 'root'
mode '0644'
retries 2
variables(iface: iface, cpu_cores: cpu_cores, threads: threads, mode: mode, inline: inline, args: args)
variables(iface: iface, cpu_cores: cpu_cores, threads: threads, mode: mode, inline: inline, args: args, output_plugin: output_plugin)
notifies :stop, "service[snort3@#{instance_name}.service]", :delayed
notifies :start, "service[snort3@#{instance_name}.service]", :delayed
end
Expand Down
28 changes: 25 additions & 3 deletions resources/templates/default/config.lua.erb
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,35 @@ rate_filter =
%>

<% end %>

<%#— pick mode based on cloud flag —%>
<% if node["redborder"]["cloud"] == true || node["redborder"]["cloud"].to_s == "1" %>

---------------------------------------------------------------------------
--- HTTP output plugin
---------------------------------------------------------------------------

alert_http = {
http_endpoint = "https://http2k.<%= node["redborder"]["cdomain"] %>/rbdata/<%= node["redborder"]["sensor_uuid"] %>/rb_event",
verify_ssl = false,
enrichment = '<%= enrichment_json %>',
fields = 'src dst priority src_country_code dst_country_code sig_id ethlength_range sig_generator action msg class src_port dst_port eth_dst_mac eth_src_mac eth_dst eth_src vlan iplen udplen'
}

<% else %>

---------------------------------------------------------------------------
--- kafka output plugin
---------------------------------------------------------------------------

alert_kafka = {
topic = 'rb_event',
broker_host = 'kafka.service:9092',
enrichment = '<%=enrichment_json%>',
topic = "rb_event",
broker_host = "kafka.<%= node["redborder"]["cdomain"] %>:9092",
enrichment = '<%= enrichment_json %>',
fields = 'src dst priority src_country_code dst_country_code sig_id ethlength_range sig_generator action msg class src_port dst_port eth_dst_mac eth_src_mac eth_dst eth_src vlan iplen udplen'
}

<% end %>
---------------------------------------------------------------------------
-- 8. configure tweaks
---------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions resources/templates/default/env.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ CPU_CORES=<%=@cpu_cores%>
THREADS=<%=@threads%>
INLINE=<%=@inline%>
ARGS=<%=@args%>
OUTPUT_PLUGIN=<%=@output_plugin%>