GithubHelp home page GithubHelp logo

feifa168 / idsconfig Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 4.52 MB

打包Ids程序,主要拷贝文件,修改文件,执行脚本等,稍作修改可以做成通用的。

Java 97.87% Batchfile 1.35% Shell 0.78%

idsconfig's Introduction

简介

IdsConfig工程用于配置ids程序的部署,支持linux,主要实现以下功能。

  • 拷贝文件,用于安装程序,主要是把snort程序以及依赖的库拷贝到指定的目录。
  • 修改文件
    • 修改rsyslog.conf文件用于指定syslog接收服务器。
    • 修改ld.so.conf用于追加动态库查询路径,因为Linux下不从当前路径查找动态库,所以需要把追加指定的搜索路径。
  • 执行脚本,可扩展,通过创建java进程实现。
    • 启动服务,修改rsyslog.conf文件后要重新启动rsyslog服务。
    • 执行ldconfig,用于重新加载动态库搜索路径。
    • 创建目录,用于存放snort的告警日志。

依赖

  • dom4j+jaxen,用于解析xml
  • commons-io,用于拷贝文件

技术要点

  • 文件NIO,以下几种方式实现,实现了文件拷贝,目录拷贝直接使用commonio库。
    • 使用FileChannel实现
    • 使用AsynchronousFileChannel拷贝文件,耗时反而不如FileChannel,有时间再优化。
      • 使用Future获取结果
      • 设置回调函数获取结果
    • 使用commonio库拷贝文件和目录
  • 创建进程,参数cmds有两种传入方法
    • Runtime.getRuntime().exec(cmds)方式
    • new ProcessBuilder(cmds).start()方式

idsconfig's People

Contributors

feitian168 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.