Граф коммитов

54 Коммитов

Автор SHA1 Сообщение Дата
Aaron Meihm 2d2a2417ff client: godoc comment for ClientPassphrase 2017-09-20 14:30:45 -05:00
Aaron Meihm 405b1e73a3 client: comment macro functions 2017-09-20 14:30:45 -05:00
Aaron Meihm 68bdc01a39 client: comment exported client configuration types 2017-09-20 14:30:45 -05:00
Aaron Meihm 29b3bd69be client: improve configuration generator
Clean up the configuration generator function, handle some error
conditions better and make the output a bit nicer.
2017-09-20 14:30:45 -05:00
Aaron Meihm 0c6bec060d client: return proper errors from FindHomedir
Return an error from FindHomedir rather then panic with no context.
Also, modify one case here to use path.Join instead of expecting UNIX
filesystem layout.
2017-09-20 14:30:39 -05:00
Aaron Meihm f99cc05252 client: differentiate ENOENT when reading configuration file 2017-09-20 12:55:27 -05:00
Aaron Meihm 33a0a4ee8f mig-cmd: handle SIGINT nicer when interrupting an action
Use WaitGroups to avoid interleaving text if an action is cancelled.
This did not occur all the time, but this change should provide for more
consistent behavior.

mig-console didn't handle this at all; add a comment around this as well
and adjust mig-console to provide the additional extra parameter
required.
2017-09-19 17:20:59 -05:00
Aaron Meihm 49b3607577 client: revert GetAPIResource change made in 32824ce2
This reverts the change made in 32824ce2 to handle error results from
GetAPIResource. Some logic in here needs to be revisited; GetAPIResource
returns an error even under normal circumstances (such as getting a 404
if no results were found for a given query) which breaks results fetch
in the client.
2017-09-07 11:51:38 -05:00
Aaron Meihm 32824ce2aa client: check error result on GetAPIResource 2017-09-06 16:17:50 -05:00
Tyler Davis aca753cb0f [easy/bug] Check length of config.API.URL, fixes #362 2017-07-11 22:41:01 +00:00
Aaron Meihm e6da818bcd [minor] include actual pgp error on token sign failure 2017-06-08 10:41:49 -05:00
Aaron Meihm bbb5c9d15e [minor] if a client is using API key auth, don't check gpg config 2017-05-02 14:05:31 -05:00
Aaron Meihm 16a78102e2 [medium] move loader key generation into api
loader keys have a specific format. rather then various clients needing
to be familiar with the format, just generate keys api side and return
them once upon generation to the client.
2017-04-12 09:43:11 -05:00
Aaron Meihm 0b591df768 [minor] rename PostInvestigatorAPIKey to PostInvestigatorAPIKeyStatus 2017-04-12 09:26:10 -05:00
Aaron Meihm 0c49439eb0 [major] investigator API key authentication for API use
X-PGPAUTHORIZATION based authentication was previously used for
authorizing client access to the API. This patch adds the option of
using a standard API key as well.

Note that PGP is still required for querying agents. In some cases
though, we may want to integrate other external applications that just
require API access (e.g. to review previous investigations, manage
users, etc). Using PGP for this is problematic and the ability
to instead just use a regular API key for these scenarios remediates
this.

Investigators can now be assigned an key that enables API key based
access to the MIG API. Investigators can also be created without a PGP
key, so they can solely utilize API key based access.

Resolves #239
2017-04-11 14:55:58 -05:00
Aaron Meihm 8d91aa20cd [minor] support passphrase input via env
Not intended for use in the general case, but permits using various mig
command line tools in an automated manner more easily.
2016-09-14 17:20:38 -05:00
Aaron Meihm bb5f690710 [major] expand permission model to be per-endpoint 2016-08-15 18:28:57 -05:00
Aaron Meihm 07d135a000 [medium] more granular permissions for investigators
This removes the previous implementation where an investigator could
either be set to an admin or not, and expands this to per-endpoint
permissions that can be set for individual investigators.
2016-08-15 15:25:01 -05:00
Aaron Meihm c32c3b4ab2 [medium] add environment validation to loader authorization
Adds ability to specify an expected environment or tag query string to
loader instances which are verified prior to manifest lookup.

Resolves #255
2016-08-11 15:28:57 -05:00
Aaron Meihm c8a8b53d8e [minor] add support for user defined target macros
This provides the ability for users to define target macros in ~/.migrc,
as an example rather than requiring -t "status='online'", given a
section such as:

[targets]
    macro = allonline:status='online'

in .migrc, you can then do -t allonline. The intended specification
format is macro = name:<target string>. Multiple "macro" items can be
specified in the targets section.

This also removes the default target in mig-cmd, and the -t flag is
now a required option. This better aligns with how mig-console works.
2016-08-09 09:03:13 -05:00
Aaron Meihm e70bb04105 [major] hashed storage of api loader keys and format standardization 2016-07-10 16:24:53 -05:00
Aaron Meihm 638a6de11e [minor] support creating investigator as admin 2016-05-26 15:16:31 -05:00
Aaron Meihm 6cfd4bbf96 [minor] support enable/disable admin flag via api and console 2016-05-26 14:59:35 -05:00
Aaron Meihm 325640a388 [minor] return 201 created on manifest create 2016-05-17 16:06:34 -05:00
Julien Vehent 5a1d965600 [minor/bug] fix handling of error in client print action results 2016-05-13 16:58:05 -04:00
Julien Vehent 5640de67bd [minor/bug] fix infinite loop in mig client when printing results 2016-05-13 16:33:48 -04:00
Julien Vehent 23dbcd98b3 [minor] better handling of api errors in client 2016-05-03 16:09:24 -04:00
Aaron Meihm f0cd2c69a6 Merge pull request #216 from ameihm0912/api-auth
Minor improvements to loader API authentication
2016-04-26 09:50:47 -05:00
Aaron Meihm 0fbf224f8a [minor/bug] read entire response body before client retry on 401
We need to make sure even if the previous request is being discarded we
read the entire response body. If not, this can result in the subsequent
Do() call returning an error related to request cancellation.
2016-04-25 15:23:47 -05:00
Aaron Meihm 6cb30162c9 [medium] mig-console and api loader key change support 2016-04-25 13:46:20 -05:00
Aaron Meihm 12765044c4 [minor] update numeric HTTP status codes to use values from net/http
had a mix of both, this should clean the rest of them up.
2016-04-20 16:47:47 -05:00
Aaron Meihm 461163a032 [medium] add console loader management operations 2016-04-20 16:47:47 -05:00
Aaron Meihm da8bbb2ee5 [minor] add loader search to console 2016-04-20 16:47:47 -05:00
Aaron Meihm 0858d284bc [medium] add functions to list target loader entries in manifest reader 2016-03-24 17:08:14 -05:00
Aaron Meihm 58644787bf [medium] add console and api functionality for manifest creation 2016-03-24 17:08:13 -05:00
Aaron Meihm 97cac21624 [minor] manifest signature status reset from console 2016-03-24 17:08:13 -05:00
Aaron Meihm 3f6cde53d6 [minor] correctly report success for console manifest signature op 2016-03-24 17:08:13 -05:00
Aaron Meihm 7c897edc06 [major] Initial code for mig-loader
Checkpoint commit for initial revision of mig-loader related code. This
change adds functionality supporting agent auto-update using manifests
stored in the API.
2016-03-24 17:08:13 -05:00
Aaron Meihm 1d73fab48e [medium] move compression apply into client package 2016-01-22 14:14:17 -06:00
Julien Vehent 8541f1a2d6 [minor] show a pretty progress bar when follow actions in clients 2016-01-14 15:25:36 -05:00
Julien Vehent 45495bab90 Merge branch 'master' of https://github.com/mozilla/mig 2015-10-19 08:02:19 -04:00
Julien Vehent d7ce05d15a [minor] clients requires TLS1.2. deal with it! 2015-10-18 09:11:14 -04:00
Marco Vanotti 0d6d452a32 [minor] better description on gpg key not found on client
When the .migrc is missing, a new one can be created, and if gpg is
installed, but there is no suitable key in the secring file, it will
display an error saying "No suitable key found". This commit also adds
to the error description the file which was inspected.

This fixes issue #132.
2015-10-09 11:02:23 -03:00
Julien Vehent 37a7c33cc8 [minor] better errors handling in client package 2015-10-05 10:50:29 -04:00
Aaron Meihm a72cc73cb3 [minor] honor os proxy environment variables in client 2015-09-28 17:13:58 -05:00
Julien Vehent 765db7647f Merge pull request #87 from mozilla/fixsearch20150919
Fix various DB Query issues
2015-09-23 13:03:44 -04:00
Julien Vehent 7e4d77c28f [minor] cleanup search code in db/console/api/scheduler 2015-09-23 12:57:39 -04:00
Julien Vehent c18cdc2a7c [minor] return limited fields when evaluating agents target 2015-09-23 11:10:42 -04:00
Aaron Meihm 7e683803d1 [minor/bug] make sure response body is closed in GetAPIResource() 2015-09-18 11:03:42 -05:00
Aaron Meihm 9d313e3932 [minor] support pre-cacheing gpg passphrase for automated operation 2015-09-17 13:43:11 -05:00