Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "CVE-2022-29583 (#624)" #638

Merged
merged 1 commit into from
Nov 16, 2022
Merged

Conversation

adam-mateen
Copy link
Contributor

@adam-mateen adam-mateen commented Nov 16, 2022

Comments on the original PR state that the CVE never affected CloudWatch Agent.
We decided to upgrade the dependency anyway, thinking it would be harmless.

Description of the issue

kardianos/service 1.2.2 causes this failure:

PS C:\Program Files\Amazon\AmazonCloudWatchAgent> .\amazon-cloudwatch-agent-ctl.ps1 -a start

****** Processing amazon-cloudwatch-agent ******
Start-Service : Service 'Amazon CloudWatch Agent (AmazonCloudWatchAgent)' cannot be started due to the following
error: Cannot start service AmazonCloudWatchAgent on computer '.'.
At C:\Program Files\Amazon\AmazonCloudWatchAgent\amazon-cloudwatch-agent-ctl.ps1:132 char:12
+     $svc | Start-Service
+            ~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service],
   ServiceCommandException
    + FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceCommand

More details in this kardianos/service#354

Description of changes

Revert the change.

License

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Tests

  • make build
  • make test

Requirements

Before commit the code, please do the following steps.

  1. Run make fmt and make fmt-sh
  2. Run make linter

This reverts commit 7f1ad9e.
Windows Start-Service will fail when using kardianos/service 1.2.2.
Revert to 1.2.1.
@adam-mateen adam-mateen requested a review from a team as a code owner November 16, 2022 16:41
@adam-mateen adam-mateen merged commit c855010 into aws:master Nov 16, 2022
@adam-mateen adam-mateen deleted the revert_kardianos branch November 16, 2022 16:44
muellerk22 added a commit to Cloudzero/amazon-cloudwatch-agent that referenced this pull request Feb 20, 2023
Add the 'aws_sdk_log_level' option to Agent's JSON config.
Updated schema to describe the new config option.
Allow multiple log levels to be specified separated by a vertical bar and optionally white space.
Updated all existing uses of aws.Config{} to use the new the new SDKLogger{} struct and SDKLogLevel() function.
Added unit tests.

* Added support for implicit NetworkMode. (aws#335)

* Added support for implicit NetworkMode.
Fixed aws#330.

* Agent-side log filtering (aws#327)

* Fix missing Windows events by changing getRecords(). (aws#333)

* Fix missing Windows events by changing getRecords(). Add unit tests.

* force consistent log stream name (aws#337)

* fix duplicate retention check (aws#339)

* fix duplicate retention check

* remove formatting change

* fix test case messages

* check retentionSettings in 1 loop

* remove comments

* add comment and fix formatting

* handle case where the same retention setting for a loggroup is set in different places

* update test cases and error message

* remove extra white space

* Address flaky tests in GitHub CI (aws#340)

* testing sleep periods in GitHub CI

* tweak sleep duration

* tweak sleep duration

* Grammer and spelling touch up for translator tests (aws#343)

Co-authored-by: Andrew Huynh <17056456+SaxyPandaBear@users.noreply.github.com>

* Add a feature flag to user agent for container insights (aws#342)

* Add a feature flag to user agent for container insights

* Update agentinfo.OutputPlugins directly instead of parsing.

* Add TestUserAgent and fix test cases.

* Add function to reset user agent string.

* Reset the user agent string before constructing for container insights. Refactor and add test cases.

* Move the regex for container insights to top level to reuse it.

* Refactor to store userAgent string in map with group name as key.

* Move test cases for container_insights flag to agentinfo.

* Update test for container_insights and minior refacotr.

Co-authored-by: Thomas Yang <yangth@amazon.com>

* Adding support for Drop original dimensions when aggregating (aws#336)

Drop original metrics when aggregating
1. Translate drop original flags config at metrics level
2. Drop metrics based on the metric names when the output plugin is configured
3. Unit tests for config translation and config reading

*4. resolve comments and refactor the metrics.go adding output plugin method.

* support wildcard to drop all metrics

* Add concurrency for pr (aws#346)

Co-authored-by: Nguyen <khanhntd@88665a0eaf54.ant.amazon.com>

* update runner to use windows server 2019 (aws#352)

* update systemd network target (aws#344)

* Address naming rules with CronJobControllerV2 for k8s v1.21 (aws#345)

* Breakout unit testing per OS

* Breakout unit testing per OS. Issue: aws#353

* removed upload step from build-test-macos.yml

* added on push main, to support future migration to this branch

* removed strategy since we aren't using matrix for github

* removed unused step for linux and macos

* removed the 'restore-keys' to avoid caching old dependencies pkgs

* added back the upload to Codecov in macos

* removed useless 'id' in the setup

* removed restore-keys in windows workflow, changed the testing by installing make, doing make test and make build, added upload to codecov in the windows pipeline

* change jobs name in linux and macos to match the windows pipeline

* removed runner cache, based on test done by khanhntd

* added license on top of files, added the on push main branch in build-test-windows.yml

* removed useless 'Debug go.mod' step since we do not use restore-keys anymore

* Add CodeQL analysis for security checks, errors (aws#356)

* Add CodeQl analysis

* Add license for security check

* Export Task ARN resource via Prometheus (aws#334)

* Export Task ARN resource via Prometheus
* Populate cluster name and task id labels

* Fix typo in setGid function. (aws#359)

* Increase Aggregator Test Timeout (aws#366)

* Add Support For RHEL and Oracle AMI Tests And Upload Integration Test Binary To S3 Instead Of Building On EC2 Fixes (aws#364 And aws#369) (aws#368)

* Add Verify Linux Ctl Integration Test (aws#373)

* Support AMI Pipelines (aws#375)

* update release notes with the 350 release (aws#383)

* update README with log filtering info  (aws#380)

* add filtering docs to log filtering section

* Have LocalStack On 1 EC2 Instance (aws#384)

* Clean Integration Test AMI That Are Older Than 60 Days (aws#376)

* Fixing windows event messages truncated on Windows server 2022 (aws#379)

* debug logs

* more log

* attempt fix the decoding

* Fix with a dynamic length calculation, remove debug logs, add unit tests.

* unit test run on Windows 2019 only

* Restart agent on RPM upgrade (aws#387)

* add posttrans scriptlet that uses conditional restart after RPM upgrade

* fix scriptlet

* create aoc user if not exists on the host

* Build MSI For Integration Test (aws#388) (aws#389)

* Fix MSI Version Converter By Adding Imports (aws#390)

* Fix missing go.sum entry for module providing package github.com/google/go-cmp/cmp For Nightly Build (aws#392)

* Add shfmt and gofmt tools for formatting go and sh files (aws#349)

* add tools for fmt

* add back aws-otel-collector

* fix fmt

* add go import and find shell

* Fix format based on go import

* add install tools for shfmt

* Format go files and sh files

* Bring back -help output (aws#394)

* Bring back -help output

* Remove dead code

* ECS Service Discovery: Fixup implicit network mode (aws#385)

I originally submitted aws#330
with the goal of correcting the service discovery behavior of a task when its
definition did not specify a network mode.

Very graciously, @javabrett submitted a fix for this via
aws#335. Upon testing this out
today, I found out we're not _quite_ there.

Crucially, when network mode is undefined in a task definition, it will parse as
`nil`, not the empty string. Correcting this in our unit tests reveals the
behavior isn't working as desired, since the `getPrivateIp` function isn't
properly handling the `nil` case. I believe this addresses the issue.

* retry on network failure for detecting EC2 (aws#397)

* retry on network failure for detecting EC2

* fix error variable name, fix retry loop

* use network access check instead of simple retry on metadata endpoint

* revert systemd network target config

* cut scan length to 20 bytes (aws#402)

* Make cloudwatchlogs's pusher wait for the final flush to complete before returning (aws#350)

* Make cloudwatchlogs pusher's Close wait for the final flush to complete before returning.

* Share stop channel and wait group across all pushers.

* Stop pusher retries when stop requested.

Co-authored-by: Brandon Dahler <bnd@amazon.com>

* Redo winevt log length detection (aws#403)

* Redo winevt length calculation logic

* Set scan length back to 100 and set log to info level

* Add reset func in test, re-scope utf16ToUTF8Bytes()

* Add wait group in TestLogsFileAutoRemoval to avoid checking file exists before removing file (aws#406)

* Add wait group for avoiding checking file exists before removing file

* Delete sleep

* Switch the toToml unit test from using string to Toml struct comparison (aws#357)

* Switch the toToml unit test from using string comparison to Toml struct comparison for more tolerance to toml format changes

* Resolving comments for toml comparison

* Allow account ID as placeholder value for log configuration (aws#400)

* Run Go Mod Tidy (aws#408)

* Add Go Tidy Check To PR (aws#409)

* Do Not Run montudor/action-zip@v1 When Previous Build Pass (aws#410)

* Add Terraform For Windows Test (aws#391)

* Support Local Testing Of Terraform (aws#411)

* Support Fork Testing On Personal AWS (aws#414)

* update error handling to account for ResourceAlreadyExists gracefully (aws#416)

* update error handling to account for ResourceAlreadyExists gracefully

* code cleanup, don't error on PutRetentionPolicy for non existent log group

* fix log message

* Fix log message

* code cleanup

* fix tests

* Use aptdcon Ubuntu Fixes (aws#426) (aws#428)

* Build Mac PKG (aws#422)

* sync Go version used in GitHub actions to 1.15.15 (aws#429)

* sync Go version used in GitHub actions to 1.15.15

* fix go mod tidy version

* Move conflicting retention check to translator (aws#418)

* Add error log before conflicting retention values for the same log group is found and stops the agent

* use fmt message for both logs

* move duplicate retention logic to translator

* fix test

* check for null during log group name conversion

* fix test case

* refactor checkDuplicateRetention to util folder

* restore old test case

* add test case to window events

* adjust comments and fix tests

* simplify function names

* add retention key

* Change to onPremise for all CWAgent component binaries and add executable path for Darwin (aws#417)

* Add default for Darwin in translator util

* Change to onPremise for all param mode

* Change binary path to linux

* Add mode auto for config and setm ode

* Remove mode config

* Add writing to CWAgent's log before a panic (aws#421)

* Add log before panic and translate some err to e in test case

* Continue to add log before panic

* Fix some corresponding error

* Add package fmt for cadvisor linux

* Delete some log before panic

* Delete log before panic with internal

* Change to log.Panicf

* Delete panic for cw

* Fix some issues

* Add some log before panic

* Add log before panic for ecs service discovery

* Fix some logs for translator

* Change back to invalid chunk size

* Change e to err for some test

* FOrmat go

* Delte unreachable

* Change log.Panicf to log.Panic for some logs

* Change to err for some files

* Revert some error changes

* Fix some typo

* Change back for some logs and fix typo

* Fix package issue

* Fix some type and add panic

* Fix failing windows event log unit test. (aws#431)

* Fix failing windows event log unit test.
Ignore EvtFormatMessage() errors if data is returned.

* Run unit tests on Windows Server 2019 and 2022/latest.

* Do Not Cache Full Binary Files As We Use S3 (aws#439)

* Add GPG Signing For Packages Fixes (aws#420) (aws#438)

* Refactor GPG_TTY ENV Var In Integration Test YML (aws#441)

* Generate JSON File With Linux Test AMI X Tag (aws#440)

* Add integration tests for publishing to CloudWatch logs (aws#436)

* write integration test for publishing logs to CW

* Some code cleanup

* cleanup

* debugging

* clean up, added logging

* move log writing script

* fix file name of script

* try to fix failed SDK usage

* export region from TF to GitHub runner

* wrote integ test for log filtering, started readme rewrite

* update ubuntu install to not hang

* code cleanup and fix start time

* fix tests, code cleanup

* fix tests to allow concurrent runs

* add sudo

* format timestamp string for log

* update integ test README

* Revert ubuntu install command

* run go mod tidy

* updated test to write to log file natively in Go

* fix log write to separate by 1ms each batch

* debugging

* go mod tidy

* code cleanup

* fix bad import

* update terraform installation in README

* address PR comments

* Include metric name in warning message when value is negative. (aws#445)

* Include metric name in warning message when value is negative.

* Add Retry To Integration Test (aws#444)

* Fix ubuntu integration test gcc error, fix CWL integration tests (aws#446)

* fix gcc failure on ubuntu

* update to use log.Panic instead of just panicking

* paginate over GetLogEvents in test

* add custom retryer

* don't use paginator struct

* fix nil reference

* tweak timing

* code cleanup

* update docs on integration test setup

* update README

* update install to apt instead of apt-get

* revert apt install change for ubuntu integ test

* update README to clarify security group config

* Fix localstack port

Co-authored-by: Andrew Huynh <andhuy@amazon.com>

* Clean Dedicated Hosts (aws#448)

* Add CODEOWNERS and issue template for reporting bugs, feature requesting (aws#450)

* Add auto assign and issue template

* Add code owners

* Add Integration Test For Metric Number Of Dimension (aws#451)

* Add set of requirements for PR and add go linter tools for checking security, format, simplify... (aws#443)

* Add go lang ci linter for cloudwatchagent

* Disable gofmt and go imports

* Add binaries with make

* Add comments

* Add golint and change linter to lint

* Add scrapping ECS_CONTAINER_METADATA_URI_V4 for ECS  (aws#453)

* Add metadata point v4 and delete run in aws

* Add log and delete flag

* Add some interface and add final endpoint v4

* Fix some typo and add interface

* Fix typo

* Delete apply interface

* Delete interface and debug

* Delete Ecs Util instance variable

* Add back ecsUtilInstance

* Add type assertion

* Delete type assertion

* Add type assertion again

* Delete type assertion

* Fix typo and nitpick

* Add back mode EC2

* Add runinAws

* Add type assertion

* Add type assertion

* delete type interface

* Add log for validating

* change to parse ecs region

* Build back image

* Revert back to original

* Add back strings

* Add parseClusterName

* Parse the cluster

* Delete parse cluster

* Delete go proxy

* Fix testing

* Delete statefile when tailer terminates due to an error (aws#457)

* set 1mb threshold for file offset

* change log to debug level

* delete statefile when log file is deleted

* close channel earlier

* change hook where statefile gets deleted

* add log

* return

* add integration test

* code cleanup

* code cleanup

* debug for windows test failure

* account for Windows file management

* add more debug

* update state file permissions to match ioutil

* Revert "update state file permissions to match ioutil"

This reverts commit 7cac8c1.

* close state file in test

* code cleanup

* update test description

* added comments

* Enhance config validation for bad regex in CWAgent (aws#459)

* Check if regex is valid in GO when applying rules for log filter and timestamp.

* Add test case for log filtering validation.

* fmt changes.

* Remove redundant test and duplicate logging

* make fmt && make fmt-sh

* Add test case for invalid timestamp format.

* Add ECS Metadata Integration Test for detect changes in ECS Container Agent Metadata Endpoint (aws#458)

* Initial commit for ecs

* Add basic for fargate with terraform

* Fix typo for CWAgent config

* Add some tpl files for task def

* Add new policy

* Add basic components for CWAgent fargate on terraform

* Finish formating terraform

* Add basic testing

* Add basic testing

* fix some constraint

* change to us west-2

* Add emf processor for config and sample app

* Add redis sample app

* Add redis sample app

* Add basic testing for ecs fargate

* reduce variables

* Add readme doc and use make fmt

* Add basic integration test on github workflow

* delete xtool

* Fix json config for default and ecs

* Add ecs linux fargate and integration test

* Change image repo again

* Test integration test workflow

* Delete branchs for testing

* Test workflow

* Fix tag for build docker image

* Change back to format

* Add back build constraints

* Change to use test cwl

* Change name to ecs fargate

* Change to path go.mod

* Fix variables and fix default extra app

* Delete retry for testing

* Add lock

* Add unique for service role

* Test and fixing readme

* Add security group

* Fix path testing

* Test ecs

* test for success path

* Test again with go

* Test again for constraints

* Test again

* Add basic testing

* Change to cwagent integration test

* Add back from source

* Fix deprecated vpc and fix cloudwatch agent config issue

* Fix cloudwatch agent issues

* Add back check_secrets

* Add back ECS fargate

* Print Out Dedicated Host State In Clean Action (aws#449)

* fix YAML for terraform destroy (aws#461)

* Increase Max Dimensions To 30 (aws#398) (aws#361)

* update Release note with GPU metrics info (aws#467)

* Fix auto_removal feature so log lines are NOT dropped from old file (aws#452)

* Fix Tail.sendLine() to NOT drop log lines when the tailer is dying because of errStopAtEOF.
* Simplify TestLogsFileAutoRemoval().

* Change to us-west-2 for ECS Fargate Integration Test (aws#472)

* Change to us-west-2 for ECS Integration Test

* Add debug for verify v4 metdatawork agains on ingration test workflow

* Delete previous log debug because v4 works perfectly

* Support setting retention to 6, 7, 8, 9 years (aws#469)

* Support setting retention to 6 years

* add support for 7, 8, and 9 years to match logs team

* add coment for validRetentionInDays

* change doc to link to cloudwatch agent docs

* Update EC2 integration test README to include Windows ports (aws#475)

* started consolidated integ test README

* moved EC2 README

* update GitHub actions to ignore markdown files

* Using cmd/c to avoid PowerShell ISE does not accept stderr (aws#473)

* Change use cmd/c for creating new shell to package all stderr -> stdout

* Add 2>&1 for otel collector and fix some typo

* Add comments for config-translator

* Add comment and fix comment for config translator, config downloader and also schema test

* Avoid exit immediately when ADOT Collector fails (aws#477)

* Avoid exit immediately when Otel fails

* Add comment for why using return instead of exit

* Avoid exit immediately when ADOT Collector fails (aws#477) (aws#482)

* Upgrade telegraf v1-23-0 (aws#437)

* Upgrade telegraf version to aws version of 1.23.0, bump go version to 1.17, make necessary changes to fix building errors.

* Bump Go version to 1.17 and make adjustments accordingly

* Bump github yaml go versions to 1.17.8

* WIP: dep fix

* Fix Cadvisor and Remove Cadvisor For Darwin (aws#454)

Update Cadvisor, Runc, GOPSUtil

* Create separate RegisterEventLogger for non-windows and windows

* Lumberjack logger fix

* Use Empty Context For K8 Endpoints

* Add k8 Logging (aws#466)

* Fix K8 namespace_number_of_running_pods

* Make Opts Empty Instead Of Var

* Echo TOML Output

* Upload To Public Test ECR

* Use Public Test ECR

* Add Log Line For Checking EC2 Metadata

* Remove Not Needed Log Line

* Add Back {{cluster_name}} From Hard Coded Cluster

* Mount Containerd Sock

* Update scraper code in start.go

* Use https://github.com/aws-samples/amazon-cloudwatch-container-insights/blob/master/k8s-deployment-manifest-templates/deployment-mode/service/cwagent-prometheus/prometheus-eks.yaml For Prometheus EKS Yaml

* Update Prometheus Version

* Init Prometheus Discovery

* Add Go Mod Caching To Dockerfile

* Fix Haproxy Missing haproxy_backend_http_responses_total$

* Post rebasing go mod tidy and vender sync

* Resolve Some Comments

* resolving comments

Co-authored-by: Seth L <81644108+sethAmazon@users.noreply.github.com>
Co-authored-by: Seth Levine <sethlevi@amazon.com>

* Using different cache key for different test case (aws#484)

* Allow escape spaces for Windows Package (aws#490)

* Add Oracle Linux 8.6 to integration test (aws#486)

* Update README.md

* add oracle linux v8.6 to integ test suite

* remove unnecessary s3 policy

* update note

* Increase Timeout, Sometimes CA Bundle Test Needs More Time To Run (aws#493)

* Bump Go version to 1.18.3 (aws#492)

* Delete log file after done writing in CWL integ test (aws#495)

* Nvidia windows (aws#487)

* Add support in config translator for window OS

* make fmt changes

* Reduce timeout for scrapping IMDS and give instruction when fail to scrape IMDS inside container (aws#480)

* Fix Aggregrator Shut Down Behavior

* Always setting hops to 2 if CloudWatchAgent is deployed as container

* Reduce timeout for scrapping IMDS and give instrucstion when timeout--ammend

* Reduce timeout for scrapping IMDS and give instrucstion when timeout--ammend

* Reduce timeout for scrapping IMDS and give instrucstion when timeout--ammend

* Reduce timeout for scrapping IMDS and give instrucstion when timeout--ammend

* Reduce timeout for scrapping IMDS and give instrucstion when timeout--ammend

* Reduce timeout for scrapping IMDS and give instrucstion when timeout--ammend

* Reduce timeout for scrapping IMDS and give instruction when fail to scrape IMDS inside container

* Export Go Bin Path (aws#498)

* Performance Tracking Integration Test and Data Collection (aws#497)

* Initial commit for GetMetricData query utilities

added configuration file for CWA test

inital commit for data collection/GetMetricData portion of test

initial commit for main test driver that starts agent and then calls data collection

changed test error to fatal if error is returned by data collection

added comments

removed unnecessary code that prints output

* copy CWA config file to it's destination

* changed log print to error return in utilities. few small formatting changes

* implemented feedback from PR. Biggest change is dynamically grabbing metric names from config file instead of them being declared in the code

* fixed creation of metric names for query and added comments

* fixed config spacing

* fixed agent runtime

* addressed more pull request comments. Moved config parsing to a new function

* Update release note V352 (aws#502)

* Support escape path for MacOs, Linux (aws#499)

* Support scrapt paths for Linux,MacOs

* Support escape path for MacOs, Linux

* Basic Functionality for Performance Tracking's DB (aws#496)

* Basic functionality for backend transmitter

removed unit tests

playing around with github

changed package name

seperated the test case

reformatted

removed seperate test

changed package

new IntegrationTest Setup

fixed integrationTest.yml

applied pr feedback:
-added new stored data called "CommitDate"
-reorganized code
-updated code to go v2
-changed metrics struct

cleaned workflow init

auto run

typo auto test

cleanworkflow init

added performance test to integrationTest

changed epoch time to int
-after that became an issue in frontend

Delete fastPerformanceTest.yml

Added PR requested changes and comments

backend Fix

* go mod tidy update

* Fix CloudWatch.publish() sometimes not jittering. (aws#501)

* Change CloudWatch.publish() to avoid bursting backend when datumBatchChan is full.
* Change CloudWatch.backoffSleep() to use jitter.
* Update tests.
* Make debug log message less noisy.
* Add explicit test cleanup.

Co-authored-by: Khanh Nguyen <91758108+khanhntd@users.noreply.github.com>

* Support Debian ARM64 Integration Test (aws#500)

* Change to env for GITHUB SHA (aws#507)

* Change sha date to github_sha_date for consistency (aws#508)

* Log the open file count once a second at DEBUG level. (aws#506)

* Increment and decrement a counter variable atomically when files are opened and closed by tail.Tail.
* Log the counter's value once a minute at debug level.
* Update unit tests.

* removed formatting, added stat calculation (aws#509)

* Log AWS provider name (aws#512)

* log credential provider details

* change log location

* clean up if-statement

* include 353 and 354 release notes (aws#514)

* Fix debug logging and revert Windows ctl script PS1 changes (aws#516)

* change to use fmt

* Revert "Using cmd/c to avoid PowerShell ISE does not accept stderr (aws#473)"

This reverts commit 89d1912.

* remove log entirely

* update release notes

* Performance Benchmarking Log monitor and TPS tests (aws#513)

* added concurrent log monitoring/writing to test and tests several combinations of # of logs monitored and different tps

* fixed call to StartLogWrite

* restructured json packet to send to database. CWA configs are now generated at runtime. log number is given as an environment variable so tests can run concurrently, so commented code is included for that change

* rewrote how databse entry packets are crafted/create, defer log stream/group deletions, addressed other small pr comments

* removed extra metrics from CWA config

* separated delete log group and streams so they can be called separately, but kept the original function definition as to not break other code. removed bad calls to DeleteLogGroupAndStreams

* update PMD limits (aws#523)

* disable ec2tagger for kubernetes when onprem (aws#525)

* Fix Cache Go And Binary (aws#529)

* Update Deprecated CodeQL (aws#531)

* Fix Code Scan Bug https://github.com/aws/amazon-cloudwatch-agent/security/code-scanning/4 (aws#530)

* Added concurrent testing and release updates (aws#526)

* Added concurrent testing and release updates

clean up

go mod tidy

* added the git date env variable

* applied pr comments

* Applied PR changes
* Moved retry to updateItem
* cleanup

* bug fixes

* fixed error due skipNow

* updated the release tag

* working release test

* Applied PR changes #3

* go mod tidy

* tried resetting go mod

* small fix with expression update

* changed and to coma

* changed expression

* go mod tidy

* Added concurrent testing and release updates

clean up

go mod tidy

* Update Deprecated CodeQL (aws#531)

* Fix Code Scan Bug https://github.com/aws/amazon-cloudwatch-agent/security/code-scanning/4 (aws#530)

Co-authored-by: Seth L <81644108+sethAmazon@users.noreply.github.com>

* update github action (aws#533)

* Do Not Use Zip Action (aws#534)

* Created Terraform Assume Role (aws#535)

* Add Permissions (aws#536)

* Only Use Assume Role Creds (aws#538)

* Fix Create MSI (aws#539)

* convert byte to mb (aws#540)

* support onprem and onpremise and support windows msi installer w silent exec (aws#543)

* support onprem and onpremise and support windows msi installer w silent
exec

* Release's Name Update (aws#544)

* get release tag

* release updates hash now

* is release true bug fixed

* added error catching

* rename release test

* cleanup

* Update cwa ctl agent stop to use systemctl instead of service cmd (aws#542)

* Clean More Regions Deprecated Pipeline (aws#563)

* Add More Regions For Cleaning Mac (aws#564)

* Remove Opt-in Regions (aws#565)

* update statefile cleanup error log (aws#566)

* Fix duplicate retention case (aws#556)

* Fix duplicate retention case to set retention as long as there is a write to a log group

* fix collect_list test

* fix collect list test 2

* fix collect list conflicting test

* remove unnecessary true check

* reduce src function calls

* add unit test for checkRetentionAlreadyAttempted

* Merge cleaning aws resources (aws#569)

* Merge cleaning aws resources

* Fix the naming

* No Need To Test Multiple Sub Version Of Linux OS (aws#573)

* Update dependencies for nats-io/jwt and opencontainers/runc (aws#577)

* Fix Source Label Proxy For haproxy_backend_http_responses_total (aws#581)

* Create Docker Container With Local Deb To Reduce Docker Container Build Time In Integration Tests (aws#582)

* Add Sanity Check for Windows Integration Test  (aws#478)

* Reformat terraform code for windows ec2 integration test

* Add sanity check for windows

* Add sanity check for windows

* Change Integration Test Name to CI and final touch for sanity check

* Add Todo back and use terraform format

* Refactor ReadMe document and also add Windows Integration Test

* Refactor Sanity Check for Windows

* Delete text profile

* Address comment in PR

* Finish Sanity check for windows

* Finish Sanity check for windows

* Fix Type Issue In Ethtool Test (aws#583)

* Reduce code for ethool test and change variables for terraform script (aws#584)

* Fix key for integration test

* Format ethool and merge

* Fix Ethtool Name In Input Config (aws#585)

* Drop Support for ADOT Collector (aws#522)

* Drop AOC support

* Drop support for AOC
rebase stale branch

* Delete version file

* Delete postint

* Change flag order

* Drop test and check secret for testing

* Recover back aws password and aws for testing

* Delete gpg key signing

* Update delete submodules

* add version without sed

* add version without sed

* Add fetch depth back

* Revert integration test and makefile

* Delete space

* Merge conflicts from master

* Fix aoc users and group

Co-authored-by: Yared <45324375+ymtaye@users.noreply.github.com>
Co-authored-by: Yared Taye <vtayyare@amazon.com>

* Upgrade containerd to v1.6.8 (aws#591)

* Add NVIDIA GPU Integration Test and Security Checking for binaries (aws#579)

* Change to ec2 linux avance and simple

* Add basic NVIDIA GPU for Linux

* Add basic check file control for windows

* Add basic nvidia check

* Add support for linux al2

* Change to user data

* Basic OPENSSH

* Basic OPENSSH

* Return to test integration test on github

* Basic OPENSSH

* Basic OPENSSH

* revert some gpg

* Finish security checking and nvida gpu

Co-authored-by: Ameen <ateeqi@amazon.com>

* Fix integration tests (aws#597)

* Clean up bundle AOC related status

* fix amazon-cloudwatch-agent-ctl

* fix ctl scripts

* clean up ADOT status check

* remove mention of -o in ctl help

* clean up WIN usage prompt

* clean verifyLinuxScript

* apply PR suggestions

* remove logic to check cwoc config

* Fix issue 588 on premise (aws#598)

* Fix issue 588 related to onPrem flag and clean sanity scripts

* remove aoc userdel

* modify all ModeOnPrem

* revert change to IsOnMode

* fix invalid mode log message

* Readme (aws#601)

* Update testing README to reflect up-to-date requirements

- Background: Some process improvements were made to automate setup steps.
- Problem: README wasn't updated with the new steps and IAM policy requirements. Couldn't get the workflow to reach a stage where it runs ec2 integraion tests
- Fix: Updated README
- Verify: Ran on my personal fork and verified ec2 integ tests start running.
- Next: Some cleanup steps may be still failing, as well as other non-ec2 tests. Will continue to update README whenever new issues are encountered.

* Remove link to internal wiki

* Remove Windows Tests Until We Figure Out SSH Without Windows Passwrod (aws#602)

* Fix Broken Tests Not Being Run (aws#603)

* Add iam role policy in readme for test cleanup (aws#608)

* Initial support for ubuntu 22.04 (aws#589)

* Add ARM64 Darwin Support (aws#607)

* Test CPU metric values greater than zero (aws#609)

* Add cpu_usage_active test to verify >0 value

* Add all cpu metric test and refactoring for extensibility

* Linter

* Improve code quality based on reviews

* Found how to use composition for shared interface implementation

* Simplfy based on review comments

* Add Release Notes For Version 1.247355.0 (aws#612)

Update Cloud Watch Container Version

* Refactor benchmark test package for future tests (aws#611)

* Create suite for all benchmark tests

* Pull out agent runner function for reuse

* Print test suite result summary together

* Fix incorrect test result accumulation logic

* Fix suite assert misusage

* Separate out files per test group

* Fix undefined variable mistake

* Separate out placeholder test

* Move add test result function out of cpu file

* Make fmt changes

* fix syntax error

* Refactor using template method pattern

* make fmt result

* Fix swallowing error cause problem

* Cleanup config file after test

* Sanity test validation fix (aws#614)

* Change sanity validation from >0 to >=0 to match manual test validation process

* Fix quest typos to guest that causes test failure

* Fix more quest typos

* Change error message to reflect validation requirement change

* e2e mem sanity test (aws#617)

* add mem e2e test, clean up integ test workflow/docs

* fix placeholder runner, add mem test to benchmark suite

* implement mem fetcher, code cleanup

* implement mem fetcher, code cleanup

* remove bad metric dimension

* fix measured metrics

* fix fetcher names

* update README, formatting

* add license header

* remove placeholder test (aws#618)

* Fix flaky aggregator shutdown test. (aws#619)

* Fix flaky aggregator shutdown test.

* E2e test package separation (aws#622)

* Fix generateTestMatrix workflow step

* Fix startlocalstack step

* Fix ec2linuxintegrationtest

* Fix stoplocalstack

* Fix MakeMSIZip

* Fix checkout repository argument

* Fix MakeMacPkg

* Fix ECSFargateIntegrationTest

* Fix EC2NvidiaGPUIntegrationTest

* Fix PerformanceTrackingTest

* Fix matrix generation invalid file path

* Use env variables for test repo name and url

* Fix Env variable failure (aws#623)

* CVE-2022-29583 (aws#624)

Co-authored-by: jean hamman <jean@sharpspring.com>

* Comment out performance test that is buggy and no public release (aws#630)

DDB primary index shouldn't be YEAR+CommitDate as that makes the workflow fail if there were two commits on the same day

* Fix parsing win event log message (aws#627)

* Fix win event message to insert strings for placeholders

* Add test cases for insertion strings

* Add comment to insertPlaceholderValues

* Update test and test cases for insertPlaceholderValues

* Add UserData as a source of insertion strings

* Fix typo in comments. Update comments. Rename variable names

* Add test cases for EventData/UserData in windowsEventLogRecord

* Fix pointer issue in TestUnmarshalWinEvtRecord

* Delete integration directory after test package separation (aws#625)

* Delete integration directory after test package separation

* go mod tidy run changed go sum file

* go mod tidy after removing some dependencies

* go mod tidy with go 1.18.3 instead of 1.19

* go sum cleanup

* move daily cleanup code out from integration

* clean daily resources workflow fix

* add go.sum

* match go.mod to 1.18.3 results

* Remove internal/atomiccounter. Use sync/atomic from Golang 1.19. (aws#631)

* Remove internal/atomiccounter. Use sync/atomic from Golang 1.19.

* Fix github actions to use go 1.19. (aws#633)

* Disable nvidia gpu metrics on windows (it has never been released). (aws#632)

* Disable nvidia gpu metrics on windows (it has never been released).

* Revert "CVE-2022-29583 (aws#624)" (aws#638)

This reverts commit 7f1ad9e.
Windows Start-Service will fail when using kardianos/service 1.2.2.
Revert to 1.2.1.

* Updates to adapt to default branch as main (aws#637)

* Fix create_rpm.sh from reading a file that does not exist. (aws#642)

* Update AWS SDK Go for make build mac success (aws#640)

* Sync Use crazy-max/ghaction-import-gpg@v5.0.0 From Private Repo (aws#643)

* Change nick-invision/retry to nick-fields/retry (aws#55) (aws#644)

* Use Systemctl Command To Restart Agent (aws#645)

* Change LogFile.restoreState() so it does not return negative offset. (aws#646)

* Add ECS EC2 Launch Type Daemon Deployment test workflow (aws#639)

* Change intergaration test workflow for ecs test base

* Use test branch for generate matrix

* Fix typo

* Fix test branch name

* Add instance type and ami to ecs test

* add a new ecs ec2 launch daemon test workflow

* Remove cache for ecs test

* Reset test repo back to non-fork

* Fix DetectAgentMode so auto resolves to onPrem if not ec2. (aws#652)

* Add branch feature for ec2 test (aws#647)

* Add branch feature for ec2 test

* Add branch feature for everything

* Update RELEASE_NOTES for 1.247356 (aws#649)

* Update RELEASE_NOTES for 1.247357 (aws#660)

* Update RELEASE_NOTES for 1.247357

* Add log output when log files are deleted with auto_removal feature aws#636 (aws#659)

* Reduce Name Of EC2LinuxIntegrationTest To Show More Test Info In GHA (aws#666)

* nick-invision/retry@v2 Became nick-fields/retry@v2 Fix ECSEC2LaunchDa… (aws#669)

* CloudZero change to remove customer metrics

* Reduce memory consumption when processing replicasets

* CloudZero does not need to do these builds

* Multiarch build

* * The goal is to reduce the number of metrics transmitted to
CloudWatch Logs.

The CloudZero platform used the metric type "Pod" to tracks pods
across the cluster to allocate spend.  All other metric types are
unnecessary.

* Track ReplicaSet to enable mapping PodName roll up to Deployments.
Only cache ReplicSet that are actively managing pods as ReplicaSet
not managing pod will never need to be looked up.

* add push to Private ECR on non-main branch to enable testing on cluster. Added go build cache

* Build the release branch cloudzero-optimized for release

---------

Co-authored-by: Adam <90734270+adam-mateen@users.noreply.github.com>
Co-authored-by: Brett Randall <javabrett@gmail.com>
Co-authored-by: Andrew Huynh <17056456+SaxyPandaBear@users.noreply.github.com>
Co-authored-by: Ameen <ateeqi@amazon.com>
Co-authored-by: ZhenyuTan-amz <85904276+ZhenyuTan-amz@users.noreply.github.com>
Co-authored-by: taohungyang <proty.ece96@g2.nctu.edu.tw>
Co-authored-by: Thomas Yang <yangth@amazon.com>
Co-authored-by: Khanh Nguyen <91758108+khanhntd@users.noreply.github.com>
Co-authored-by: Nguyen <khanhntd@88665a0eaf54.ant.amazon.com>
Co-authored-by: Guillaume Bchd <45106812+GuillaumeBchd@users.noreply.github.com>
Co-authored-by: leonsodhi-lf <42376753+leonsodhi-lf@users.noreply.github.com>
Co-authored-by: Jeffrey Chien <chienjef@amazon.com>
Co-authored-by: Seth L <81644108+sethAmazon@users.noreply.github.com>
Co-authored-by: Ruben Laguna <ruben.laguna@gmail.com>
Co-authored-by: Will Myers <will@usebutton.com>
Co-authored-by: Brandon Dahler <brandon.dahler@gmail.com>
Co-authored-by: Brandon Dahler <bnd@amazon.com>
Co-authored-by: Andrew Huynh <andhuy@amazon.com>
Co-authored-by: Seth Levine <sethlevi@amazon.com>
Co-authored-by: Hyunsoo Kim <884273+movence@users.noreply.github.com>
Co-authored-by: gmealy1 <107051245+gmealy1@users.noreply.github.com>
Co-authored-by: okankoAMZ <107267850+okankoAMZ@users.noreply.github.com>
Co-authored-by: Kaushik Surya <108111936+sky333999@users.noreply.github.com>
Co-authored-by: Yared <45324375+ymtaye@users.noreply.github.com>
Co-authored-by: Yared Taye <vtayyare@amazon.com>
Co-authored-by: Chena Lee <ChenaCLee@gmail.com>
Co-authored-by: Chena Lee <leechena@amazon.com>
Co-authored-by: J H <74546822+jshsp@users.noreply.github.com>
Co-authored-by: jean hamman <jean@sharpspring.com>
Co-authored-by: tomatod <banaoa7543@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants