Skip to content

Commit

Permalink
moving logic to ci to copy analyticstories.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
josehelps committed Jun 17, 2019
1 parent 37d8e4b commit 2ac473b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ jobs:
cd security-content
source venv/bin/activate
python bin/generate.py --path . --output package --storiesv1 --use_case_lib -v
# make a copy of use_case_lib in order to have ES work :-(
cp package/default/use_case_library.conf package/default/analyticstories.conf
- run:
name: update version and build number
command: |
Expand All @@ -98,7 +100,6 @@ jobs:
# update build number and version
sed -i "s/build = .*$/build = $CIRCLE_BUILD_NUM/g" package/default/app.conf
sed -i "s/^version = .*$/version = $CONTENT_VERSION/g" package/default/app.conf
# sed -i "s/\"version\": .*$/ \"version\": \"$CONTENT_VERSION\"/g" package/app.manifest
sed -i "s/version = .*$/version = $CONTENT_VERSION/g" package/default/content-version.conf
tar -czf content-pack-build.tar.gz package/*
- persist_to_workspace:
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
Expand Down
8 changes: 4 additions & 4 deletions bin/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ def write_analytics_story_confv1(stories, detections, investigations, baselines,
def write_use_case_lib_conf(stories, detections, investigations, baselines, OUTPUT_DIR):

# Create conf files from analytics stories files
use_case_lib_path = OUTPUT_DIR + "/default/analyticstories.conf"
use_case_lib_path = OUTPUT_DIR + "/default/use_case_library.conf"
output_file = open(use_case_lib_path, 'w')
output_file.write("#############\n")
output_file.write("# Automatically generated by generator.py in splunk/security-content\n")
Expand Down Expand Up @@ -1101,14 +1101,14 @@ def write_savedsearches_confv1(stories, detections, investigations, baselines, O
# grab arguments
parser = argparse.ArgumentParser(description="generates splunk conf files out of security-content manifests", epilog="""
This tool converts manifests to the source files to be used by products like Splunk Enterprise.
It generates the savesearches.conf, analytic_stories.conf files for ES.""")
It generates the savesearches.conf, analytics_stories.conf files for ES.""")
parser.add_argument("-p", "--path", required=True, help="path to security-content repo")
parser.add_argument("-o", "--output", required=True, help="path to the output directory")
parser.add_argument("-v", "--verbose", required=False, default=False, action='store_true', help="prints verbose output")
parser.add_argument("-sv1", "--storiesv1", required=False, default=True, action='store_true',
help="generates analytic_stories.conf in v1 format")
help="generates analytics_stories.conf in v1 format")
parser.add_argument("-u", "--use_case_lib", required=False, default=True, action='store_true',
help="generates analyticstories.conf for ES Use Case Library")
help="generates use_case_library.conf for ES")

# parse them
args = parser.parse_args()
Expand Down

0 comments on commit 2ac473b

Please sign in to comment.