From b22e13ce48f6a1c79a468b9d4063d4f818387432 Mon Sep 17 00:00:00 2001 From: elegantmoose Date: Sun, 11 Feb 2024 11:26:28 -0500 Subject: [PATCH] case change --- README.md | 4 ++-- SECURITY.md | 6 +++--- app/api/v2/handlers/health_api.py | 6 +++--- app/api/v2/handlers/operation_api.py | 14 +++++++------- app/api/v2/handlers/planner_api.py | 4 ++-- app/service/file_svc.py | 2 +- app/utility/payload_encoder.py | 2 +- app/utility/rule_set.py | 4 ++-- server.py | 5 ++++- templates/abilities.html | 2 +- templates/login.html | 2 +- tests/api/v2/handlers/test_health_api.py | 2 +- tests/conftest.py | 2 +- 13 files changed, 29 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index d71319298..82dc6fab3 100644 --- a/README.md +++ b/README.md @@ -101,9 +101,9 @@ If you'll be developing the UI, there are a few more additional installation ste 1. Add the Magma submodule if you haven't already: `git submodule add https://gitlab.mitre.org/caldera/other/magma` 1. Install NodeJS dependencies: `cd plugins/magma && npm install && cd ..` -1. Start the CALDERA server with an additional flag: `python3 server.py --uidev localhost` +1. Start the Caldera server with an additional flag: `python3 server.py --uidev localhost` -Your CALDERA server is available at http://localhost:8888 as usual, but there will now be a hot-reloading development server for the VueJS front-end available at http://localhost:3000. Both logs from the server and the front-end will display in the terminal you launched the server from. +Your Caldera server is available at http://localhost:8888 as usual, but there will now be a hot-reloading development server for the VueJS front-end available at http://localhost:3000. Both logs from the server and the front-end will display in the terminal you launched the server from. ## Docker Deployment To build a Caldera docker image, ensure you have docker installed and perform the following actions: diff --git a/SECURITY.md b/SECURITY.md index f05eb93f1..929c9d02d 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -28,14 +28,14 @@ Under this policy, "research" means activities in which you: ## Reporting a vulnerability -Information submitted under this policy will be used for defensive purposes only, i.e. to mitigate or remediate vulnerabilities. Since CALDERA is run by a not-for-profit and is open source by nature, by +Information submitted under this policy will be used for defensive purposes only, i.e. to mitigate or remediate vulnerabilities. Since Caldera is run by a not-for-profit and is open source by nature, by submitting a vulnerability, you acknowledge that you have no expectation of payment. However, we will ensure that credit is given to the bug finder. ## What we would like to see from you To help us triage and prioritize submissions, please include the following in your report: -- Affected version of CALDERA (committed hash or version number), operating system used, and python version. +- Affected version of Caldera (committed hash or version number), operating system used, and python version. - Describe the location the vulnerability was discovered and the potential impact of exploitation. @@ -49,7 +49,7 @@ When you choose to share your contact information with us, we commit to coordina - Within ***10 business days***, we will acknowledge that your report has been received. -- After notifying the CALDERA team, we will open reported issues to the public within ***90 days***, or after a fix is released (whichever comes first). +- After notifying the Caldera team, we will open reported issues to the public within ***90 days***, or after a fix is released (whichever comes first). - To the best of our ability, we will confirm the existence of the vulnerability to you and be as transparent as possible about what steps we are taking during the remediation process, including on issues or challenges that may delay resolution. diff --git a/app/api/v2/handlers/health_api.py b/app/api/v2/handlers/health_api.py index 1d0b58da0..c9229ca22 100644 --- a/app/api/v2/handlers/health_api.py +++ b/app/api/v2/handlers/health_api.py @@ -19,15 +19,15 @@ def add_routes(self, app: web.Application): router.add_get('/health', security.authentication_exempt(self.get_health_info)) @aiohttp_apispec.docs(tags=['health'], - summary='Health endpoints returns the status of CALDERA', - description='Returns the status of CALDERA and additional details including versions of system components') + summary='Health endpoints returns the status of Caldera', + description='Returns the status of Caldera and additional details including versions of system components') @aiohttp_apispec.response_schema(CalderaInfoSchema, 200, description='Includes all loaded plugins and system components.') async def get_health_info(self, request): loaded_plugins_sorted = sorted(self._app_svc.get_loaded_plugins(), key=operator.attrgetter('name')) access = await self._auth_svc.get_permissions(request) mapping = { - 'application': 'CALDERA', + 'application': 'Caldera', 'version': app.get_version(), 'access': access[0].name, 'plugins': loaded_plugins_sorted diff --git a/app/api/v2/handlers/operation_api.py b/app/api/v2/handlers/operation_api.py index 3144518f0..3ecd38cca 100644 --- a/app/api/v2/handlers/operation_api.py +++ b/app/api/v2/handlers/operation_api.py @@ -38,7 +38,7 @@ def add_routes(self, app: web.Application): @aiohttp_apispec.docs(tags=['operations'], summary='Retrieve operations', - description='Retrieve all CALDERA operations from memory. Use fields from the ' + description='Retrieve all Caldera operations from memory. Use fields from the ' '`BaseGetAllQuerySchema` in the request body to filter.') @aiohttp_apispec.querystring_schema(BaseGetAllQuerySchema) @aiohttp_apispec.response_schema(OperationSchema(many=True, partial=True), @@ -49,7 +49,7 @@ async def get_operations(self, request: web.Request): @aiohttp_apispec.docs(tags=['operations'], summary='Retrieve an operation by operation id', - description='Retrieve one CALDERA operation from memory based on the operation id (String ' + description='Retrieve one Caldera operation from memory based on the operation id (String ' 'UUID). Use fields from the `BaseGetOneQuerySchema` in the request body to add ' '`include` and `exclude` filters.', parameters=[{ @@ -68,7 +68,7 @@ async def get_operation_by_id(self, request: web.Request): @aiohttp_apispec.docs(tags=['operations'], summary='Retrieve operations (alternate)', - description='Retrieve all CALDERA operations from memory, with an alternate selection' + description='Retrieve all Caldera operations from memory, with an alternate selection' ' of properties. Use fields from the `BaseGetAllQuerySchema` in the request' ' body to filter.') @aiohttp_apispec.querystring_schema(BaseGetAllQuerySchema) @@ -89,8 +89,8 @@ async def get_operations_summary(self, request: web.Request): return web.json_response(operations_mod) @aiohttp_apispec.docs(tags=['operations'], - summary='Create a new CALDERA operation record', - description='Create a new CALDERA operation using the format provided in the ' + summary='Create a new Caldera operation record', + description='Create a new Caldera operation using the format provided in the ' '`OperationSchema`. Required schema fields are as follows: "name", ' '"adversary.adversary_id", "planner.id", and "source.id"') @aiohttp_apispec.request_schema(OperationSchema) @@ -102,7 +102,7 @@ async def create_operation(self, request: web.Request): @aiohttp_apispec.docs(tags=['operations'], summary='Update fields within an operation', - description='Update one CALDERA operation in memory based on the operation id (String ' + description='Update one Caldera operation in memory based on the operation id (String ' 'UUID). The `state`, `autonomous` and `obfuscator` fields in the operation ' 'object may be edited in the request body using the `OperationSchema`.', parameters=[{ @@ -121,7 +121,7 @@ async def update_operation(self, request: web.Request): @aiohttp_apispec.docs(tags=['operations'], summary='Delete an operation by operation id', - description='Delete one CALDERA operation from memory based on the operation id (String ' + description='Delete one Caldera operation from memory based on the operation id (String ' 'UUID).', parameters=[{ 'in': 'path', diff --git a/app/api/v2/handlers/planner_api.py b/app/api/v2/handlers/planner_api.py index 1493036b8..f109907a8 100644 --- a/app/api/v2/handlers/planner_api.py +++ b/app/api/v2/handlers/planner_api.py @@ -20,7 +20,7 @@ def add_routes(self, app: web.Application): @aiohttp_apispec.docs(tags=['planners'], summary='Retrieve planners', - description='Retrieve CALDERA planners by criteria. Supply fields from the `PlannerSchema` ' + description='Retrieve Caldera planners by criteria. Supply fields from the `PlannerSchema` ' 'to the `include` and `exclude` fields of the `BaseGetAllQuerySchema` in the ' 'request body to filter retrieved planners.') @aiohttp_apispec.querystring_schema(BaseGetAllQuerySchema) @@ -32,7 +32,7 @@ async def get_planners(self, request: web.Request): @aiohttp_apispec.docs(tags=['planners'], summary='Retrieve a planner by planner id', - description='Retrieve one CALDERA planner based on the planner id (String `UUID`). ' + description='Retrieve one Caldera planner based on the planner id (String `UUID`). ' 'Supply fields from the `PlannerSchema` to the `include` and `exclude` fields ' 'of the `BaseGetOneQuerySchema` in the request body to filter retrieved ' 'planners.', diff --git a/app/service/file_svc.py b/app/service/file_svc.py index 753fd2d71..01cf2b0ec 100644 --- a/app/service/file_svc.py +++ b/app/service/file_svc.py @@ -243,7 +243,7 @@ def _read(self, filename): try: buf = self.encryptor.decrypt(buf[len(FILE_ENCRYPTION_FLAG):]) except InvalidToken: - self.log.error('Failed to decrypt saved CALDERA state due to incorrect encryption key.\n' + self.log.error('Failed to decrypt saved Caldera state due to incorrect encryption key.\n' ' - If attempting to restore secure backup, verify that conf/local.yml exists with ' 'correct encryption_key value, and that the server is being run without --insecure.\n' ' - If attempting to restore insecure backup, verify that conf/default.yml exists ' diff --git a/app/utility/payload_encoder.py b/app/utility/payload_encoder.py index 8cb969fed..9e8f2a8a1 100644 --- a/app/utility/payload_encoder.py +++ b/app/utility/payload_encoder.py @@ -2,7 +2,7 @@ This module contains helper functions for encoding and decoding payload files. If AV is running on the server host, then it may sometimes flag, quarantine, or delete -CALDERA payloads. To help prevent this, encoded payloads can be used to prevent AV +Caldera payloads. To help prevent this, encoded payloads can be used to prevent AV from breaking the server. The convention expected by the server is that encoded payloads will be XOR'ed with the DEFAULT_KEY contained in the payload_encoder.py module. diff --git a/app/utility/rule_set.py b/app/utility/rule_set.py index 52a365572..cd5d0ef28 100644 --- a/app/utility/rule_set.py +++ b/app/utility/rule_set.py @@ -80,9 +80,9 @@ async def _is_ip_rule_match(self, rule, fact): | DENY: 127.0.0.0/24 | 127.0.0.0/23 | ------------------------------------- In the above case, we do not match on this fact, since the fact is a supernet of the rule (it "contains" the - rule subnet). Therefore, the rule subnet is only a portion of the fact subnet. Thus, CALDERA would ignore the + rule subnet). Therefore, the rule subnet is only a portion of the fact subnet. Thus, Caldera would ignore the DENY rule and scan /23 anyway. But this would include a denied subnet range, which is undesired behavior. - This being the case, CALDERA does not match on non-equivalent subnets. + This being the case, Caldera does not match on non-equivalent subnets. """ if rule.match != '.*': is_fact_address = await self._is_ip_address(fact.value) diff --git a/server.py b/server.py index 704f59cc8..04ac3d74a 100644 --- a/server.py +++ b/server.py @@ -90,7 +90,7 @@ def init_swagger_documentation(app): ) aiohttp_apispec.setup_aiohttp_apispec( app=app, - title='CALDERA', + title='Caldera', version=version.get_version(), swagger_path='/api/docs', url='/api/docs/swagger.json', @@ -99,12 +99,14 @@ def init_swagger_documentation(app): app.middlewares.append(apispec_request_validation_middleware) app.middlewares.append(validation_middleware) + async def enable_cors(request, response): response.headers['Access-Control-Allow-Origin'] = 'http://' + args.uiDevHost + ':3000' response.headers['Access-Control-Allow-Credentials'] = 'true' response.headers['Access-Control-Allow-Methods'] = 'GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD' response.headers['Access-Control-Allow-Headers'] = 'Access-Control-Allow-Headers, Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers' + async def start_vue_dev_server(): await asyncio.create_subprocess_shell( 'npm run dev', @@ -113,6 +115,7 @@ async def start_vue_dev_server(): cwd='./plugins/magma/') logging.info('VueJS development server is live.') + if __name__ == '__main__': def list_str(values): return values.split(',') diff --git a/templates/abilities.html b/templates/abilities.html index cd33a576b..bbcefebe9 100644 --- a/templates/abilities.html +++ b/templates/abilities.html @@ -5,7 +5,7 @@

Abilities

- An ability is a specific ATT&CK tactic/technique implementation which can be executed on running agents. Abilities will include the command(s) to run, the platforms / executors the commands can run on (ex: Windows / PowerShell), payloads to include, and a reference to a module to parse the output on the CALDERA server. + An ability is a specific ATT&CK tactic/technique implementation which can be executed on running agents. Abilities will include the command(s) to run, the platforms / executors the commands can run on (ex: Windows / PowerShell), payloads to include, and a reference to a module to parse the output on the Caldera server.


diff --git a/templates/login.html b/templates/login.html index 783a61b8a..b37958052 100644 --- a/templates/login.html +++ b/templates/login.html @@ -1,6 +1,6 @@ - Login | CALDERA + Login | Caldera diff --git a/tests/api/v2/handlers/test_health_api.py b/tests/api/v2/handlers/test_health_api.py index 7254ecc8d..c2e4abd77 100644 --- a/tests/api/v2/handlers/test_health_api.py +++ b/tests/api/v2/handlers/test_health_api.py @@ -7,7 +7,7 @@ @pytest.fixture def expected_caldera_info(): return { - 'application': 'CALDERA', + 'application': 'Caldera', 'plugins': [], 'version': app.get_version() } diff --git a/tests/conftest.py b/tests/conftest.py index 0c502d011..fb7f9adea 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -384,7 +384,7 @@ async def initialize(): app_svc.register_subapp('/api/v2', make_app(svcs=services)) aiohttp_apispec.setup_aiohttp_apispec( app=app_svc.application, - title='CALDERA', + title='Caldera', version=version.get_version(), swagger_path='/api/docs', url='/api/docs/swagger.json',