{"id":512,"date":"2024-09-22T07:32:23","date_gmt":"2024-09-22T07:32:23","guid":{"rendered":"https:\/\/www.seclink.info\/?p=512"},"modified":"2024-09-28T02:19:09","modified_gmt":"2024-09-28T02:19:09","slug":"complete-detection-as-code-dac-in-1-hour-with-detailed-steps","status":"publish","type":"post","link":"https:\/\/www.seclink.info\/cn\/complete-detection-as-code-dac-in-1-hour-with-detailed-steps\/","title":{"rendered":"Complete Detection-as-Code (DAC) in 1 Hour &#8211; with Detailed Steps"},"content":{"rendered":"<section id=\"nice\" data-tool=\"mdnice\u7f16\u8f91\u5668\" data-website=\"https:\/\/www.mdnice.com\" style=\"margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 10px; background-attachment: scroll; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-image: linear-gradient(90deg, rgba(50, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0) 6.76%), linear-gradient(360deg, rgba(50, 0, 0, 0.05) 0%, rgba(249, 247, 252, 0) 9.46%); background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: repeat, repeat; background-size: 20px 20px, 20px 20px; width: auto; font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif; font-size: 16px; color: rgb(0, 0, 0); line-height: 1.5em; word-spacing: 0em; letter-spacing: 0em; word-break: break-word; overflow-wrap: break-word; text-align: left;\"><meta name=\"referrer\" content=\"no-referrer\"><h1 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; display: block;\"><span class=\"prefix\" style=\"display: none;\"><\/span><span class=\"content\" style=\"font-size: 24px; color: rgb(0, 0, 0); line-height: 1.5em; letter-spacing: 0em; text-align: left; font-weight: bold; display: block;\">Introduction<\/span><span class=\"suffix\" style=\"display: none;\"><\/span><\/h1>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\"><strong style=\"color: rgb(35, 84, 135); font-weight: bold; background-attachment: scroll; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">DAC<\/strong>((<strong style=\"color: rgb(35, 84, 135); font-weight: bold; background-attachment: scroll; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">D<\/strong>etection <strong style=\"color: rgb(35, 84, 135); font-weight: bold; background-attachment: scroll; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">A<\/strong>s <strong style=\"color: rgb(35, 84, 135); font-weight: bold; background-attachment: scroll; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">C<\/strong>ode), detection is a strategic method that seamlessly integrates the security detection mechanism into the life cycle of software development. By considering security control as a code, the organization can automatically deploy, configure and maintain security measures throughout the SIEM operation and maintenance process.<\/p>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Perhaps many people have heard of the concept of DAC, but have not been realized step by step. This article guides you to use Sigma rules, gitlab Ci\/CD and SPLUNK deployment detection, which is the code pipeline.<\/p>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">do not be afraid! If you plan to build a pipeline that detects the code in accordance with the content demonstrated herein, you only need to have a basic understanding of Docker, Gitlab, Git, Python, Sigma Rules, and YAML.<\/p>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Let&#8217;s start!<\/p>\n    <h1 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; display: block;\"><span class=\"prefix\" style=\"display: none;\"><\/span><span class=\"content\" style=\"font-size: 24px; color: rgb(0, 0, 0); line-height: 1.5em; letter-spacing: 0em; text-align: left; font-weight: bold; display: block;\">Related concept<\/span><span class=\"suffix\" style=\"display: none;\"><\/span><\/h1>\n    <h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: unset; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; box-shadow: none; display: block; flex-direction: unset; float: unset; height: auto; justify-content: unset; line-height: 1.5em; overflow-x: unset; overflow-y: unset; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; position: relative; text-align: left; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\"><span class=\"prefix\" style=\"display: none;\"><\/span><span class=\"content\" style=\"font-size: 18px; color: rgb(0, 0, 0); line-height: 1.8em; letter-spacing: 0em; padding-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; border-top-style: none; border-bottom-style: none; border-left-style: solid; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 5px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(35, 84, 135); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: unset; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; box-shadow: none; display: block; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; overflow-x: unset; overflow-y: unset; position: relative; text-align: left; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\"><strong style=\"align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; box-shadow: none; color: rgb(0, 0, 0); display: inline-block; font-size: 22px; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; letter-spacing: 0px; line-height: 1.5em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; overflow-x: unset; overflow-y: unset; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; position: relative; text-align: left; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\">Sigma and Sigmac<\/strong><\/span><span class=\"suffix\" style=\"display: none;\"><\/span><\/h2>\n    <pre class=\"custom\" data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; text-align: left; margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;\"><span style=\"display: block; background: url(https:\/\/files.mdnice.com\/user\/3441\/876cad08-0422-409d-bb5a-08afec5da8ee.svg); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #282c34; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;\"><\/span><code class=\"hljs\" style=\"overflow-x: auto; padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; display: -webkit-box; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\"><span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">title:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">Ingress\/Egress<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\u5b89\u5168<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">Group<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">Modification<\/span><br><span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">id:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">6fb77778-040f-4015-9440-572aa9b6b580<\/span><br><span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">status:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">test<\/span><br><span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">description:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">|<br>&nbsp;&nbsp;&nbsp;&nbsp;Detects&nbsp;when&nbsp;an&nbsp;account&nbsp;makes&nbsp;changes&nbsp;to&nbsp;the&nbsp;ingress&nbsp;or&nbsp;egress&nbsp;rules&nbsp;of&nbsp;a&nbsp;security&nbsp;group.<br>&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;can&nbsp;indicate&nbsp;that&nbsp;an&nbsp;attacker&nbsp;is&nbsp;attempting&nbsp;to&nbsp;open&nbsp;up&nbsp;new&nbsp;attack&nbsp;vectors&nbsp;in&nbsp;the&nbsp;account,&nbsp;that&nbsp;they&nbsp;are&nbsp;trying&nbsp;to&nbsp;exfiltrate&nbsp;data&nbsp;over&nbsp;the&nbsp;network,&nbsp;or&nbsp;that&nbsp;they&nbsp;are&nbsp;trying&nbsp;to&nbsp;allow&nbsp;machines&nbsp;in&nbsp;that&nbsp;VPC\/Subnet&nbsp;to&nbsp;contact&nbsp;a&nbsp;C&amp;C&nbsp;server.<br><\/span><span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">references:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">https:\/\/www.gorillastack.com\/blog\/real-time-events\/important-aws-cloudtrail-security-events-tracking\/<\/span><br><span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">author:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">jamesc-grafana<\/span><br><span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">date:<\/span>&nbsp;<span class=\"hljs-number\" style=\"color: #d19a66; line-height: 26px;\">2024<\/span><span class=\"hljs-number\" style=\"color: #d19a66; line-height: 26px;\">-07<\/span><span class=\"hljs-number\" style=\"color: #d19a66; line-height: 26px;\">-11<\/span><br><span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">tags:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">attack.initial-access<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">attack.t1190<\/span><br><span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">logsource:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">product:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">aws<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">service:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">cloudtrail<\/span><br><span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">detection:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">selection:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">eventSource:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'ec2.amazonaws.com'<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">eventName:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'AuthorizeSecurityGroupEgress'<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'AuthorizeSecurityGroupIngress'<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'RevokeSecurityGroupEgress'<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'RevokeSecurityGroupIngress'<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">condition:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">selection<\/span><br><span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">falsepositives:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">New<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">VPCs<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">and<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">Subnets<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">being<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">setup<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">requiring<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">a<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">different<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">security<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">profile<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">to<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">those<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">already<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">defined<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">A<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">single<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">port<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">being<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">opened<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">for<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">a<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\u5168\u65b0<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">service<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">that<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">is<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">known<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">to<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">be<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">deploying<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">Administrators<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">closing<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">unused<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">ports<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">to<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">reduce<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">the<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">attack<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">surface<\/span><br><span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">level:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">medium<\/span><br><\/code><\/pre>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Sigma rule example\n    ;<\/p>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Sigma is an open source project that defines the standard for developing detection content and unrelated formats that are not related to suppliers. These rules are written in structured YAML format for human and systematic use. For my &#8220;detection is the code&#8221; pipe, I chose to use Sigma to create the detection content. The reason is as follows<\/p>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\"><strong style=\"color: rgb(35, 84, 135); font-weight: bold; background-attachment: scroll; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">Scalability:<\/strong> A SIGMA rule can be deployed to many discrete SIEM, EDR, NDR, XDR, and any &#8220;DR&#8221;.<\/p>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\"><strong style=\"color: rgb(35, 84, 135); font-weight: bold; background-attachment: scroll; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">Shared:<\/strong> sigma rules can easily share with other organizations or receive from other organizations.<\/p>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\"><strong style=\"color: rgb(35, 84, 135); font-weight: bold; background-attachment: scroll; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">Simple:<\/strong> threat detection analysts only need to master the standard for creating test content.<\/p>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">The SIGMA project includes Sigmac, which is a powerful Python command line tool that can use &#8220;back -end&#8221; to convert Sigma rules for controls such as SPLUNK, DEVO, ELK, and CrowDStrike. Create a custom back end for almost any detection control of detection logic.<\/p>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">In the pipeline of this article, we will use Sigmac to convert Sigma rules into Splunk -friendly SPL corresponding items.<\/p>\n    <h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: unset; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; box-shadow: none; display: block; flex-direction: unset; float: unset; height: auto; justify-content: unset; line-height: 1.5em; overflow-x: unset; overflow-y: unset; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; position: relative; text-align: left; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\"><span class=\"prefix\" style=\"display: none;\"><\/span><span class=\"content\" style=\"font-size: 18px; color: rgb(0, 0, 0); line-height: 1.8em; letter-spacing: 0em; padding-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; border-top-style: none; border-bottom-style: none; border-left-style: solid; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 5px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(35, 84, 135); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: unset; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; box-shadow: none; display: block; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; overflow-x: unset; overflow-y: unset; position: relative; text-align: left; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\"><strong style=\"align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; box-shadow: none; color: rgb(0, 0, 0); display: inline-block; font-size: 22px; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; letter-spacing: 0px; line-height: 1.5em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; overflow-x: unset; overflow-y: unset; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; position: relative; text-align: left; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\">Pipe infrastructure<\/strong><\/span><span class=\"suffix\" style=\"display: none;\"><\/span><\/h2>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">In order to build a pipeline, we will configure the following three Docker containers and a Docker network called &#8220;DACNET&#8221; to provide version control, CI\/CD, SIEM infrastructure, and connections between them:<\/p>\n    <ol data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"list-style-type: decimal; margin-top: 8px; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 25px; padding-right: 0px; color: rgb(0, 0, 0);\">\n    <li><section style=\"margin-top: 5px; margin-bottom: 5px; color: rgb(89, 89, 89); font-size: 14px; line-height: 1.8em; letter-spacing: 0em; text-align: left; font-weight: normal;\"><p style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\"><strong style=\"color: rgb(35, 84, 135); font-weight: bold; background-attachment: scroll; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">gitlab<\/strong>: Gitlab community vector. I will use it as VCS to detect content and supervise the CI\/CD pipeline.<\/p>\n    <\/section><\/li><li><section style=\"margin-top: 5px; margin-bottom: 5px; color: rgb(89, 89, 89); font-size: 14px; line-height: 1.8em; letter-spacing: 0em; text-align: left; font-weight: normal;\"><p style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\"><strong style=\"color: rgb(35, 84, 135); font-weight: bold; background-attachment: scroll; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">gitlab-runner<\/strong>: Gitlab operator container for running CI\/CD pipelines. This will be used to use additional Docker containers to build and deploy detection content.<\/p>\n    <\/section><\/li><li><section style=\"margin-top: 5px; margin-bottom: 5px; color: rgb(89, 89, 89); font-size: 14px; line-height: 1.8em; letter-spacing: 0em; text-align: left; font-weight: normal;\"><p style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\"><strong style=\"color: rgb(35, 84, 135); font-weight: bold; background-attachment: scroll; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">splunk<\/strong>: SPLUNK search head and indexer, installed the Splunk Botsv3 data set at runtime. This will be used as SIEM. I will use the BOTSV3 dataset to demonstrate the creation and data source configuration of the SIGMA rule.<\/p>\n    <\/section><\/li><\/ol>\n    <h1 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; display: block;\"><span class=\"prefix\" style=\"display: none;\"><\/span><span class=\"content\" style=\"font-size: 24px; color: rgb(0, 0, 0); line-height: 1.5em; letter-spacing: 0em; text-align: left; font-weight: bold; display: block;\">Construction and configuration<\/span><span class=\"suffix\" style=\"display: none;\"><\/span><\/h1>\n    <h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: unset; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; box-shadow: none; display: block; flex-direction: unset; float: unset; height: auto; justify-content: unset; line-height: 1.5em; overflow-x: unset; overflow-y: unset; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; position: relative; text-align: left; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\"><span class=\"prefix\" style=\"display: none;\"><\/span><span class=\"content\" style=\"font-size: 18px; color: rgb(0, 0, 0); line-height: 1.8em; letter-spacing: 0em; padding-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; border-top-style: none; border-bottom-style: none; border-left-style: solid; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 5px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(35, 84, 135); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: unset; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; box-shadow: none; display: block; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; overflow-x: unset; overflow-y: unset; position: relative; text-align: left; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\"><strong style=\"align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; box-shadow: none; color: rgb(0, 0, 0); display: inline-block; font-size: 22px; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; letter-spacing: 0px; line-height: 1.5em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; overflow-x: unset; overflow-y: unset; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; position: relative; text-align: left; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\">Docker<\/strong><\/span><span class=\"suffix\" style=\"display: none;\"><\/span><\/h2>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">I made the following docker-compose.yml file to help me use Docker Compose to dynamically build infrastructure:<\/p>\n    <pre class=\"custom\" data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; text-align: left; margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;\"><span style=\"display: block; background: url(https:\/\/files.mdnice.com\/user\/3441\/876cad08-0422-409d-bb5a-08afec5da8ee.svg); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #282c34; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;\"><\/span><code class=\"hljs\" style=\"overflow-x: auto; padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; display: -webkit-box; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\"><span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">version:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'3'<\/span><br><br><span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">networks:<\/span><br>&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">dacnet:<\/span>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">external:<\/span>&nbsp;<span class=\"hljs-literal\" style=\"color: #56b6c2; line-height: 26px;\">true<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">name:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">dacnet<\/span><br><br><span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">services:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">gitlab:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">networks:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">dacnet:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">aliases:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">gitlab<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">ports:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'443:443'<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'80:80'<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'222:22'<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">hostname:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">gitlab<\/span>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">environment:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">GITLAB_OMNIBUS_CONFIG:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">|<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;external_url&nbsp;'http:\/\/gitlab'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gitlab_rails['initial_root_password']='$DEFAULT_PASSWORD'<br><\/span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">container_name:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">gitlab-dac<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">image:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'gitlab\/gitlab-ce:latest'<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">gitlab-runner:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">networks:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">dacnet:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">aliases:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">gitlab-runner<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">ports:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'81:80'<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">hostname:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">gitlab-runner<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">container_name:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">gitlab-runner-dac<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">restart:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">always<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">volumes:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'\/srv\/gitlab-runner\/config:\/etc\/gitlab-runner'<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'\/var\/run\/docker.sock:\/var\/run\/docker.sock'<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">image:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'gitlab\/gitlab-runner:latest'<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">splunk:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">networks:<\/span>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">dacnet:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">aliases:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">splunk<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">ports:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'8000:8000'<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'8089:8089'<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">hostname:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">splunk<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">container_name:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">splunk-dac<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">environment:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">SPLUNK_START_ARGS=--accept-license<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">SPLUNK_PASSWORD=$DEFAULT_PASSWORD<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">SPLUNK_APPS_URL=https:\/\/botsdataset.s3.amazonaws.com\/botsv3\/botsv3_data_set.tgz<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">container_name:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">splunk-dac<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">image:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'splunk\/splunk:latest'<\/span><br><\/code><\/pre>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">To deploy it with docker-compose.yml file, first create a.env file under the current path<\/p>\n    <pre class=\"custom\" data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; text-align: left; margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;\"><span style=\"display: block; background: url(https:\/\/files.mdnice.com\/user\/3441\/876cad08-0422-409d-bb5a-08afec5da8ee.svg); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #282c34; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;\"><\/span><code class=\"hljs\" style=\"overflow-x: auto; padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; display: -webkit-box; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">DEFAULT_PASSWORD=****&nbsp;&nbsp;****&nbsp;&nbsp;****&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u8bbe\u7f6egitlab\u548csplunk\u521d\u59cb\u5bc6\u7801<\/span><br>EXTERNAL_URL=http:\/\/192.168.1.1&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">#\u4fee\u6539ip\u5730\u5740\u4e3a\u5bbf\u4e3b\u673a\u5185\u7f51ip<\/span><br><\/code><\/pre>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">After the creation of .env files, run Docker Network Create -Driver Bridge Dacnet to create a DACNET network<\/p>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Run the Docker Compose Up -D and wait for the image to draw the creation container.<\/p>\n    <figure data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; display: flex; flex-direction: column; justify-content: center; align-items: center;\"><img decoding=\"async\" src=\"https:\/\/files.mdnice.com\/user\/72255\/f2e6d0a1-64b4-4287-9c0e-6a9c39775f1f.png\" alt style=\"display: block; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; max-width: 100%; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 8px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; object-fit: fill; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px;\"><\/figure>\n    <h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: unset; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; box-shadow: none; display: block; flex-direction: unset; float: unset; height: auto; justify-content: unset; line-height: 1.5em; overflow-x: unset; overflow-y: unset; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; position: relative; text-align: left; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\"><span class=\"prefix\" style=\"display: none;\"><\/span><span class=\"content\" style=\"font-size: 18px; color: rgb(0, 0, 0); line-height: 1.8em; letter-spacing: 0em; padding-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; border-top-style: none; border-bottom-style: none; border-left-style: solid; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 5px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(35, 84, 135); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: unset; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; box-shadow: none; display: block; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; overflow-x: unset; overflow-y: unset; position: relative; text-align: left; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\"><strong style=\"align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; box-shadow: none; color: rgb(0, 0, 0); display: inline-block; font-size: 22px; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; letter-spacing: 0px; line-height: 1.5em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; overflow-x: unset; overflow-y: unset; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; position: relative; text-align: left; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\">Gitlab runner<\/strong><\/span><span class=\"suffix\" style=\"display: none;\"><\/span><\/h2>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">The Gitlab running program needs to be registered in the Gitlab CE before it can be used in the CI\/CD pipeline. In Gitlab UI, create Runner, TAG can be set to docker<\/p>\n    <figure data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; display: flex; flex-direction: column; justify-content: center; align-items: center;\"><img decoding=\"async\" src=\"https:\/\/files.mdnice.com\/user\/72255\/e65af2bf-9e93-4dfb-b57d-6cff34af258f.png\" alt style=\"display: block; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; max-width: 100%; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 8px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; object-fit: fill; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px;\"><\/figure>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Use the page steps to use Docker EXEC-IT Gitlab-Runner Bash into Gitlab-Runner-DAC container<\/p>\n    <figure data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; display: flex; flex-direction: column; justify-content: center; align-items: center;\"><img decoding=\"async\" src=\"https:\/\/files.mdnice.com\/user\/72255\/76d5b6df-b0fb-4a24-b27f-e703ae1252aa.png\" alt style=\"display: block; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; max-width: 100%; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 8px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; object-fit: fill; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px;\"><\/figure>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">After the container registration is complete<\/p>\n    <figure data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; display: flex; flex-direction: column; justify-content: center; align-items: center;\"><img decoding=\"async\" src=\"https:\/\/files.mdnice.com\/user\/72255\/8fea5e1c-bd44-4673-bfca-7e6e4d0517a2.png\" alt style=\"display: block; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; max-width: 100%; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 8px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; object-fit: fill; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px;\"><\/figure>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Gitlab configuration\n    Turn on Github Import for it to then import the project from github<\/p>\n    <figure data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; display: flex; flex-direction: column; justify-content: center; align-items: center;\"><img decoding=\"async\" src=\"https:\/\/files.mdnice.com\/user\/72255\/a4655cc2-86d0-40b8-942e-35e46b9e4637.png\" alt style=\"display: block; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; max-width: 100%; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 8px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; object-fit: fill; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px;\"><\/figure>\n    <h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: unset; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; box-shadow: none; display: block; flex-direction: unset; float: unset; height: auto; justify-content: unset; line-height: 1.5em; overflow-x: unset; overflow-y: unset; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; position: relative; text-align: left; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\"><span class=\"prefix\" style=\"display: none;\"><\/span><span class=\"content\" style=\"font-size: 18px; color: rgb(0, 0, 0); line-height: 1.8em; letter-spacing: 0em; padding-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; border-top-style: none; border-bottom-style: none; border-left-style: solid; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 5px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(35, 84, 135); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: unset; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; box-shadow: none; display: block; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; overflow-x: unset; overflow-y: unset; position: relative; text-align: left; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\"><strong style=\"align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; box-shadow: none; color: rgb(0, 0, 0); display: inline-block; font-size: 22px; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; letter-spacing: 0px; line-height: 1.5em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; overflow-x: unset; overflow-y: unset; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; position: relative; text-align: left; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\">Version control<\/strong><\/span><span class=\"suffix\" style=\"display: none;\"><\/span><\/h2>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Fork https:\/\/github.com\/infosecb\/detection-as-code This project to personal Github, import the project through Personal Access Token\n    The project is the basis for the detection content CI\/CD pipeline and VCS. The following is the rapid decomposition of the structure of the project:<\/p>\n    <figure data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; display: flex; flex-direction: column; justify-content: center; align-items: center;\"><img decoding=\"async\" src=\"https:\/\/files.mdnice.com\/user\/72255\/eb3eba4b-f4f1-4ef4-8451-f6bd5deccc42.png\" alt style=\"display: block; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; max-width: 100%; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 8px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; object-fit: fill; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px;\"><\/figure>\n    <ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"list-style-type: circle; margin-top: 8px; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 25px; padding-right: 0px; color: rgb(0, 0, 0);\">\n    <li><section style=\"margin-top: 5px; margin-bottom: 5px; color: rgb(89, 89, 89); font-size: 14px; line-height: 1.8em; letter-spacing: 0em; text-align: left; font-weight: normal;\">\/TA-DAC: Includes the core template file required when constructing and packing Splunk technology additional components (TA). In this example, I will build a TA called TA-DAC.<\/section><\/li><li><section style=\"margin-top: 5px; margin-bottom: 5px; color: rgb(89, 89, 89); font-size: 14px; line-height: 1.8em; letter-spacing: 0em; text-align: left; font-weight: normal;\">\/Config: Contains Sigma data source configuration and mapping files. These files establish the relationship between Sigma data source and detection control data sources. In this example, I created a mapping configuration called &#8220;Splunk-Dac.yml&#8221;, which mapped the Botsv3 Powershell log index, source type, and field mapping to the appropriate Sigma data source.<\/section><\/li><li><section style=\"margin-top: 5px; margin-bottom: 5px; color: rgb(89, 89, 89); font-size: 14px; line-height: 1.8em; letter-spacing: 0em; text-align: left; font-weight: normal;\">\/Rules: Includes the SIGMA rules stored in the .yml format. The threat detection team can create, update and depreciate the inspection content here.<\/section><\/li><li><section style=\"margin-top: 5px; margin-bottom: 5px; color: rgb(89, 89, 89); font-size: 14px; line-height: 1.8em; letter-spacing: 0em; text-align: left; font-weight: normal;\">\/scripts: Three scripts containing CI\/CD pipelines used to build and deploy detection content. I will study these scripts in the next section.<\/section><\/li><li><section style=\"margin-top: 5px; margin-bottom: 5px; color: rgb(89, 89, 89); font-size: 14px; line-height: 1.8em; letter-spacing: 0em; text-align: left; font-weight: normal;\">.gitLab-Ci.yml: Gitlab Ci\/CD configuration file, instructing how the Gitlab running program builds and deploys detection content. I will also introduce the file in detail in the next section.\n    Everything else: PIPENV\/PIPENV.LOCK files are used by PIPENV to install the Python package and its dependencies required in CI\/CD operations. The docker-compose.yml file contains the same code I shared in the pipe architecture part above. Readme.md files include the title and basic description of the GitLab project, as well as. Gitignore told Git to ignore which files\/folders to be ignored during the local development.<\/section><\/li><\/ul>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Gitlab CI and scripts\n    The Gitlab CI provides an environment for construction, testing and deployment of any type of software. To create a CI\/CD pipeline in Gitlab, the .gitLab-Ci.yml configuration file must be created in the project. This is the configuration I created. I explained this in the interpretation of the interpretation:<\/p>\n    <pre class=\"custom\" data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; text-align: left; margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;\"><span style=\"display: block; background: url(https:\/\/files.mdnice.com\/user\/3441\/876cad08-0422-409d-bb5a-08afec5da8ee.svg); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #282c34; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;\"><\/span><code class=\"hljs\" style=\"overflow-x: auto; padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; display: -webkit-box; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\"><span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;Define&nbsp;two&nbsp;seperate&nbsp;jobs&nbsp;for&nbsp;CI\/CD&nbsp;pipeline.<\/span><br><span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">stages:<\/span><br>&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;The&nbsp;build&nbsp;job&nbsp;runs&nbsp;anytime&nbsp;a&nbsp;user&nbsp;commits&nbsp;code<\/span><br>&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">build<\/span><br>&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;The&nbsp;release&nbsp;job&nbsp;only&nbsp;runs&nbsp;when&nbsp;the&nbsp;main&nbsp;branch&nbsp;is&nbsp;tagged&nbsp;with&nbsp;a&nbsp;version<\/span><br>&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">release<\/span><br>&nbsp;&nbsp;<br><span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">build:<\/span><br>&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;Sigmac&nbsp;requires&nbsp;Python&nbsp;3.8,&nbsp;specify&nbsp;the&nbsp;appropriate&nbsp;Docker&nbsp;image<\/span><br>&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">image:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">python:3.8<\/span><br>&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;Identify&nbsp;build&nbsp;stage<\/span><br>&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">stage:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">build<\/span><br>&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;Install&nbsp;Pipenv,&nbsp;Python&nbsp;dependencies&nbsp;and&nbsp;the&nbsp;Splunk&nbsp;Packaging&nbsp;toolkit.<\/span><br>&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">before_script:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">pip<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">install<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">pipenv<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">pipenv<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">install<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">wget<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">https:\/\/download.splunk.com\/misc\/packaging-toolkit\/splunk-packaging-toolkit-1.0.1.tar.gz<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">pipenv<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">install<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">splunk-packaging-toolkit-1.0.1.tar.gz<\/span><br>&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">script:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;Run&nbsp;Sigmac&nbsp;against&nbsp;all&nbsp;rules&nbsp;in&nbsp;the&nbsp;\/rules&nbsp;folder&nbsp;that&nbsp;have&nbsp;been&nbsp;set&nbsp;to&nbsp;status=stable.&nbsp;<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;Outputs&nbsp;to&nbsp;the&nbsp;out.yaml&nbsp;file&nbsp;with&nbsp;the&nbsp;resulting&nbsp;search&nbsp;logic&nbsp;and&nbsp;a&nbsp;few&nbsp;Sigma&nbsp;fields.<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">pipenv<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">run<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">sigmac<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">--filter<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'status=stable'<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">--target<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">splunk<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">--config<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">config\/splunk-dac.yml<\/span>&nbsp;&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">--output-format<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">yaml<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">--output<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">out.yaml<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">--output-fields<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">title,id,status,author,tags<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">--recurse<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">rules\/<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;Run&nbsp;script&nbsp;that&nbsp;converts&nbsp;the&nbsp;Sigmac&nbsp;produced&nbsp;.yml&nbsp;to&nbsp;Splunk&nbsp;saved&nbsp;search&nbsp;stanzas&nbsp;in&nbsp;savedsearch.conf.<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">pipenv<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">run<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">python<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">scripts\/convert_yml_to_search.py<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;Copies&nbsp;the&nbsp;savedsearch.conf&nbsp;to&nbsp;the&nbsp;appropriate&nbsp;Splunk&nbsp;TA&nbsp;folder<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">cp<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">savedsearches.conf<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">TA-dac\/default<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;Sets&nbsp;the&nbsp;TA&nbsp;version&nbsp;based&nbsp;on&nbsp;either&nbsp;tag&nbsp;version&nbsp;number&nbsp;or&nbsp;\"0.0.1\"&nbsp;if&nbsp;run&nbsp;by&nbsp;an&nbsp;untagged&nbsp;Git&nbsp;commit.<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">pipenv<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">run<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">python<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">scripts\/set_version.py<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">--file<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"TA-dac\/default\/app.conf\"<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">--version<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"${CI_COMMIT_TAG}\"<\/span>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;Runs&nbsp;the&nbsp;splunk-sdk&nbsp;slim&nbsp;utility&nbsp;to&nbsp;package&nbsp;the&nbsp;Splunk&nbsp;TA.<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">pipenv<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">run<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">slim<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">package<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">TA-dac<\/span><br>&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">artifacts:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;Specify&nbsp;the&nbsp;output&nbsp;files&nbsp;as&nbsp;artifacts&nbsp;that&nbsp;can&nbsp;be&nbsp;retrieved&nbsp;in&nbsp;release&nbsp;job<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;or&nbsp;downloaded&nbsp;via&nbsp;the&nbsp;Gitlab&nbsp;UI<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">paths:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">out.yaml<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">savedsearches.conf<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'TA-dac-*.tar.gz'<\/span><br>&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">tags:<\/span>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;Tag&nbsp;job&nbsp;as&nbsp;\"docker\"&nbsp;to&nbsp;call&nbsp;the&nbsp;Docker&nbsp;Gitlab&nbsp;runner<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">docker<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<br><span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">release:<\/span><br>&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;Run&nbsp;on&nbsp;latest&nbsp;python&nbsp;Docker&nbsp;image<\/span><br>&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">image:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">python:latest<\/span><br>&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;Identify&nbsp;as&nbsp;release&nbsp;stage<\/span><br>&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">stage:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">release<\/span><br>&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">before_script:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;Install&nbsp;the&nbsp;Python&nbsp;splunk-sdk&nbsp;library&nbsp;for&nbsp;use&nbsp;by&nbsp;deploy_splunk_package.py&nbsp;script<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">pip<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">install<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">splunk-sdk<\/span><br>&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">script:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;Upload&nbsp;the&nbsp;TA&nbsp;to&nbsp;Gitlab&nbsp;packages<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'curl&nbsp;--header&nbsp;\"JOB-TOKEN:&nbsp;$CI_JOB_TOKEN\"&nbsp;--upload-file&nbsp;TA-dac-${CI_COMMIT_TAG}.tar.gz&nbsp;\"${CI_API_V4_URL}\/projects\/${CI_PROJECT_ID}\/packages\/generic\/TA-dac\/${CI_COMMIT_TAG}\/TA-dac-${CI_COMMIT_TAG}.tar.gz\"'<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;Run&nbsp;the&nbsp;deploy_splunk_package.py&nbsp;to&nbsp;install&nbsp;the&nbsp;new&nbsp;TA-dac&nbsp;TA<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">python<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">scripts\/deploy_splunk_package.py<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">--url<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"${CI_API_V4_URL}\/projects\/${CI_PROJECT_ID}\/packages\/generic\/TA-dac\/${CI_COMMIT_TAG}\/TA-dac-${CI_COMMIT_TAG}.tar.gz\"<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">--user<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"$ENV_USERNAME\"<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">--password<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"$ENV_PASSWORD\"<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">--host<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"$ENV_HOST\"<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">--port<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">$ENV_PORT<\/span><br>&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">rules:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;Restrict&nbsp;this&nbsp;job&nbsp;to&nbsp;only&nbsp;run&nbsp;when&nbsp;the&nbsp;main&nbsp;branch&nbsp;is&nbsp;tagged<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">if:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'$CI_COMMIT_BRANCH&nbsp;==&nbsp;\"main\"&nbsp;&amp;&amp;&nbsp;$CI_COMMIT_TAG'<\/span><br>&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">tags:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-comment\" style=\"color: #5c6370; font-style: italic; line-height: 26px;\">###&nbsp;Tag&nbsp;job&nbsp;as&nbsp;\"docker\"&nbsp;to&nbsp;call&nbsp;the&nbsp;Docker&nbsp;Gitlab&nbsp;runner<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">docker<\/span><br><\/code><\/pre>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Build a script\n    SIGMAC converts the SIGMA rule logic with Splunk Spl query and outputs an Out.yaml file, which contains generated query and several other fields we will use in Splunk TA.<\/p>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Then, Convert_yml_TO_SEARCH.PY converted the sigmac out.yaml file into a search section saved by Splunk and output the SAVINGSEARCHES.CONF file. In this example, the saved search configuration is to generate the built -in &#8220;alert&#8221; of Splunk, but its function is very limited. The search configuration that can be easily adjusted can be easily adjusted to create a significant event of the SPLUNK ES or call an event in the downstream systems such as Soar via API.<\/p>\n    <pre class=\"custom\" data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; text-align: left; margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;\"><span style=\"display: block; background: url(https:\/\/files.mdnice.com\/user\/3441\/876cad08-0422-409d-bb5a-08afec5da8ee.svg); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #282c34; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;\"><\/span><code class=\"hljs\" style=\"overflow-x: auto; padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; display: -webkit-box; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\"><span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">import<\/span>&nbsp;yaml<br><span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">import<\/span>&nbsp;os<br><span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">import<\/span>&nbsp;glob<br><span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">from<\/span>&nbsp;jinja2&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">import<\/span>&nbsp;Template<br><br><br>ss_template&nbsp;=&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"\"\"<br>[{{&nbsp;title&nbsp;}}]<br>alert.expires&nbsp;=&nbsp;5m<br>alert.suppress&nbsp;=&nbsp;1<br>alert.suppress.period&nbsp;=&nbsp;60m<br>alert.track&nbsp;=&nbsp;1<br>counttype&nbsp;=&nbsp;number&nbsp;of&nbsp;events<br>cron_schedule&nbsp;=&nbsp;{{&nbsp;cron&nbsp;}}<br>description&nbsp;=&nbsp;Detects&nbsp;a&nbsp;second&nbsp;malicious&nbsp;IP.<br>enableSched&nbsp;=&nbsp;1<br>quantity&nbsp;=&nbsp;0<br>relation&nbsp;=&nbsp;greater&nbsp;than<br>search&nbsp;=&nbsp;{{&nbsp;search&nbsp;}}<br><br>&nbsp;\"\"\"<\/span><br><br><br><span class=\"hljs-function\" style=\"line-height: 26px;\"><span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">def<\/span>&nbsp;<span class=\"hljs-title\" style=\"color: #61aeee; line-height: 26px;\">priority_to_cron<\/span><span class=\"hljs-params\" style=\"line-height: 26px;\">(priority)<\/span>:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">if<\/span>&nbsp;priority&nbsp;==&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"low\"<\/span>:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">return<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"0&nbsp;*\/4&nbsp;*&nbsp;*&nbsp;*\"<\/span>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">elif<\/span>&nbsp;priority&nbsp;==&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"high\"<\/span>:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">return<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"*\/15&nbsp;*&nbsp;*&nbsp;*&nbsp;*\"<\/span>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">elif<\/span>&nbsp;priority&nbsp;==&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"critical\"<\/span>:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">return<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"*\/5&nbsp;*&nbsp;*&nbsp;*&nbsp;*\"<\/span>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">else<\/span>:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">return<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"0&nbsp;*&nbsp;*&nbsp;*&nbsp;*\"<\/span>&nbsp;<br><br><br>t&nbsp;=&nbsp;Template(ss_template)<br><br>savedsearch_content&nbsp;=&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"\"<\/span>&nbsp;<br><br>rules&nbsp;=&nbsp;yaml.safe_load(open(<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"out.yaml\"<\/span>))<br><span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">for<\/span>&nbsp;rule&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">in<\/span>&nbsp;rules:<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">if<\/span>&nbsp;rule[<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"status\"<\/span>]&nbsp;==&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"stable\"<\/span>:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"Creating&nbsp;alert&nbsp;for&nbsp;\"<\/span>&nbsp;+&nbsp;rule[<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"title\"<\/span>])<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;savedsearch_content&nbsp;+=&nbsp;t.render(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;title=rule[<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"title\"<\/span>],&nbsp;search=rule[<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"rule\"<\/span>][<span class=\"hljs-number\" style=\"color: #d19a66; line-height: 26px;\">0<\/span>],&nbsp;cron=priority_to_cron(<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"normal\"<\/span>)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">else<\/span>:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'The&nbsp;rule&nbsp;\"'<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;rule[<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"title\"<\/span>]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">'\"&nbsp;status&nbsp;is&nbsp;set&nbsp;to&nbsp;'<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;rule[<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"status\"<\/span>]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;+&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\",&nbsp;skipping.\"<\/span>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;)<br><br>f&nbsp;=&nbsp;open(<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"savedsearches.conf\"<\/span>,&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"w\"<\/span>)<br>f.write(savedsearch_content)<br>f.close()<br><\/code><\/pre>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Set_version.py is used to update the version number contained in the App.conf Splunk TA file.<\/p>\n    <pre class=\"custom\" data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; text-align: left; margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;\"><span style=\"display: block; background: url(https:\/\/files.mdnice.com\/user\/3441\/876cad08-0422-409d-bb5a-08afec5da8ee.svg); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #282c34; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;\"><\/span><code class=\"hljs\" style=\"overflow-x: auto; padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; display: -webkit-box; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\"><span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">import<\/span>&nbsp;argparse<br><span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">import<\/span>&nbsp;re<br><br><br><span class=\"hljs-function\" style=\"line-height: 26px;\"><span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">def<\/span>&nbsp;<span class=\"hljs-title\" style=\"color: #61aeee; line-height: 26px;\">set_version<\/span><span class=\"hljs-params\" style=\"line-height: 26px;\">(conf_file,&nbsp;version)<\/span>:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">if<\/span>&nbsp;version&nbsp;==&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"\"<\/span>:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;version&nbsp;=&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"0.0.1\"<\/span>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">elif<\/span>&nbsp;re.match(<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\".*(\\d)+\\.(\\d)+\\.(\\d)+.*\"<\/span>,&nbsp;version):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;version&nbsp;=&nbsp;(re.search(<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"(\\d)+\\.(\\d)+\\.(\\d)+\"<\/span>,&nbsp;version)).group()<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">else<\/span>:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"An&nbsp;invalid&nbsp;version&nbsp;number&nbsp;was&nbsp;tagged&nbsp;\"<\/span>&nbsp;+&nbsp;version)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit(<span class=\"hljs-number\" style=\"color: #d19a66; line-height: 26px;\">1<\/span>)<br>&nbsp;&nbsp;&nbsp;&nbsp;print(<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"Updating&nbsp;app.conf&nbsp;file&nbsp;with&nbsp;version&nbsp;number:&nbsp;\"<\/span>&nbsp;+&nbsp;version)<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">with<\/span>&nbsp;open(conf_file,&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"r\"<\/span>)&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">as<\/span>&nbsp;file:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lines&nbsp;=&nbsp;file.readlines()<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">with<\/span>&nbsp;open(conf_file,&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"w\"<\/span>)&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">as<\/span>&nbsp;file:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">for<\/span>&nbsp;line&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">in<\/span>&nbsp;lines:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;file.write(re.sub(r&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"VERSION\"<\/span>,&nbsp;version,&nbsp;line))<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">with<\/span>&nbsp;open(<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\".env\"<\/span>,&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"w\"<\/span>)&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">as<\/span>&nbsp;env_file:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;env_file.write(<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">f'export&nbsp;VERSION=\"<span class=\"hljs-subst\" style=\"color: #e06c75; line-height: 26px;\">{version}<\/span>\"'<\/span>)<br>&nbsp;&nbsp;&nbsp;&nbsp;file.close()<br><br><br><span class=\"hljs-function\" style=\"line-height: 26px;\"><span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">def<\/span>&nbsp;<span class=\"hljs-title\" style=\"color: #61aeee; line-height: 26px;\">main<\/span><span class=\"hljs-params\" style=\"line-height: 26px;\">()<\/span>:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;parser&nbsp;=&nbsp;argparse.ArgumentParser()<br>&nbsp;&nbsp;&nbsp;&nbsp;parser.add_argument(<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"--file\"<\/span>,&nbsp;type=str)<br>&nbsp;&nbsp;&nbsp;&nbsp;parser.add_argument(<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"--version\"<\/span>,&nbsp;type=str)<br>&nbsp;&nbsp;&nbsp;&nbsp;args&nbsp;=&nbsp;parser.parse_args()<br>&nbsp;&nbsp;&nbsp;&nbsp;set_version(args.file,&nbsp;args.version)<br><br><br><span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">if<\/span>&nbsp;__name__&nbsp;==&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"__main__\"<\/span>:<br>&nbsp;&nbsp;&nbsp;&nbsp;main()<br><\/code><\/pre>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">The SPLUNK-SDK Slim Package command is used to build and generate TA .pkg files.\n    Publish work script\n    Finally, deploy_splunk_package.py script interacts with the Splunk Rest API to upload and install the latest version of TA during the deployment stage of the pipeline.<\/p>\n    <pre class=\"custom\" data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; text-align: left; margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;\"><span style=\"display: block; background: url(https:\/\/files.mdnice.com\/user\/3441\/876cad08-0422-409d-bb5a-08afec5da8ee.svg); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #282c34; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;\"><\/span><code class=\"hljs\" style=\"overflow-x: auto; padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; display: -webkit-box; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\"><span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">from<\/span>&nbsp;logging&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">import<\/span>&nbsp;error<br><span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">import<\/span>&nbsp;splunklib.client&nbsp;<span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">as<\/span>&nbsp;client<br><span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">import<\/span>&nbsp;os<br><span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">import<\/span>&nbsp;argparse<br><br><br><span class=\"hljs-function\" style=\"line-height: 26px;\"><span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">def<\/span>&nbsp;<span class=\"hljs-title\" style=\"color: #61aeee; line-height: 26px;\">upload_ta<\/span><span class=\"hljs-params\" style=\"line-height: 26px;\">(url,&nbsp;user,&nbsp;password,&nbsp;host,&nbsp;port)<\/span>:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;service&nbsp;=&nbsp;client.connect(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;host=host,&nbsp;port=port,&nbsp;username=user,&nbsp;password=password,&nbsp;verify=<span class=\"hljs-literal\" style=\"color: #56b6c2; line-height: 26px;\">False<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;)<br>&nbsp;&nbsp;&nbsp;&nbsp;service.post(path_segment=<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"apps\/local\"<\/span>,&nbsp;filename=<span class=\"hljs-literal\" style=\"color: #56b6c2; line-height: 26px;\">True<\/span>,&nbsp;name=url,&nbsp;update=<span class=\"hljs-literal\" style=\"color: #56b6c2; line-height: 26px;\">True<\/span>)<br>&nbsp;&nbsp;&nbsp;&nbsp;service.logout()<br><br><br><span class=\"hljs-function\" style=\"line-height: 26px;\"><span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">def<\/span>&nbsp;<span class=\"hljs-title\" style=\"color: #61aeee; line-height: 26px;\">main<\/span><span class=\"hljs-params\" style=\"line-height: 26px;\">()<\/span>:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;parser&nbsp;=&nbsp;argparse.ArgumentParser()<br>&nbsp;&nbsp;&nbsp;&nbsp;parser.add_argument(<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"--url\"<\/span>,&nbsp;type=str)<br>&nbsp;&nbsp;&nbsp;&nbsp;parser.add_argument(<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"--user\"<\/span>,&nbsp;type=str)<br>&nbsp;&nbsp;&nbsp;&nbsp;parser.add_argument(<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"--password\"<\/span>,&nbsp;type=str)<br>&nbsp;&nbsp;&nbsp;&nbsp;parser.add_argument(<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"--host\"<\/span>,&nbsp;type=str)<br>&nbsp;&nbsp;&nbsp;&nbsp;parser.add_argument(<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"--port\"<\/span>,&nbsp;type=str)<br>&nbsp;&nbsp;&nbsp;&nbsp;args&nbsp;=&nbsp;parser.parse_args()<br>&nbsp;&nbsp;&nbsp;&nbsp;upload_ta(args.url,&nbsp;args.user,&nbsp;args.password,&nbsp;args.host,&nbsp;args.port)<br><br><br><span class=\"hljs-keyword\" style=\"color: #c678dd; line-height: 26px;\">if<\/span>&nbsp;__name__&nbsp;==&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"__main__\"<\/span>:<br>&nbsp;&nbsp;&nbsp;&nbsp;main()<br><\/code><\/pre>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Detective content creation workflow\n    Before creating a workflow, you need to modify the pipFile<\/p>\n    <pre class=\"custom\" data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; text-align: left; margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;\"><span style=\"display: block; background: url(https:\/\/files.mdnice.com\/user\/3441\/876cad08-0422-409d-bb5a-08afec5da8ee.svg); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #282c34; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;\"><\/span><code class=\"hljs\" style=\"overflow-x: auto; padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; display: -webkit-box; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\"><span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">[[source]]<\/span><br><span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">url<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">=<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"https:\/\/pypi.org\/simple\"<\/span>&nbsp;<br><span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">verify_ssl<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">=<\/span>&nbsp;<span class=\"hljs-literal\" style=\"color: #56b6c2; line-height: 26px;\">true<\/span><br><span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">name<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">=<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"pypi\"<\/span>&nbsp;<br><br><span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">[packages]<\/span><br><span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">sigmatools<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">=<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"0.20\"<\/span>&nbsp;<br>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"ruamel.yaml\"<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">=<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"0.16\"<\/span>&nbsp;<br><span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">jinja2<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">=<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"*\"<\/span>&nbsp;<br><br><span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">[dev-packages]<\/span><br><span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">black<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">=<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"*\"<\/span>&nbsp;<br><br><span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">[requires]<\/span><br><span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">python_version<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">=<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"3.8\"<\/span>&nbsp;<br><br><span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">[pipenv]<\/span><br><span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">allow_prereleases<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">=<\/span>&nbsp;<span class=\"hljs-literal\" style=\"color: #56b6c2; line-height: 26px;\">true<\/span><br><br><\/code><\/pre>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Modify the rules in the .gitLab-Ci.yml.<\/p>\n    <pre class=\"custom\" data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; text-align: left; margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px;\"><span style=\"display: block; background: url(https:\/\/files.mdnice.com\/user\/3441\/876cad08-0422-409d-bb5a-08afec5da8ee.svg); height: 30px; width: 100%; background-size: 40px; background-repeat: no-repeat; background-color: #282c34; margin-bottom: -7px; border-radius: 5px; background-position: 10px 10px;\"><\/span><code class=\"hljs\" style=\"overflow-x: auto; padding: 16px; color: #abb2bf; padding-top: 15px; background: #282c34; border-radius: 5px; display: -webkit-box; font-family: Consolas, Monaco, Menlo, monospace; font-size: 12px;\">&nbsp;&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">rules:<\/span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"hljs-bullet\" style=\"color: #61aeee; line-height: 26px;\">-<\/span>&nbsp;<span class=\"hljs-attr\" style=\"color: #d19a66; line-height: 26px;\">if:<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">$CI_COMMIT_BRANCH<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">==<\/span>&nbsp;<span class=\"hljs-string\" style=\"color: #98c379; line-height: 26px;\">\"main\"<\/span>&nbsp;&nbsp;<br><br><\/code><\/pre>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Threat testing team personnel can now create, review and deploy new content in accordance with simple procedures. In this example, I will run the same examples used in the server -free detection pipe: detect the use of PowerShell coding and hidden commands.<\/p>\n    <h1 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; display: block;\"><span class=\"prefix\" style=\"display: none;\"><\/span><span class=\"content\" style=\"font-size: 24px; color: rgb(0, 0, 0); line-height: 1.5em; letter-spacing: 0em; text-align: left; font-weight: bold; display: block;\">Verify<\/span><span class=\"suffix\" style=\"display: none;\"><\/span><\/h1>\n    <h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: unset; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; box-shadow: none; display: block; flex-direction: unset; float: unset; height: auto; justify-content: unset; line-height: 1.5em; overflow-x: unset; overflow-y: unset; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; position: relative; text-align: left; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\"><span class=\"prefix\" style=\"display: none;\"><\/span><span class=\"content\" style=\"font-size: 18px; color: rgb(0, 0, 0); line-height: 1.8em; letter-spacing: 0em; padding-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; border-top-style: none; border-bottom-style: none; border-left-style: solid; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 5px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(35, 84, 135); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: unset; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; box-shadow: none; display: block; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; overflow-x: unset; overflow-y: unset; position: relative; text-align: left; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\"><strong style=\"align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; box-shadow: none; color: rgb(0, 0, 0); display: inline-block; font-size: 22px; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; letter-spacing: 0px; line-height: 1.5em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; overflow-x: unset; overflow-y: unset; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; position: relative; text-align: left; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\">Run<\/strong><\/span><span class=\"suffix\" style=\"display: none;\"><\/span><\/h2>\n    <ol data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"list-style-type: decimal; margin-top: 8px; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 25px; padding-right: 0px; color: rgb(0, 0, 0);\">\n    <li><section style=\"margin-top: 5px; margin-bottom: 5px; color: rgb(89, 89, 89); font-size: 14px; line-height: 1.8em; letter-spacing: 0em; text-align: left; font-weight: normal;\"><p style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Create a gitlab issue for mergers and associated requests in the &#8220;Detection As Code&#8221; project.<\/p>\n    <\/section><\/li><li><section style=\"margin-top: 5px; margin-bottom: 5px; color: rgb(89, 89, 89); font-size: 14px; line-height: 1.8em; letter-spacing: 0em; text-align: left; font-weight: normal;\"><p style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Create the SIGMA rules on the new branch .yml, and the merger request was marked as &#8220;ready&#8221; after completion. Each time it is submitted to the project, no matter what the branch is submitted, &#8220;build&#8221; operations. If there is a problem with the detection content, the homework will fail and output errors.\n    <img decoding=\"async\" src=\"https:\/\/files.mdnice.com\/user\/72255\/203eeafd-bf25-4abf-a4f3-339cb00994cd.png\" alt style=\"display: block; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; max-width: 100%;\"><\/p>\n    <\/section><\/li><li><section style=\"margin-top: 5px; margin-bottom: 5px; color: rgb(89, 89, 89); font-size: 14px; line-height: 1.8em; letter-spacing: 0em; text-align: left; font-weight: normal;\"><p style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">After the new rules are completed, trigger the BUILD JOB\n    <img decoding=\"async\" src=\"https:\/\/files.mdnice.com\/user\/72255\/ebe40b63-50d3-4d2d-9c6a-f5b3ea4c1ad3.png\" alt style=\"display: block; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; max-width: 100%;\"><\/p>\n    <\/section><\/li><li><section style=\"margin-top: 5px; margin-bottom: 5px; color: rgb(89, 89, 89); font-size: 14px; line-height: 1.8em; letter-spacing: 0em; text-align: left; font-weight: normal;\"><p style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Create a new merger request after the operation of Build Job successfully operated\n    <img decoding=\"async\" src=\"https:\/\/files.mdnice.com\/user\/72255\/f8879e25-b595-4102-a0e4-e4b9b01519a0.png\" alt style=\"display: block; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; max-width: 100%;\"><\/p>\n    <\/section><\/li><li><section style=\"margin-top: 5px; margin-bottom: 5px; color: rgb(89, 89, 89); font-size: 14px; line-height: 1.8em; letter-spacing: 0em; text-align: left; font-weight: normal;\"><p style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">The team members conducted a peer review of the detection content, and then comment and edit them as needed. After the review and consent, it is merged into the main branch.\n    <img decoding=\"async\" src=\"https:\/\/files.mdnice.com\/user\/72255\/bf1b0591-3452-42ea-8339-810114144f15.png\" alt style=\"display: block; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; max-width: 100%;\"><\/p>\n    <\/section><\/li><li><section style=\"margin-top: 5px; margin-bottom: 5px; color: rgb(89, 89, 89); font-size: 14px; line-height: 1.8em; letter-spacing: 0em; text-align: left; font-weight: normal;\"><p style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">The first run of PIPELINE needs to configure the variable when running, namely the Splunk address, password, port, user name. When adding a password, you need to configure Masked to facilitate the mask in the JOB log. The port is the Splunk API port 8089.\n    <img decoding=\"async\" src=\"https:\/\/files.mdnice.com\/user\/72255\/fa811d53-96e9-4a4a-82ed-8ff604c28b00.png\" alt style=\"display: block; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; max-width: 100%;\"><\/p>\n    <\/section><\/li><\/ol>\n    <h2 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: unset; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; box-shadow: none; display: block; flex-direction: unset; float: unset; height: auto; justify-content: unset; line-height: 1.5em; overflow-x: unset; overflow-y: unset; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; position: relative; text-align: left; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\"><span class=\"prefix\" style=\"display: none;\"><\/span><span class=\"content\" style=\"font-size: 18px; color: rgb(0, 0, 0); line-height: 1.8em; letter-spacing: 0em; padding-top: 0px; padding-bottom: 0px; padding-left: 10px; padding-right: 0px; border-top-style: none; border-bottom-style: none; border-left-style: solid; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 5px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(35, 84, 135); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: unset; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; box-shadow: none; display: block; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; overflow-x: unset; overflow-y: unset; position: relative; text-align: left; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\"><strong style=\"align-items: unset; background-attachment: scroll; background-clip: border-box; background-color: transparent; background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-right-width: 1px; border-top-color: rgb(0, 0, 0); border-bottom-color: rgb(0, 0, 0); border-left-color: rgb(0, 0, 0); border-right-color: rgb(0, 0, 0); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; box-shadow: none; color: rgb(0, 0, 0); display: inline-block; font-size: 22px; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; letter-spacing: 0px; line-height: 1.5em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; overflow-x: unset; overflow-y: unset; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; position: relative; text-align: left; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\">Notice<\/strong><\/span><span class=\"suffix\" style=\"display: none;\"><\/span><\/h2>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">The lack of running variables when running the first runtime will cause the push task to fail.<\/p>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\"><img decoding=\"async\" src=\"https:\/\/files.mdnice.com\/user\/72255\/e9fc0925-53dc-4aec-aad2-2375c0259d36.png\" alt style=\"display: block; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; max-width: 100%;\">\n    Splunk address, password, port, user name configuration reappear the task after completion.<\/p>\n    <figure data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; display: flex; flex-direction: column; justify-content: center; align-items: center;\"><img decoding=\"async\" src=\"https:\/\/files.mdnice.com\/user\/72255\/bd8e76f2-f3f0-4d60-bdb8-e6abc8d7b0e4.png\" alt style=\"display: block; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; max-width: 100%; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 8px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; object-fit: fill; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px;\"><\/figure>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">After running successfully, log in to Splunk for viewing. You can see that Splunk has created a new alarm rule.<\/p>\n    <figure data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; display: flex; flex-direction: column; justify-content: center; align-items: center;\"><img decoding=\"async\" src=\"https:\/\/files.mdnice.com\/user\/72255\/e68f8bf9-fc74-4b71-86e4-3ba76d2916bd.png\" alt style=\"display: block; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; max-width: 100%; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 8px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; object-fit: fill; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px;\"><\/figure>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Open in the search, you can see the log content that has matched the detection rules.<\/p>\n    <figure data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 10px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; display: flex; flex-direction: column; justify-content: center; align-items: center;\"><img decoding=\"async\" src=\"https:\/\/files.mdnice.com\/user\/72255\/869ac32f-efed-4e91-83d3-0066d22800c4.png\" alt style=\"display: block; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; max-width: 100%; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 8px; border-top-right-radius: 8px; border-bottom-right-radius: 8px; border-bottom-left-radius: 8px; object-fit: fill; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px;\"><\/figure>\n    <h1 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; display: block;\"><span class=\"prefix\" style=\"display: none;\"><\/span><span class=\"content\" style=\"font-size: 24px; color: rgb(0, 0, 0); line-height: 1.5em; letter-spacing: 0em; text-align: left; font-weight: bold; display: block;\">Conclusion<\/span><span class=\"suffix\" style=\"display: none;\"><\/span><\/h1>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Although this example pipeline demonstrates the basic functions of the construction and publishing detection content, it still has many shortcomings. Gitlab CI\/CD provides more functions to run effective &#8220;detection is code&#8221; pipeline. You can create some additional pipeline operations for continuous review of testing, document records, and test content:<\/p>\n    <ul data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"list-style-type: circle; margin-top: 8px; margin-bottom: 8px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 25px; padding-right: 0px; color: rgb(0, 0, 0);\">\n    <li><section style=\"margin-top: 5px; margin-bottom: 5px; color: rgb(89, 89, 89); font-size: 14px; line-height: 1.8em; letter-spacing: 0em; text-align: left; font-weight: normal;\"><p style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Automation SIGMA and Splunk TA test: In order to ensure high -quality content and CI\/CD pipelines running smoothly, testing should be created to check the effectiveness of SIGMA rules and SPLUNK TA.<\/p>\n    <\/section><\/li><li><section style=\"margin-top: 5px; margin-bottom: 5px; color: rgb(89, 89, 89); font-size: 14px; line-height: 1.8em; letter-spacing: 0em; text-align: left; font-weight: normal;\"><p style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Automation document: The important part of the detection content document can be included in each SIGMA rule. This creates an opportunity to automatically generate documents in the CI\/CD pipeline by writing the creation script of the .md or .st files.<\/p>\n    <\/section><\/li><li><section style=\"margin-top: 5px; margin-bottom: 5px; color: rgb(89, 89, 89); font-size: 14px; line-height: 1.8em; letter-spacing: 0em; text-align: left; font-weight: normal;\"><p style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\">Continuous review and testing content: Ci\/CD pipes can be created to mark outdated detection content to review the new GitLab problem.<\/p>\n    <\/section><\/li><\/ul>\n    <h1 data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"margin-top: 30px; margin-bottom: 15px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; display: block;\"><span class=\"prefix\" style=\"display: none;\"><\/span><span class=\"content\" style=\"font-size: 24px; color: rgb(0, 0, 0); line-height: 1.5em; letter-spacing: 0em; text-align: left; font-weight: bold; display: block;\">Reference document<\/span><span class=\"suffix\" style=\"display: none;\"><\/span><\/h1>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\"><strong style=\"color: rgb(35, 84, 135); font-weight: bold; background-attachment: scroll; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">Serverless detection pipeline<\/strong>(https:\/\/infoscb.medium.com\/building-a- serverless-detection-platform-in -AWS&#8211;I-Endpoint-DETECTL<\/p>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\"><strong style=\"color: rgb(35, 84, 135); font-weight: bold; background-attachment: scroll; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">Practical detection-as-code<\/strong><\/p>\n    <p data-tool=\"mdnice\u7f16\u8f91\u5668\" style=\"color: rgb(0, 0, 0); font-size: 15px; line-height: 1.8em; letter-spacing: 0.04em; text-align: left; text-indent: 0em; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 8px; padding-bottom: 8px; padding-left: 0px; padding-right: 0px;\"><strong style=\"color: rgb(35, 84, 135); font-weight: bold; background-attachment: scroll; background-clip: border-box; background-color: rgba(0, 0, 0, 0); background-image: none; background-origin: padding-box; background-position-x: 0%; background-position-y: 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; padding-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; border-top-style: none; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-width: 3px; border-bottom-width: 3px; border-left-width: 3px; border-right-width: 3px; border-top-color: rgba(0, 0, 0, 0.4); border-bottom-color: rgba(0, 0, 0, 0.4); border-left-color: rgba(0, 0, 0, 0.4); border-right-color: rgba(0, 0, 0, 0.4); border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px;\">detection-as-code<\/strong>(https:\/\/github.com\/infosecb\/detection- as-code)<\/p>\n    <\/section>","protected":false},"excerpt":{"rendered":"<p>Introduction DAC((Detection As Code), detection is a strategic method that seamlessly integrates the security detection mechanism into the life cycle of software development. By considering security control as a code, the organization can automatically deploy, configure and maintain security measures throughout the SIEM operation and maintenance process. Perhaps many people have heard of the concept of DAC, but have not been realized step by step. This article guides you to use Sigma rules, gitlab Ci\/CD and SPLUNK deployment detection, which is the code pipeline. do not be afraid! If you plan to build a pipeline that detects the code in accordance with the content demonstrated herein, you only need to have a basic understanding of Docker, Gitlab, Git, Python, Sigma&#8230;<\/p>","protected":false},"author":1,"featured_media":520,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[12,9,15,13,11],"class_list":["post-512","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-techniques","tag-dac","tag-siem","tag-sigma","tag-splunk","tag-threat-blog"],"_links":{"self":[{"href":"https:\/\/www.seclink.info\/cn\/wp-json\/wp\/v2\/posts\/512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.seclink.info\/cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.seclink.info\/cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.seclink.info\/cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.seclink.info\/cn\/wp-json\/wp\/v2\/comments?post=512"}],"version-history":[{"count":6,"href":"https:\/\/www.seclink.info\/cn\/wp-json\/wp\/v2\/posts\/512\/revisions"}],"predecessor-version":[{"id":522,"href":"https:\/\/www.seclink.info\/cn\/wp-json\/wp\/v2\/posts\/512\/revisions\/522"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.seclink.info\/cn\/wp-json\/wp\/v2\/media\/520"}],"wp:attachment":[{"href":"https:\/\/www.seclink.info\/cn\/wp-json\/wp\/v2\/media?parent=512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.seclink.info\/cn\/wp-json\/wp\/v2\/categories?post=512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.seclink.info\/cn\/wp-json\/wp\/v2\/tags?post=512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}