Skip to content

Commit

Permalink
Minor: Sync Release v1.4.6 w v2.0.0 Branch (#386)
Browse files Browse the repository at this point in the history
* Bump to trigger container release (#373)

* Update version

* Update version in "Commits since" badge

* Deploy: Release v1.4.2 (#375)

* Minor: Update app versions

* Switch to goreleaser for container image deploy (#374)

* Remove current container deploy workflow config

* Update goreleaser config and relase workflow for docker release support

* Add new Dockerfile for releases (#376)

This is to be in line with goreleaser reqs

* Migrate from docker/login-action to custom script for registry auth

Required as docker-login-action doesn't support multi-registry authentication.

* Deploy: Release v1.4.5 (#377)

* Minor: Update versions

* Revert migration from login-action to custom

I misunderstood the github action logs :(

* Update Job Permissions to Remove Content:Read Permission

This was overriding the globally-set Content:Write permission.
This caused the GHAW for releases to fail to create a release

* Issue 383 add service to user output (#384)

* Add `CloudSvc` as a attribute of `Resource()`

* Add CloudSvc Value to Output For Found Resource

* Set CloudSvc in All Supported Resource Plugins

* Minor: Fix typo in found resource user output

* Minor: update app version
  • Loading branch information
magneticstain authored Jan 25, 2024
1 parent be82f94 commit de916a3
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![Codacy Badge - Quality](https://app.codacy.com/project/badge/Grade/5137ec7cf2d14a9c9fc3eac1cd37e0d3)](https://app.codacy.com/gh/magneticstain/ip-2-cloudresource/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
[![Codacy Badge - Coverage](https://app.codacy.com/project/badge/Coverage/5137ec7cf2d14a9c9fc3eac1cd37e0d3)](https://app.codacy.com/gh/magneticstain/ip-2-cloudresource/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_coverage)

![GitHub commits since latest release (by SemVer including pre-releases)](https://img.shields.io/github/commits-since/magneticstain/ip-2-cloudresource/v1.4.5)
![GitHub commits since latest release (by SemVer including pre-releases)](https://img.shields.io/github/commits-since/magneticstain/ip-2-cloudresource/v1.4.6)
![GitHub issues](https://img.shields.io/github/issues/magneticstain/ip-2-cloudresource)
![GitHub pull requests](https://img.shields.io/github/issues-pr/magneticstain/ip-2-cloudresource)
![GitHub all releases](https://img.shields.io/github/downloads/magneticstain/ip-2-cloudresource/total)
Expand Down
5 changes: 2 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import (
"github.com/magneticstain/ip-2-cloudresource/utils"
)

const APP_ENV = "development"
const APP_VER = "v1.4.5"
const APP_VER = "v1.4.6"

func outputResults(matchedResource resource.Resource, networkMapping bool, silent bool, jsonOutput bool) {
acctAliasFmted := strings.Join(matchedResource.AccountAliases, ", ")
Expand All @@ -32,7 +31,7 @@ func outputResults(matchedResource resource.Resource, networkMapping bool, silen
acctStr = fmt.Sprintf("account [ %s ( %s ) ]", matchedResource.AccountID, acctAliasFmted)
}

log.Info("resource found -> [ ", matchedResource.RID, " ] in ", acctStr)
log.Info("resource found -> [ ", matchedResource.RID, " ] within ", matchedResource.CloudSvc, " service running in ", acctStr)

if networkMapping {
var networkMapGraph string
Expand Down
1 change: 1 addition & 0 deletions plugin/cloudfront/cloudfront.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func (cfp CloudfrontPlugin) SearchResources(tgtIP string) (generalResource.Resou
for _, ipAddr := range cfIPAddrs {
if ipAddr.String() == tgtIP {
matchingResource.RID = *cfDistro.ARN
matchingResource.CloudSvc = "cloudfront"

if cfp.NetworkMapping {
matchingResource.NetworkMap = append(matchingResource.NetworkMap, *cfDistro.DomainName, *cfDistro.Id)
Expand Down
1 change: 1 addition & 0 deletions plugin/ec2/ec2.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func (ec2p EC2Plugin) SearchResources(tgtIP string) (generalResource.Resource, e

if publicIPv4Addr == tgtIP || IPv6Addr == tgtIP {
matchingResource.RID = *instance.InstanceId // for some reason, the EC2 Instance object doesn't contain the ARN of the instance :/
matchingResource.CloudSvc = "ec2"

if ec2p.NetworkMapping {
matchingResource.NetworkMap = append(matchingResource.NetworkMap, *instance.VpcId, *instance.SubnetId, *instance.InstanceId)
Expand Down
1 change: 1 addition & 0 deletions plugin/elb/elb.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ func (elbp ELBPlugin) SearchResources(tgtIP string) (generalResource.Resource, e
for _, ipAddr := range elbIPAddrs {
if ipAddr.String() == tgtIP {
matchingResource.RID = *elb.LoadBalancerArn
matchingResource.CloudSvc = "elbv2"

if elbp.NetworkMapping {
matchingResource.NetworkMap = append(matchingResource.NetworkMap, *elb.DNSName, *elb.CanonicalHostedZoneId)
Expand Down
1 change: 1 addition & 0 deletions plugin/elb/elb_classic.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func (elbv1p ELBv1Plugin) SearchResources(tgtIP string) (generalResource.Resourc
for _, ipAddr := range elbIPAddrs {
if ipAddr.String() == tgtIP {
matchingResource.RID = *elb.LoadBalancerName
matchingResource.CloudSvc = "elbv1"

if elbv1p.NetworkMapping {
matchingResource.NetworkMap = append(matchingResource.NetworkMap, *elb.DNSName, *elb.CanonicalHostedZoneNameID, *elb.VPCId, utils.FormatStrSliceAsCSV(elb.AvailabilityZones), utils.FormatStrSliceAsCSV(elb.Subnets))
Expand Down
2 changes: 1 addition & 1 deletion resource/resource.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package resource

type Resource struct {
RID, AccountID string
RID, AccountID, CloudSvc string
AccountAliases, NetworkMap []string
}

0 comments on commit de916a3

Please sign in to comment.