Skip to content

Conversation

@fanquake
Copy link
Member

@fanquake fanquake commented Mar 26, 2020

Wladimir asked about running the test-security-check.py script in our CI. This PR adds a target for that: make test-security and adds it to a few CI jobs.

@fanquake fanquake force-pushed the run_security_check_ci branch 2 times, most recently from ba89275 to 210bbfd Compare March 26, 2020 04:32
@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 26, 2020

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@practicalswift
Copy link
Contributor

Concept ACK: enforcement via automation is good

@maflcko
Copy link
Member

maflcko commented Mar 26, 2020

The same is already run via gitian, right?

@DrahtBot
Copy link
Contributor

🐙 This pull request conflicts with the target branch and needs rebase.

fanquake added a commit that referenced this pull request Apr 22, 2020
8334ee3 scripts: add MACHO LAZY_BINDINGS test to test-security-check.py (fanquake)
7b99c74 scripts: add MACHO Canary check to security-check.py (fanquake)

Pull request description:

  7b99c74 uses `otool -Iv` to check for `___stack_chk_fail` in the macOS binaries. Similar to the [ELF check](https://github.com/bitcoin/bitcoin/blob/master/contrib/devtools/security-check.py#L105). Note that looking for a triple underscore prefixed function (as opposed to two for ELF) is correct for the macOS binaries. i.e:
  ```bash
  otool -Iv bitcoind | grep chk
  0x00000001006715b8   509 ___memcpy_chk
  0x00000001006715be   510 ___snprintf_chk
  0x00000001006715c4   511 ___sprintf_chk
  0x00000001006715ca   512 ___stack_chk_fail
  0x00000001006715d6   517 ___vsnprintf_chk
  0x0000000100787898   513 ___stack_chk_guard
  ```

  8334ee3 is a follow up to #18295 and adds test cases to `test-security-check.py` that for some reason I didn't add at the time. I'll sort out #18434 so that we can run these tests in the CI.

ACKs for top commit:
  practicalswift:
    ACK 8334ee3: Mitigations are important. Important things are worth asserting :)
  jonasschnelli:
    utACK 8334ee3.

Tree-SHA512: 1aa5ded34bbd187eddb112b27278deb328bfc21ac82316b20fab6ad894f223b239a76b53dab0ac1770d194c1760fcc40d4da91ec09959ba4fc8eadedb173936a
@laanwj
Copy link
Member

laanwj commented May 14, 2020

Concept ACK

@fanquake fanquake force-pushed the run_security_check_ci branch from 210bbfd to fa07027 Compare May 15, 2020 03:12
@fanquake fanquake force-pushed the run_security_check_ci branch from fa07027 to 8a05476 Compare May 15, 2020 03:17
@fanquake
Copy link
Member Author

Have rebased and should have fixed up all the issues here.

The same is already run via gitian, right?

We run the symbol and security checks in gitian, but not the security-check test.

@maflcko
Copy link
Member

maflcko commented May 15, 2020

Concept ACK (have not reviewed the code beside a cursory glance on the ci config files)

@DrahtBot
Copy link
Contributor

🐙 This pull request conflicts with the target branch and needs rebase.

@fjahr
Copy link
Contributor

fjahr commented Jun 12, 2020

Concept ACK

Also looked at the code and it looks good to me, but I don't feel qualified enough in this area to give a full ACK at the moment.

@practicalswift
Copy link
Contributor

ACK cb3be57a83aa2065061e6cb77cec16167f133d3c -- patch looks correct and Travis is happy

Makefile.am Outdated
Copy link
Member

@laanwj laanwj Jun 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe test-security-check target instead of test-security? I mean, it's a test for the binary security check. It doesn't check the security of the actual binaries.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I've updated the target to test-security-check.

@fanquake fanquake force-pushed the run_security_check_ci branch from cb3be57 to 9fe71a5 Compare June 16, 2020 11:58
@laanwj
Copy link
Member

laanwj commented Jun 16, 2020

ACK 9fe71a5

@laanwj laanwj merged commit f658c15 into bitcoin:master Jun 16, 2020
@fanquake fanquake deleted the run_security_check_ci branch June 17, 2020 01:15
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants