Skip to content

[Cisco Ise] Parse TACACS accounting start_time/stop_time with sub-second epoch precision - #19894

Merged
robester0403 merged 5 commits into
elastic:mainfrom
robester0403:cisco-ise-TACACS-time-fix
Jul 6, 2026
Merged

[Cisco Ise] Parse TACACS accounting start_time/stop_time with sub-second epoch precision#19894
robester0403 merged 5 commits into
elastic:mainfrom
robester0403:cisco-ise-TACACS-time-fix

Conversation

@robester0403

Copy link
Copy Markdown
Contributor

Proposed commit message

Parse TACACS accounting start_time/stop_time with sub-second epoch precision

In the log data stream, Cisco ISE TACACS accounting emits start_time/stop_time AVPairs as nanosecond epoch values (e.g. start_time=1782407978339676873), but the pipeline parsed them as UNIX (seconds). The result overflowed to year +292278994, which Elasticsearch then rejected at index time — so cisco_ise.log.avpair.start_time/stop_time were silently _ignored and lost.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
    - [ ] I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
    - [ ] I have verified that Kibana version constraints are current according to guidelines.
    - [ ] I have verified that any added dashboard complies with Kibana's Dashboard good practices

Related issues

Partially Resolves: #19832

Screenshots

Screenshot 2026-06-30 at 5 31 49 PM
@robester0403
robester0403 requested a review from a team as a code owner June 30, 2026 21:45
@robester0403 robester0403 added bugfix Pull request that fixes a bug issue Team:Integration-Experience Security Integrations Integration Experience [elastic/integration-experience] labels Jun 30, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/integration-experience (Team:Integration-Experience)

@vera-review-bot

Copy link
Copy Markdown

👀 I have started reviewing the PR

@github-actions

Copy link
Copy Markdown
Contributor

Elastic Docs Style Checker (Vale)

Summary: 1 suggestion found

💡 Suggestions (1): Optional style improvements. Apply when helpful.
File Line Rule Message
packages/cisco_ise/changelog.yml 4 Elastic.Versions Use 'or later' instead of 'or higher' when referring to versions.

The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale.

Comment thread packages/cisco_ise/changelog.yml
@vera-review-bot

Copy link
Copy Markdown

👀 I have started reviewing the PR

@vera-review-bot

Copy link
Copy Markdown

Vera Review Bot

For the current commit state, I did not find any issues.


🤖 AI-Generated Review | Vera Review Bot | 📚 Knowledge base: integration-skills

⚠️ Automated review — verify suggestions before applying.

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@andrewkroh andrewkroh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using a script processor to centralize and document the approach (prior art). It's probably more readable. Something like this then a single date processor that works on UNIX_MS. It eliminates the digit counting but uses a regex per doc.

- script:
    description: >-
      Normalize the epoch to milliseconds regardless of source unit (s / ms / µs / ns).
      Cisco ISE TACACS+ accounting emits nanoseconds; older data uses seconds.
    lang: painless
    if: ctx.cisco_ise?.log?.avpair?.start_time instanceof String
    source: |
      def s = ctx.cisco_ise.log.avpair.start_time;
      if (s == "0" || !(s ==~ /^\d+$/)) { return; }
      long v = Long.parseLong(s);
      if      (v >= 1000000000000000000L) { v /= 1000000L; } // ns -> ms
      else if (v >= 1000000000000000L)    { v /= 1000L; }    // µs -> ms
      else if (v <  10000000000L)         { v *= 1000L; }    // s  -> ms
      ctx.cisco_ise.log.avpair.start_time = v;
field: cisco_ise.log.avpair.stop_time
pattern: '^(\d{13})\d+$'
replacement: '$1'
if: ctx.cisco_ise?.log?.avpair?.stop_time instanceof String && ctx.cisco_ise.log.avpair.stop_time.length() > 13

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

start_time has a != "0" guard. stop_time does not. Align them.

- gsub:
tag: gsub_cisco_ise_log_avpair_start_time_18d7aae2
field: cisco_ise.log.avpair.start_time
pattern: '^(\d{13})\d+$'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of the new processors have a description. The digit-count magic needs to be explained.

@robester0403
robester0403 requested a review from andrewkroh July 6, 2026 13:00
<181>Mar 20 12:01:20 HOSTNAME_DUMMY CISE_TACACS_Accounting 0000000001 1 0 2026-03-20 12:01:20.528 +00:00 0018415782 3302 NOTICE Tacacs-Accounting: TACACS+ Accounting STOP, ConfigVersionId=78, Device IP Address=198.51.100.11, NetworkDeviceName=DEVICE_NAME_DUMMY, Type=Accounting, Privilege-Level=0, Service=Login, User=USER_DUMMY, Port=/dev/pts/3, Remote-Address=console, Authen-Method=TacacsPlus, AVPair=timezone=GMT, AVPair=task_id=375, AcctRequest-Flags=Stop, Service-Argument=shell, AcsSessionID=HOSTNAME_DUMMY/SESSION_ABC123/SESSION_DEF456, SelectedAccessService=Default Device Admin, RequestLatency=1, Step=13006, Step=15049, Step=15008, Step=15048, Step=22084, Step=13035, NetworkDeviceGroups=Device Type#All Device Types#Cisco, NetworkDeviceGroups=IPSEC#Is IPSEC Device#No, NetworkDeviceGroups=All Platforms#All Platforms#LAB#ACCESS, NetworkDeviceGroups=Location#All Locations#Site-B, CPMSessionID=CPM_DUMMY_001, TotalAuthenLatency=1, ClientLatency=0, Network Device Profile=Cisco, Location=Location#All Locations#Site-B, Device Type=Device Type#All Device Types#Cisco, IPSEC=IPSEC#Is IPSEC Device#No, All Platforms=All Platforms#All Platforms#LAB#ACCESS, Response={AcctReply-Status=Success; },
<181>Mar 20 12:03:20 HOSTNAME_DUMMY CISE_TACACS_Accounting 0000000001 1 0 2026-03-20 12:03:20.528 +00:00 0018415783 3302 NOTICE Tacacs-Accounting: TACACS+ Accounting STOP, ConfigVersionId=78, Device IP Address=198.51.100.12, NetworkDeviceName=DEVICE_NAME_DUMMY, Type=Accounting, Privilege-Level=0, Service=Login, User=USER_DUMMY, Port=/dev/pts/4, Remote-Address=EEM, Authen-Method=TacacsPlus, AVPair=timezone=GMT, AVPair=task_id=376, AcctRequest-Flags=Stop, Service-Argument=shell, AcsSessionID=HOSTNAME_DUMMY/SESSION_XYZ123/SESSION_XYZ456, SelectedAccessService=Default Device Admin, RequestLatency=1, Step=13006, Step=15049, Step=15008, Step=15048, Step=22084, Step=13035, NetworkDeviceGroups=Device Type#All Device Types#Cisco, NetworkDeviceGroups=IPSEC#Is IPSEC Device#No, NetworkDeviceGroups=All Platforms#All Platforms#LAB#ACCESS, NetworkDeviceGroups=Location#All Locations#Site-C, CPMSessionID=CPM_DUMMY_002, TotalAuthenLatency=1, ClientLatency=0, Network Device Profile=Cisco, Location=Location#All Locations#Site-C, Device Type=Device Type#All Device Types#Cisco, IPSEC=IPSEC#Is IPSEC Device#No, All Platforms=All Platforms#All Platforms#LAB#ACCESS, Response={AcctReply-Status=Success; },
<181>Mar 20 12:05:20 HOSTNAME_DUMMY CISE_TACACS_Accounting 0000000001 1 0 2026-03-20 12:05:20.528 +00:00 0018415784 3302 NOTICE Tacacs-Accounting: TACACS+ Accounting STOP, ConfigVersionId=79, Device IP Address=198.51.100.13, NetworkDeviceName=DEVICE_NAME_DUMMY, Type=Accounting, Privilege-Level=1, Service=Login, User=USER_DUMMY, Port=/dev/pts/5, Remote-Address=203.0.113.55, Authen-Method=TacacsPlus, AVPair=timezone=GMT, AVPair=task_id=377, AcctRequest-Flags=Stop, Service-Argument=shell, AcsSessionID=HOSTNAME_DUMMY/SESSION_IP123/SESSION_IP456, SelectedAccessService=Default Device Admin, RequestLatency=1, Step=13006, Step=15049, Step=15008, Step=15048, Step=22084, Step=13035, NetworkDeviceGroups=Device Type#All Device Types#Cisco, NetworkDeviceGroups=IPSEC#Is IPSEC Device#No, NetworkDeviceGroups=All Platforms#All Platforms#LAB#ACCESS, NetworkDeviceGroups=Location#All Locations#Site-D, CPMSessionID=CPM_DUMMY_003, TotalAuthenLatency=1, ClientLatency=0, Network Device Profile=Cisco, Location=Location#All Locations#Site-D, Device Type=Device Type#All Device Types#Cisco, IPSEC=IPSEC#Is IPSEC Device#No, All Platforms=All Platforms#All Platforms#LAB#ACCESS, Response={AcctReply-Status=Success; },
<181>Mar 20 12:07:20 HOSTNAME_DUMMY CISE_TACACS_Accounting 0000000001 1 0 2026-03-20 12:07:20.528 +00:00 0018415785 3302 NOTICE Tacacs-Accounting: TACACS+ Accounting STOP, ConfigVersionId=79, Device IP Address=198.51.100.14, NetworkDeviceName=DEVICE_NAME_DUMMY, Type=Accounting, Privilege-Level=1, Service=Login, User=USER_DUMMY, Port=tty0, Remote-Address=203.0.113.56, Authen-Method=TacacsPlus, AVPair=timezone=GMT, AVPair=task_id=378, AVPair=start_time=1585222245000000000, AVPair=elapsed_time=127, AVPair=stop_time=1585222372000000000, AcctRequest-Flags=Stop, Service-Argument=shell, AcsSessionID=HOSTNAME_DUMMY/SESSION_NS123/SESSION_NS456, SelectedAccessService=Default Device Admin, RequestLatency=1, Step=13006, Step=15049, Step=15008, Step=15048, Step=22084, Step=13035, NetworkDeviceGroups=Device Type#All Device Types#Cisco, NetworkDeviceGroups=IPSEC#Is IPSEC Device#No, Location=Location#All Locations#Site-E, Response={AcctReply-Status=Success; },

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: 🔵 Low confidence: medium path: packages/cisco_ise/data_stream/log/_dev/test/pipeline/test-pipeline-tacacs-accounting.log:23

The new epoch-normalization script has four unit branches (s/ms/µs/ns) but the added test only covers nanoseconds; add fixtures for the second/millisecond/microsecond paths so each branch is exercised.

Details

The added script normalizes start_time/stop_time from seconds, milliseconds, microseconds, or nanoseconds to a millisecond epoch via four branches. The only test line added feeds nanosecond values (start_time=1585222245000000000, stop_time=1585222372000000000), so the s (v<1e10, *1000), ms (pass-through), and µs (>=1e15, /1000) branches are never validated by the pipeline test. A future regression in any of those branches would not be caught.

Recommendation:

Add TACACS accounting fixtures that carry start_time/stop_time in the other units so every branch resolves to the same instant, e.g.:

<181>Mar 20 12:09:20 HOSTNAME_DUMMY CISE_TACACS_Accounting 0000000001 1 0 2026-03-20 12:09:20.528 +00:00 0018415786 3302 NOTICE Tacacs-Accounting: TACACS+ Accounting STOP, ..., AVPair=start_time=1585222245, AVPair=stop_time=1585222372, ...,
<181>Mar 20 12:11:20 HOSTNAME_DUMMY CISE_TACACS_Accounting 0000000001 1 0 2026-03-20 12:11:20.528 +00:00 0018415787 3302 NOTICE Tacacs-Accounting: TACACS+ Accounting STOP, ..., AVPair=start_time=1585222245000, AVPair=stop_time=1585222372000, ...,

and extend the -expected.json so both resolve to 2020-03-26T11:30:45.000Z / 11:32:52.000Z, matching the nanosecond case.


🤖 AI-Generated Review | Vera Review Bot | 📚 Knowledge base: integration-skills

⚠️ Automated review — verify suggestions before applying.

@vera-review-bot

Copy link
Copy Markdown

Review summary

Issues found across the latest commits 2be9d23 — 1 low
  • 🔵 The new epoch-normalization script has four unit branches (s/ms/µs/ns) but the added test only covers nanoseconds (link) (Unresolved)
Issues found across earlier commits 8b2255d — 1 low
  • 🔵 The new epoch-normalization script has four unit branches (s/ms/µs/ns) but the pipeline tests only exercise the seconds and nanosecond paths (link) (Resolved)

A new commit triggers another review — at most once every 15 minutes. I skip the PR while it's approved or has merge conflicts.

🤖 AI-Generated Review | Vera Review Bot | 📚 Knowledge base: integration-skills

⚠️ Automated review — verify suggestions before applying.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

TL;DR

The failed Buildkite step did not reach the PR’s Cisco ISE pipeline changes. It failed during CI setup while apt-get install python3-venv tried to download stale Ubuntu python3.10 package URLs that returned 404 Not Found, so this is an infrastructure/package mirror issue and the immediate action is to retry the build.

Remediation

  • Retry Buildkite build 45535; the apt package index/mirror mismatch is usually transient.
  • If the same step keeps failing, update .buildkite/scripts/run_buildkite_scripts_tests.sh to make the python3-venv fallback more resilient, for example by refreshing apt metadata again and retrying the install with --fix-missing before failing.
Investigation details

Root Cause

The job failed in the setup fallback in .buildkite/scripts/run_buildkite_scripts_tests.sh:24-32, where the script installs python3-venv if python3 -m venv is unavailable. The install attempted to fetch Ubuntu Jammy security packages for python3.10 version 3.10.12-1~22.04.16, but the mirror returned 404s for those .deb files.

The PR diff only changes packages/cisco_ise package files and TACACS accounting pipeline test data, so the failed Buildkite scripts unit test step is unrelated to the PR’s ingest pipeline logic.

Evidence

E: Failed to fetch (security.ubuntu.com/redacted)  404  Not Found
E: Failed to fetch (security.ubuntu.com/redacted)  404  Not Found
E: Failed to fetch (security.ubuntu.com/redacted)  404  Not Found
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
^^^ +++
🚨 Error: The command exited with status 100

Verification

  • Not run: the Buildkite job failed before the repository script tests executed, during the python3-venv installation fallback.

Follow-up

  • If retrying does not clear the failure, inspect the Buildkite image’s Python/apt state and consider making the CI setup script retry the apt fallback more defensively.

What is this? | From workflow: PR Buildkite Detective

Give us feedback! React with 🚀 if perfect, 👍 if helpful, 👎 if not.

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

✅ All changelog entries have the correct PR link.

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@andrewkroh andrewkroh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@mergify

mergify Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request
@robester0403
robester0403 merged commit 328fa8d into elastic:main Jul 6, 2026
9 checks passed
@robester0403
robester0403 deleted the cisco-ise-TACACS-time-fix branch July 6, 2026 21:10
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Package cisco_ise - 1.32.8 containing this change is available at https://epr.elastic.co/package/cisco_ise/1.32.8/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes a bug issue Integration:cisco_ise Cisco ISE Team:Integration-Experience Security Integrations Integration Experience [elastic/integration-experience]

2 participants