Skip to content

Support absolute local paths for "cloudquery policy run" #504

@shimonp21

Description

@shimonp21

Describe the Bug

calling cloudquery policy run with an absolute local path fails. e.g.

calling cloudquery policy run /Users/shimonp/projects/policies-aws//foundational_security currently returns an error:

failed to detect policy in hub: failed to detect url /Users/shimonp/projects/policies-aws: failed to find tags: GET https://api.github.com/repos/cloudquery-policies//tags?per_page=1: 404 Not Found [

Expected Behavior

The policy should run successfully

CloudQuery Version

Version: 0.20.4
Commit: 6a126a673e69afe34e352c03c2e5beb1578687d1
Date: 2022-02-24 09:25:38.950444 +0200 IST m=+0.013723767

Debug Output

9:28AM INF logging configured consoleLog=true fileLogging=true fileName=cloudquery.log jsonLogOutput=false logDirectory=. maxAgeInDays=3 maxBackups=3 maxSizeMB=30 verbose=true
9:28AM DBG adjusting current ulimit new_ulimit=16384 previous_ulimit=256
9:28AM DBG found existing provider provider=aws version=v0.10.5
9:28AM DBG found existing provider provider=aws version=v0.10.5
9:28AM DBG adding migration file file=2_v0.19.3.up.sql
9:28AM DBG adding migration file file=1_v0.19.2.down.sql
9:28AM DBG adding migration file file=1_v0.19.2.up.sql
9:28AM DBG adding migration file file=2_v0.19.3.down.sql
9:28AM DBG update check succeeded, no new version
9:28AM DBG run policy received params: noResults=false outputDir= policy=/Users/shimonp/projects/policies-aws//foundational_security
9:28AM INF Initializing CloudQuery Providers...
9:28AM INF Downloading required providers
9:28AM DBG Downloading required providers providers=[{"Name":"aws","Source":"cloudquery/aws","Version":"latest"}]
9:28AM INF Downloading provider name=aws version=latest
9:28AM DBG downloading checksums file path=.cq/providers/cloudquery/aws/v0.10.5.checksums.txt provider=aws url=https://github.com/cloudquery/cq-provider-aws/releases/download/v0.10.5/checksums.txt version=v0.10.5
9:28AM DBG downloading checksums signature path=.cq/providers/cloudquery/aws/v0.10.5.checksums.txt provider=aws url=https://github.com/cloudquery/cq-provider-aws/releases/download/v0.10.5/checksums.txt version=v0.10.5
9:28AM INF Finished provider initialization...
9:28AM DBG version is latest provider=aws version=latest
9:28AM INF failed to detect policy in hub: failed to detect url /Users/shimonp/projects/policies-aws: failed to find tags: GET https://api.github.com/repos/cloudquery-policies//tags?per_page=1: 404 Not Found []
failed to detect policy in hub: failed to detect url /Users/shimonp/projects/policies-aws: failed to find tags: GET https://api.github.com/repos/cloudquery-policies//tags?per_page=1: 404 Not Found []

Steps to Reproduce

cloudquery init aws
<Authenticate with AWS>
cloudquery fetch
cloudquery policy run <Absolute path to a local policy>

Additional Context

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions