Skip to content

Commit

Permalink
Merge pull request #494 from InQuest/rc
Browse files Browse the repository at this point in the history
v0.1.1
  • Loading branch information
battleoverflow authored Dec 19, 2023
2 parents 79f76f1 + 278939b commit 17d6b84
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 90 deletions.
81 changes: 0 additions & 81 deletions .github/workflows/codesee-arch-diagram.yml

This file was deleted.

3 changes: 1 addition & 2 deletions app/routes/access_keys.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import codecs
import time
import datetime
import os
Expand Down Expand Up @@ -77,7 +76,7 @@ def create_access_key():
active_inactive_count = json.loads(get_active_inactive_key_count().data)

if active_inactive_count and active_inactive_count['activeInactiveCount'] < 2:
s_key = codecs.encode(os.urandom(24), 'hex').decode()
s_key = os.urandom(24).hex()
token = user.generate_auth_token(s_key)

key = AccessKeys(
Expand Down
9 changes: 4 additions & 5 deletions app/routes/yara_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,9 @@ def update_yara_rule(id):
not rule.id == id]):
raise Exception("You cannot save two rules with the same name.")

if not release_state or not draft_state:
raise Exception("You must set a release, draft, and retirement state before modifying signatures")

compile_on_save = Cfg_settings.get_setting("COMPILE_YARA_RULE_ON_SAVE")
if compile_on_save and distutils.util.strtobool(compile_on_save) and (
rule_state == release_state.state or rule_state == draft_state.state):
Expand All @@ -487,10 +490,6 @@ def update_yara_rule(id):
rule_state) + " and the rule could not be saved because it does not compile.\n\nerror_code=" + str(
return_code) + "\n\n" + str(stderr))

if not release_state or not draft_state:
raise Exception("You must set a release, draft, and retirement state before modifying signatures")


if not entity.revision:
entity.revision = 1

Expand Down Expand Up @@ -562,7 +561,7 @@ def update_yara_rule(id):
m = db.session.query(MetadataMapping, Metadata).join(Metadata, Metadata.id == MetadataMapping.metadata_id).filter(
Metadata.key == name).filter(Metadata.artifact_type == ENTITY_MAPPING["SIGNATURE"]).filter(
MetadataMapping.artifact_id == entity.id).first()
if m[0]:
if m and m[0]:
m[0].value = value_dict.get("value", None) if not m[1].required else value_dict["value"]
db.session.add(m[0])
dirty = True
Expand Down
2 changes: 1 addition & 1 deletion app/static/views/c2dns/c2dns.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ <h4 class="modal-title" style="float: left; margin-right: 10px;">
<div class="modal-footer">
<button type="button" class="btn btn-default" ng-click="cancel()">Close
</button>
<button ng-disabled="form.$invalid || form.$pristine" class="btn btn-primary">Save</button>
<button ng-disabled="form.$pristine" class="btn btn-primary">Save</button>
</div>
</form>
</script>
Expand Down
2 changes: 1 addition & 1 deletion app/static/views/c2ip/c2ips.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ <h4 class="modal-title" style="float: left; margin-right: 10px;">
<div class="modal-footer">
<button type="button" class="btn btn-default" ng-click="cancel()">Close
</button>
<button ng-disabled="form.$invalid || form.$pristine" class="btn btn-primary">Save</button>
<button ng-disabled="form.$pristine" class="btn btn-primary">Save</button>
</div>
</form>
</script>
Expand Down

0 comments on commit 17d6b84

Please sign in to comment.