Commit Graph

549 Commits

Author SHA1 Message Date
Capa Bot
c26c8d5d5a Sync capa rules submodule 2020-07-30 17:16:42 +00:00
Capa Bot
42c123456a Sync capa rules submodule 2020-07-29 21:13:35 +00:00
Capa Bot
96f207ca1f Sync capa-testfiles submodule 2020-07-29 21:13:21 +00:00
Ana María Martínez Gómez
56f258dd46 Merge pull request #213 from Ana06/update-hooks 2020-07-29 20:35:15 +02:00
Ana María Martínez Gómez
f9abbbe9ba hooks: change from post- to pre-commit
Avoid erroneous commits. The pre-commit can be skipped with the
`--no-verify` option, which is not available with the post-commit.
Note that `pre-commit` doesn't run when rebase while post-commit did.

This allows to have a single script which is run by both hooks. This
scripts can also be used independently to run the CI setup locally.
2020-07-29 20:25:03 +02:00
Ana María Martínez Gómez
8ff9e339f5 hooks: improve comment in setup-hooks.sh
Previously the `setup-hooks.sh` took care of more things. Consequently
the comments needed to be separated. This is not needed anymore and it
looks weird.
2020-07-29 20:16:58 +02:00
Ana María Martínez Gómez
6d00ae26ae hooks: do not repeat #!/usr/bin/env bash
The comment claims that:
> doesn't matter if `#!/usr/bin/env bash` gets repeated later on in a hooks file

However it is a convetion that there is only one comment like that and
the `setup-hooks.sh` script already takes care of adding it if the file
didn't exist.

Alternatively, we could leave the extra comment and remove the related
code in `setup-hooks.sh`. Currently two comments are added even if the
file didn't exist.
2020-07-29 20:16:56 +02:00
Ana María Martínez Gómez
22fd52ccb9 hooks: do not render git stash output
The `-q` options hides most of the output, but not everything.
2020-07-29 20:16:55 +02:00
Ana María Martínez Gómez
70dda980e8 hooks: update style checkers in hooks
Run `isort` and `black` in the hooks. Run them with the `--check` option
to not modify files which could be committed by accident.

Note that the changes in `.gitignore` are not needed as `.log` is
already excluded in the Django's section. We add those file to this
section in case `.log` is removed in the future.
2020-07-29 20:16:52 +02:00
Capa Bot
4707307a05 Sync capa rules submodule 2020-07-29 15:58:06 +00:00
William Ballenthin
6b94bf24ae Merge branch 'master' of github.com:fireeye/capa 2020-07-28 15:08:28 -06:00
William Ballenthin
c58a2caf9c submodule: rules update 2020-07-28 15:08:14 -06:00
Capa Bot
afbc461852 Sync capa rules submodule 2020-07-28 19:59:43 +00:00
William Ballenthin
7c29360af9 render: fix negative hex numbers
closes #211
2020-07-28 10:46:58 -06:00
William Ballenthin
bc0dac888a Merge branch 'master' of github.com:fireeye/capa 2020-07-28 10:44:48 -06:00
Capa Bot
a29616e40c Sync capa-testfiles submodule 2020-07-28 16:44:40 +00:00
William Ballenthin
c2bdeabeb8 submodule: testfiles update 2020-07-28 10:44:39 -06:00
Capa Bot
c8d16350b4 Sync capa rules submodule 2020-07-28 16:42:45 +00:00
Capa Bot
91bafed8e4 Sync capa rules submodule 2020-07-28 16:18:30 +00:00
Capa Bot
c10a9efea2 Sync capa rules submodule 2020-07-28 16:03:04 +00:00
Willi Ballenthin
137c0ca7f3 Merge pull request #209 from Ana06/statement-description
Enable descriptions for statement nodes
2020-07-28 10:02:07 -06:00
Capa Bot
01aa4755c5 Sync capa-testfiles submodule 2020-07-28 16:00:10 +00:00
Ana María Martínez Gómez
61818bbe04 tests: Test statement nodes descriptions
Add statement descriptions to `test_rule_yaml_descriptions` to ensure
rules with statement descriptions are parsed and extracted correctly.
2020-07-28 15:58:55 +02:00
Ana María Martínez Gómez
56bf6a8d79 Render description in vverbose mode for for statement nodes
Implement it similarly as how it is rendered for features.
2020-07-28 15:58:38 +02:00
Ana María Martínez Gómez
b3c89acda7 render: refactor render_statement in vverbose
Avoid code repetition to make modifying this code easier.
2020-07-28 15:58:37 +02:00
Ana María Martínez Gómez
bee91583e5 Enable descriptions for statement nodes
Enable descriptions for statement nodes such as and and or.

Use of case in: fireeye/capa-rules/pull/51

Documentation should be added in capa-rules.
2020-07-28 15:58:24 +02:00
Ana María Martínez Gómez
a74ab922a3 Get rid of * for Statement
They are not needed and complicate the code and make more difficult to
add more parameters to the initialization of Statements.

This produces many changes in the tests. The alternative would be to add
a parameter None in all of them, which are also a lot of changes.
2020-07-28 14:20:13 +02:00
Ana María Martínez Gómez
6060397944 render: Refactor convert_statement_to_result_document
Avoid repeating code and make easier to modify.
2020-07-28 14:20:11 +02:00
Capa Bot
863df5ad1f Sync capa rules submodule 2020-07-28 12:06:51 +00:00
Capa Bot
a735f29ea9 Sync capa rules submodule 2020-07-27 21:06:34 +00:00
Capa Bot
261713d0d1 Sync capa-testfiles submodule 2020-07-27 21:05:14 +00:00
Capa Bot
f27cee010a Sync capa rules submodule 2020-07-27 18:15:34 +00:00
Willi Ballenthin
ce83ff352c Merge pull request #208 from fireeye/fix-197
support negative offset features (and add IDA tests)
2020-07-27 11:41:04 -06:00
Ana María Martínez Gómez
3e3fb18deb black: Fix typo in import-to-bn.py
Tests are broken in master
2020-07-27 18:41:15 +02:00
Capa Bot
bfdd68c60a Sync capa rules submodule 2020-07-27 16:02:34 +00:00
Willi Ballenthin
14463de5e7 Merge pull request #207 from psifertex/master
adding BN script
2020-07-27 09:19:31 -06:00
Capa Bot
e44dc73ec2 Sync capa rules submodule 2020-07-27 13:16:02 +00:00
Jordan Wiens
f547ca0fae updates for pull 205 2020-07-25 22:45:51 -04:00
Willi Ballenthin
2c48a8a5fa Merge pull request #204 from psifertex/patch-1
submodule update requires --init the first time
2020-07-25 18:39:17 -06:00
Willi Ballenthin
a901f2e7ac license: fill in org name
closes #206
2020-07-25 18:37:36 -06:00
Jordan
508ebb47e0 submodule update requires --init the first time 2020-07-25 17:50:15 -04:00
Jordan Wiens
82b9514230 initial commit of BinaryNinja import script 2020-07-25 17:45:25 -04:00
William Ballenthin
7236283b2f tests: ida: address comments 2020-07-25 11:40:04 -06:00
William Ballenthin
b6c9540469 pep8 2020-07-25 10:29:21 -06:00
William Ballenthin
605ee00f0a scripts: bn: remove extra character 2020-07-25 10:28:11 -06:00
William Ballenthin
2fa2a98ae1 pep8 2020-07-25 10:26:57 -06:00
William Ballenthin
bf4d12e5b6 Merge branch 'master' into fix-197 2020-07-25 10:24:25 -06:00
William Ballenthin
352d6f26fc tests: ida: ensure they all pass
closes #202
2020-07-25 10:10:25 -06:00
William Ballenthin
554f5dfe46 ida: insn: don't ignore offset 0x0 2020-07-25 01:41:31 -06:00
William Ballenthin
1a1caf76fa add test_ida_features 2020-07-25 01:41:23 -06:00