Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
5384b05
Ensure detections show up in the ES app
linuxdaemon Aug 10, 2023
5ed7858
Update deps to latest to resolve dependabot prs
pyth0n1c May 13, 2024
d38b3de
Update setuptools requirement from ^69.5.1 to >=69.5.1,<71.0.0
dependabot[bot] Jun 12, 2024
0c5e335
changing stanza name
ljstella Jun 13, 2024
6668e9e
Removing file entirely from default init build
ljstella Jun 14, 2024
20c9b57
Cleaning up output order
ljstella Jun 17, 2024
072e0f3
Create branch with better filter macro-checking.
pyth0n1c Jun 17, 2024
74b829e
Merge branch 'main' into improve_filter_macro_checking
pyth0n1c Jun 17, 2024
039cf01
Relax need for filter macro to occur at VERY END of a search. It stil…
pyth0n1c Jun 17, 2024
5cf7f5b
Downgrade to python3.9 as a requirement.
pyth0n1c Jun 17, 2024
cbaa222
Add verbose comments as to
pyth0n1c Jun 18, 2024
9db2b46
Add option to enable/disable
pyth0n1c Jun 18, 2024
a16e88a
better description on error when
pyth0n1c Jun 18, 2024
eb9e2f4
Merge pull request #166 from splunk/add_verbose_error_option
pyth0n1c Jun 18, 2024
28219ea
Merge pull request #164 from splunk/update-new-output
pyth0n1c Jun 18, 2024
abe2246
Merge branch 'update_deps_4.1' into dependabot/pip/setuptools-gte-69.…
pyth0n1c Jun 19, 2024
0a05958
Force Python3.11+ as a system requirement
pyth0n1c Jun 19, 2024
9bb4575
remove 3.9 and 3.10 from test workflow
pyth0n1c Jun 19, 2024
bfe98c9
Merge pull request #163 from splunk/bias_language
pyth0n1c Jun 19, 2024
9ff0bc6
add testing against security_content
pyth0n1c Jun 19, 2024
3d18a24
fix syntax of repo checkout command
pyth0n1c Jun 19, 2024
18b2c67
Merge pull request #151 from splunk/dependabot/pip/setuptools-gte-69.…
pyth0n1c Jun 19, 2024
1f52c7d
Merge branch 'release_v4.1.0' into update_deps_4.1
pyth0n1c Jun 19, 2024
9738e88
Update setuptools requirement from ^69.5.1 to >=69.5.1,<71.0.0
dependabot[bot] Jun 19, 2024
893725a
Merge pull request #167 from splunk/test_against_escu
ljstella Jun 20, 2024
1ffa9e5
Add simple API for a more
pyth0n1c Jun 21, 2024
a6db215
Merge pull request #38 from linuxdaemon/sec-app
josehelps Jun 24, 2024
59d1c4c
Check references field no longer used.
pyth0n1c Jun 24, 2024
308ba71
Enable CVE Enrichment.
pyth0n1c Jun 24, 2024
9747de4
Fix missing parenthesis
pyth0n1c Jun 24, 2024
0f15968
Remove dynamic CVE enrichment.
pyth0n1c Jun 25, 2024
0938b42
removing apav_deploy since it is not used either
josehelps Jun 25, 2024
68d3d42
Merge pull request #175 from splunk/removing_rest_deploy
pyth0n1c Jun 25, 2024
ced6164
Add a function to generate
pyth0n1c Jun 25, 2024
8f16f1f
Merge pull request #168 from splunk/dependabot/pip/setuptools-gte-69.…
pyth0n1c Jun 25, 2024
9862e48
define simple repr and str
pyth0n1c Jun 25, 2024
97f0fa9
make sure the cve enrichment skeleton works
pyth0n1c Jun 26, 2024
bf63cdd
Implement suggestions from
pyth0n1c Jul 1, 2024
05f4db9
Merge pull request #170 from splunk/simple_api_features
pyth0n1c Jul 2, 2024
abdf2a5
Merge branch 'release_v4.1.0' into improve_filter_macro_checking
pyth0n1c Jul 2, 2024
de2ab17
Merge pull request #165 from splunk/improve_filter_macro_checking
pyth0n1c Jul 2, 2024
4d2f4fd
Merge pull request #144 from splunk/update_deps_4.1
pyth0n1c Jul 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/test_against_escu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# The default branch of security_content should always be correct.
# As such, we should use it in our test workflow, here, to ensure
# that contentctl is also correct and does not throw unexpected errors.

# We should remember that if contentctl introduces NEW validations that have
# note yet been fixed in security_content, we may see this workflow fail.
name: test_against_escu
on:
push:
pull_request:
types: [opened, reopened]
schedule:
- cron: "44 4 * * *"

jobs:
smoketest_escu:
strategy:
fail-fast: false
matrix:
python_version: ["3.11", "3.12"]
operating_system: ["ubuntu-20.04", "ubuntu-22.04", "macos-latest", "macos-14"]
#operating_system: ["ubuntu-20.04", "ubuntu-22.04", "macos-latest"]


runs-on: ${{ matrix.operating_system }}
steps:
# Checkout the current branch of contentctl repo
- name: Checkout repo
uses: actions/checkout@v4

# Checkout the develop (default) branch of security_content
- name: Checkout repo
uses: actions/checkout@v4
with:
path: security_content
repository: splunk/security_content

#Install the given version of Python we will test against
- name: Install Required Python Version
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
architecture: "x64"

- name: Install Poetry
run:
python -m pip install poetry

- name: Install contentctl and activate the shell
run: |
poetry install --no-interaction


- name: Clone the AtomicRedTeam Repo (for extended validation)
run: |
cd security_content
git clone --depth 1 https://github.com/redcanaryco/atomic-red-team


# We do not separately run validate and build
# since a build ALSO performs a validate
- name: Run contentctl build
run: |
cd security_content
poetry run contentctl build --enrichments

# Do not run a test - it will take far too long!
# Do not upload any artifacts

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ apps*
test_results*
attack_data*
security_content/
contentctl.yml

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
98 changes: 0 additions & 98 deletions contentctl/actions/apav_deploy.py

This file was deleted.

151 changes: 0 additions & 151 deletions contentctl/actions/api_deploy.py

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion contentctl/actions/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def inspectAppAPI(self, config: inspect)->str:
if not package_path.is_file():
raise Exception(f"Cannot run Appinspect API on App '{config.app.title}' - "
f"no package exists as expected path '{package_path}'.\nAre you "
"trying to 'contentctl acs_deploy' the package BEFORE running 'contentctl build'?")
"trying to 'contentctl deploy_acs' the package BEFORE running 'contentctl build'?")

files = {
"app_package": open(package_path,"rb"),
Expand Down
9 changes: 6 additions & 3 deletions contentctl/actions/new_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def buildDetection(self)->dict[str,Any]:
answers['date'] = datetime.today().strftime('%Y-%m-%d')
answers['author'] = answers['detection_author']
del answers['detection_author']
answers['data_source'] = answers['data_source']
answers['data_sources'] = answers['data_source']
del answers['data_source']
answers['type'] = answers['detection_type']
del answers['detection_type']
answers['status'] = "production" #start everything as production since that's what we INTEND the content to become
Expand All @@ -49,6 +50,7 @@ def buildDetection(self)->dict[str,Any]:
answers['tags']['required_fields'] = ['UPDATE']
answers['tags']['risk_score'] = 'UPDATE (impact * confidence)/100'
answers['tags']['security_domain'] = answers['security_domain']
del answers["security_domain"]
answers['tags']['cve'] = ['UPDATE WITH CVE(S) IF APPLICABLE']

#generate the tests section
Expand All @@ -64,6 +66,7 @@ def buildDetection(self)->dict[str,Any]:
]
}
]
del answers["mitre_attack_ids"]
return answers

def buildStory(self)->dict[str,Any]:
Expand Down Expand Up @@ -111,12 +114,12 @@ def writeObjectNewContent(self, object: dict, subdirectory_name: str, type: NewC
#make sure the output folder exists for this detection
output_folder.mkdir(exist_ok=True)

YmlWriter.writeYmlFile(file_path, object)
YmlWriter.writeDetection(file_path, object)
print("Successfully created detection " + file_path)

elif type == NewContentType.story:
file_path = os.path.join(self.output_path, 'stories', self.convertNameToFileName(object['name'], object['tags']['product']))
YmlWriter.writeYmlFile(file_path, object)
YmlWriter.writeStory(file_path, object)
print("Successfully created story " + file_path)

else:
Expand Down
1 change: 1 addition & 0 deletions contentctl/actions/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def execute(self, input_dto: validate) -> DirectorOutputDto:
director_output_dto = DirectorOutputDto(AtomicTest.getAtomicTestsFromArtRepo(repo_path=input_dto.getAtomicRedTeamRepoPath(),
enabled=input_dto.enrichments),
AttackEnrichment.getAttackEnrichment(input_dto),
CveEnrichment.getCveEnrichment(input_dto),
[],[],[],[],[],[],[],[],[])


Expand Down
Loading