Commit Graph

299 Commits

Author SHA1 Message Date
Alex Jaramillo 4faa9e77df Verifying MD5 hashes for pypi packages
With this change python packages in pypi will be
verified using the MD5 hash posted in pypi along
the package if all the other verifications are
not possible.
2017-02-17 21:46:44 +00:00
Matthew Johnson 09f552a7b5 Add tqdm public key 2017-02-16 15:36:29 -08:00
Matthew Johnson 13e16210aa Update c-helloworld-opts test case for security flag 2017-02-16 15:36:28 -08:00
Matthew Johnson 695082dbd1 Add security_sensitive flag to options
Enabling the security_sensitive flag in options.conf will append
security-related flags to CFLAGS. Currently only
-fstack-protector-strong is added but we will add more as necessary.
2017-02-16 15:36:28 -08:00
Matthew Johnson bd8702e7dc Add a unit test for commitmessage.scan_for_changes
The scan_for_changes was moved from docs.py to commitmessage.py, this
patch adds a commitmessage test for scan_for_changes.
2017-02-16 15:36:28 -08:00
Matthew Johnson 3ffac7ccf9 Deprecate docs module by incorporating into commitmessage
The docs module was only used to copy news and changelog files to the
autospec directory, which is then parsed for a commitmessage. This patch
removes the docs module and incorporates it into commitmessage.py.
2017-02-16 15:36:28 -08:00
Matthew Johnson 192ee3570d Add unit tests for commitmessage module 2017-02-16 15:35:35 -08:00
Matthew Johnson 6e00db50ea Simplify commitmessage module to make it more expandable
commitmessage module no longer has global variables. The CVEs list now
lives in the config module. The parsing logic for news files is
simplified to look for start and end patterns of relevant blocks of
information.

The goal here was to keep as closely as possible to the previous parsing
functionality, but it is very possible not every pattern was accounted
for. The start and end pattern lists make it much easier to add patterns
and modify the parsing if this is the case.
2017-02-16 15:35:35 -08:00
Alex Jaramillo 4e4530744c Pkg verification interactive mode special cases
This patch adds handling for two cases for interactive
mode. 1- when non pty, the interactive mode is disabled
, and 2- timeout input function, when user fails to type
an input in interactive mode the script will continue
after a timeout.
2017-02-14 19:43:34 +00:00
Alex Jaramillo aa4393b213 Adding flag to disable interactive mode
This flag will be used for package verification interactive
mode, currently package verification will attempt to import
a public key if a public key id is found. With the addition
of this flag is possible to disable the default interactive
mode and instead fail the verification if the public key is
not already in the keyring.
2017-02-14 18:14:51 +00:00
Matthew Johnson 87900c8381 Fix tests for several recent changes
Changes have been pushed recently that require testing updates. This
patch updates the configuration file and spec file expectations for the
functional tests.
2017-02-07 09:42:37 -08:00
Matthew Johnson aedc0b1c2f Only add -std=gnu++98 to CXXFLAGS when config opt set
When config.config_opts['broken_c++'] is set, only add it to the
CXXFLAGS, because adding it to every flag list (such as CFLAGS) causes a
compiler error.
2017-02-07 09:40:29 -08:00
Icarus Sparry ceca012d0c Add options.conf ability to not strip binaries
The hhvm binary in particular has extra elf sections added to it to
store php code, and these are removed by the generic build macros that
create the debug information.

Other packages which need this are bazil, docker, go, linux-*.

Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
2017-02-07 08:48:30 -08:00
Arjan van de Ven 9ab54653ac add zip support 2017-02-07 16:28:52 +00:00
Ikey Doherty ce367ec62a abireport: Add support for host-side abireport tool
The abireport portion of autospec has since been ported (in concept) to
a new Golang tool of the same name. This tool is decidedly more accurate
and considerably faster, as it does not have to call out to execute more
system commands for each file processed.

In addition, it is able to differentiate correctly between multiple
architectures, allowing for two new files to exist, used_libs32 and
symbols32. These permit a finer granularity in the view of multilib
as exposed by the package.

In the instance that abireport is not available on the host, we fall
back to the internal abireport scanning, and emit a warning.

Minor tweaks have been made to the binary_in_path function to make it
reusable as part of util, and to make it lazily initialise the os paths
to cut down on unnecessary duplication.

Signed-off-by: Ikey Doherty <michael.i.doherty@intel.com>
2017-02-03 17:41:58 +00:00
Arjan van de Ven 7e16de79f2 set default build type 2017-01-28 16:28:35 +00:00
Arjan van de Ven d078245cbe fix savanha key mess 2017-01-27 16:50:09 +00:00
Alex Jaramillo ed1bda5a8a Adding logic to handle proxy if env var exists
In some environments it might be neccesary to pass
http_proxy env var if this is not set otherwise the
attempt of find a key will fail since gpg will not
be able to find a keyserver if behind proxy.
2017-01-25 22:06:40 +00:00
Matthew Johnson 101b2f74bb Add unit tests for abireport
Tests most helper functions in the abireport module. Excludes some
helpers that are just wrappers for os and shutil calls. Also excludes
the 100-line examine_abi main method, which may require functional
tests.
2017-01-24 15:01:38 -08:00
Matthew Johnson 75ef4c2fbd Check for public key consistency in verification step
Autospec should show an error and exit if the key the package was
verified with has changed from previous autospec runs, as it may
indicate a compromised key. The previous key is recorded in the existing
spec file.
2017-01-24 11:56:10 -08:00
Matthew Johnson ec43846860 Add lmdb tarball version and name testcase
Testing for bug reported in CLEAR-1817
2017-01-20 14:37:32 -08:00
Alex Jaramillo e5dd7e05af Adding keys 2017-01-20 10:18:39 -08:00
Alex Jaramillo 9937cd1b32 Adding option to interactively import keys
When autospec fails to find a key it just quits
even when a keyid exists. With these changes users
will have the option to import a key without
quiting autospec.
2017-01-20 21:04:53 +00:00
Patrick McCarty b7d413650e config: typo fix
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-01-20 10:50:53 -08:00
Simental Magana, Marcos 457bc19a5d don't check for '/usr/sbin/mock' but user in 'mock' group instead
in some cases '/usr/sbin/mock' may not exist, which will break autospec
execution, previous code checks that '/usr/sbin/mock' and
'/usr/bin/mock' are equal to prepend 'sudo' to the command.

check if current user doesn't belong to the 'mock' group
to add 'sudo' in the command

Signed-off-by: Simental Magana, Marcos <marcos.simental.magana@intel.com>
2017-01-20 10:28:25 -06:00
Matthew Johnson 68901b30de Add formatted color printing for functional tests 2017-01-19 15:57:57 -08:00
Matthew Johnson 7853ee1602 Improve version detection when dash is found in string
Previously, it was assumed if a dash appeared in the version string the
actual version information was after the dash. This is not always the
case, so check if the second part of the string is formatted like a
version before using it. If not, try the first part. If neither look
like the version just remove the dash so it is at least a valid version
string.

Add a test case to packageurls to test this.
2017-01-19 14:43:42 -08:00
Matthew Johnson 13dc417c0a Add arguments to only run specific functional tests
Functional tests take a long time to run, some longer than others. This
adds the option to run specific test cases defined by passing
whitespace-separated options to the '-c' flag, allowing the tester to
avoid long-running tests like libjpeg-turbo if they don't need to. This
can be run with make by setting the CASES argument:

make test_autospec CASES="c-helloworld c-helloworld-32"
2017-01-19 11:38:56 -08:00
Matthew Johnson 62adde9cf1 Add reproducible build bits to functional tests 2017-01-19 11:14:39 -08:00
Matthew Johnson 6c6163756a Exclude update-triggers.targets.wants from autostart
Packages that are linking into update-triggers.target.wants folders
should not have those symlinks move into -autostart subrpms, since this
breaks the very thing they're set out to do. On update, all triggers
must be executed.

Resolves CLEAR-1797
2017-01-19 10:51:59 -08:00
Arjan van de Ven e752bebf2e Merge branch 'master' of git://kojiclear.jf.intel.com/projects/autospec 2017-01-17 18:02:15 +00:00
Arjan van de Ven 05e1fb8668 Make R files also do S-D-E 2017-01-17 18:02:07 +00:00
William Douglas be10315eca Add license translation for CC0
Translate CC0 -> CC0-1.0
2017-01-17 17:59:27 +00:00
Arjan van de Ven fd3dda2c60 make the python version we use more deterministic by passing --force 2017-01-15 23:05:07 +00:00
Arjan van de Ven a0ac8f0959 write epoch pretty much always 2017-01-15 15:40:31 +00:00
Arjan van de Ven 8e86bd4314 Print email address on succesful verify 2017-01-15 15:40:13 +00:00
Simental Magana, Marcos dffbd8521d keyring: Add ISC signing key 2017 & 2018 (codesign@isc.org)
Signed-off-by: Simental Magana, Marcos <marcos.simental.magana@intel.com>
2017-01-13 13:48:27 -06:00
William Douglas 8eb197d3cf Add diffoscope signer key 2017-01-13 19:30:36 +00:00
William Douglas be112e545b Update license translation for GPL-3+ 2017-01-13 19:13:50 +00:00
Florian Koch 3937c1dd40 add builddep detection for glib and procps-ng 2017-01-12 17:30:58 -08:00
Matthew Johnson 5810761dc4 Commit signature files individually
If git add fails to find the first file in a list it fails and does not
add the remaining files. Separate out the git adds for signature files
so they are not ignored.

Also, use 'bash -c' combined with shopt to get around subprocess
restrictions against globbing.
2017-01-12 17:26:26 -08:00
Matthew Johnson a2baa7089e Add package signature as Source99 file
Add the package signature URL as a Source99 file to include it with the
source rpm. This allows the signature to be more traceable and
accessible even without a network connection.
2017-01-12 15:43:30 -08:00
Patrick McCarty 79341c038a files: add workarounds for elfutils libraries
There are three shared libraries from elfutils with a .so extension and
live in /usr/lib{32,64}. Normally, files with this pattern are installed
in the -dev subpackage, so to ensure that all elfutils libraries are
installed to -lib, make autospec detect these libraries before the -dev
rules apply.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2017-01-12 14:46:36 -08:00
Alex Jaramillo 04d42a871e Validate gpg signature before using it
Because some repos return 200 http code with a
404 page when a signature is not found, validating
signatures is needed to make sure the downloaded
data can be read by gpg.

This will print the proper error messages for
CLEAR-1752 and CLEAR-1756, right now it just
returns a None and gives the impression that
a signature is available, which is missleading.
2017-01-11 19:06:55 +00:00
Alex Jaramillo 66a284c2ad Adding public key
Importing public key for colord-1.3.4.tar.xz
2017-01-10 22:34:53 +00:00
William Douglas 4a788467f0 Add cargo support to autospec
This change adds the ability for autospec to package projects using the
cargo build tool. Note that source files are installed into
/usr/share/rust/src and an empty checksums file is prepopulated into the
source folders for now. This is an implementation taking advantage of
cargo's recently added ability to handle vendored source directories and
may evolve further as distro support is still not fully baked in.
2017-01-10 21:29:37 +00:00
William Douglas b45aaa78d0 Update python functional tests
Update tests for python due to python3 versions being built by default.
2017-01-09 22:32:21 +00:00
William Douglas d7122bf4c7 Avoid possible autospec race
When autospec is run concurrently with itself it may race creating the
parent folder for the tarbal extraction. To avoid this simply allow the
folder to already exist.
2017-01-09 22:32:21 +00:00
Matthew Johnson 5407d741be Import refactor of pkg_integrity tests
Since pkg_integrity now depends on config.py, it is necessary to change
how imports are done in the tests so mocking can be achieved. This also
required renaming the tests/pkg_integrity.py file to
tests/test_pkg_integrity.py to avoid a name collision. Before each test
the necessary config option is set correctly and the configuration file
rewrite is mocked away.
2017-01-07 08:38:28 -08:00
Arjan van de Ven 814865f0cc If you have no key (e.g. package not signed, but an .asc file exists
with 404 html in it)
the parse_key function goes completely splat. this patch wraps the
splat-going bits into a try/except construct
2017-01-07 16:23:40 +00:00